1
0
mirror of https://github.com/git/git.git synced 2024-10-03 16:22:22 +02:00
Commit Graph

798 Commits

Author SHA1 Message Date
Junio C Hamano
49a52b1d1f Move sideband client side support into reusable form.
This moves the receiver side of the sideband support from
fetch-clone.c to sideband.c and its header file, so that
archiver protocol can use it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-10 13:36:35 -07:00
Franck Bui-Huu
39345a216f Add git-upload-archive
This command implements the git archive protocol on the server
side. This command is not intended to be used by the end user.
Underlying git-archive command line options are sent over the
protocol from "git-archive --remote=...", just like upload-tar
currently does with "git-tar-tree=...".

As for "git-archive" command implementation, this new command
does not execute any existing "git-{tar,zip}-tree" but rely
on the archive API defined by "git-archive" patch. Hence we
get 2 good points:

 - "git-archive" and "git-upload-archive" share all option
   parsing code.

 - All kind of git-upload-{tar,zip} can be deprecated.

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-09 11:57:37 -07:00
Franck Bui-Huu
4df096a5ca Add git-archive
git-archive is a command to make TAR and ZIP archives of a git tree.
It helps prevent a proliferation of git-{format}-tree commands.

Instead of directly calling git-{tar,zip}-tree command, it defines
a very simple API, that archiver should implement and register in
"git-archive.c". This API is made up by 2 functions whose prototype
is defined in "archive.h" file.

 - The first one is used to parse 'extra' parameters which have
   signification only for the specific archiver. That would allow
   different archive backends to have different kind of options.

 - The second one is used to ask to an archive backend to build
   the archive given some already resolved parameters.

The main reason for making this API is to avoid using
git-{tar,zip}-tree commands, hence making them useless. Maybe it's
time for them to die ?

It also implements remote operations by defining a very simple
protocol: it first sends the name of the specific uploader followed
the repository name (git-upload-tar git://example.org/repo.git).
Then it sends options. It's done by sending a sequence of one
argument per packet, with prefix "argument ", followed by a flush.

The remote protocol is implemented in "git-archive.c" for client
side and is triggered by "--remote=<repo>" option. For example,
to fetch a TAR archive in a remote repo, you can issue:

$ git archive --format=tar --remote=git://xxx/yyy/zzz.git HEAD

We choose to not make a new command "git-fetch-archive" for example,
avoind one more GIT command which should be nice for users (less
commands to remember, keeps existing --remote option).

Signed-off-by: Franck Bui-Huu <vagabon.xyz@gmail.com>
Acked-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-09 11:57:36 -07:00
Jeff King
c91f0d92ef git-commit.sh: convert run_status to a C builtin
This creates a new git-runstatus which should do roughly the same thing
as the run_status function from git-commit.sh. Except for color support,
the main focus has been to keep the output identical, so that it can be
verified as correct and then used as a C platform for other improvements to
the status printing code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-08 16:46:35 -07:00
Jeff King
7c92fe0eaa Move color option parsing out of diff.c and into color.[ch]
The intent is to lib-ify colorizing code so it can be reused.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-08 16:44:10 -07:00
Junio C Hamano
c64ed70d25 Separate object listing routines out of rev-list
Create a separate file, list-objects.c, and move object listing
routines from rev-list to it.  The next round will use it in
pack-objects directly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-07 02:46:01 -07:00
Jakub Narebski
0b5deba132 gitweb: Add GIT favicon, assuming image/png type
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-09-04 15:33:04 -07:00
Christian Couder
7cf67205ca Trace into open fd and refactor tracing code.
Now if GIT_TRACE is set to an integer value greater than 1
and lower than 10, we interpret this as an open fd value
and we trace into it. Note that this behavior is not
compatible with the previous one.

We also trace whole messages using one write(2) call to
make sure messages from processes do net get mixed up in
the middle.

It's now possible to run the tests like this:

	GIT_TRACE=9 make test 9>/var/tmp/trace.log

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-31 14:16:38 -07:00
Johannes Schindelin
104ff34a74 Makefile: fix typo
We checked NO_SETENV instead of NO_UNSETENV to decide if unsetenv
is available.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-29 14:26:14 -07:00
Junio C Hamano
1e49cb8ad4 Merge branch 'js/c-merge-recursive'
* js/c-merge-recursive: (21 commits)
  discard_cache(): discard index, even if no file was mmap()ed
  merge-recur: do not die unnecessarily
  merge-recur: try to merge older merge bases first
  merge-recur: if there is no common ancestor, fake empty one
  merge-recur: do not setenv("GIT_INDEX_FILE")
  merge-recur: do not call git-write-tree
  merge-recursive: fix rename handling
  .gitignore: git-merge-recur is a built file.
  merge-recur: virtual commits shall never be parsed
  merge-recur: use the unpack_trees() interface instead of exec()ing read-tree
  merge-recur: fix thinko in unique_path()
  Makefile: git-merge-recur depends on xdiff libraries.
  merge-recur: Explain why sha_eq() and struct stage_data cannot go
  merge-recur: Cleanup last mixedCase variables...
  merge-recur: Fix compiler warning with -pedantic
  merge-recur: Remove dead code
  merge-recur: Get rid of debug code
  merge-recur: Convert variable names to lower_case
  Cumulative update of merge-recursive in C
  recur vs recursive: help testing without touching too many stuff.
  ...

This is an evil merge that removes TEST script from the toplevel.
2006-08-27 20:33:46 -07:00
Rene Scharfe
e4fbbfe9ec Add git-zip-tree
In the Windows world ZIP files are better supported than tar files.
Windows even includes built-in support for ZIP files nowadays.

git-zip-tree is similar to git-tar-tree; it creates ZIP files out of
git trees.  It stores the commit ID (if available) in a ZIP file comment
which can be extracted by unzip.

There's still quite some room for improvement: this initial version
supports no symlinks, calls write() way too often (three times per file)
and there is no unit test.

[jc: with a minor typefix to avoid void* arithmetic]

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-26 18:27:35 -07:00
Rene Scharfe
7230e6d042 Add write_or_die(), a helper function
The little helper write_or_die() won't come back with bad news about
full disks or broken pipes.  It either succeeds or terminates the
program, making additional error handling unnecessary.

This patch adds the new function and uses it to replace two similar
ones (the one in tar-tree originally has been copied from cat-file
btw.).  I chose to add the fd parameter which both lacked to make
write_or_die() just as flexible as write() and thus suitable for
lib-ification.

There is a regression: error messages emitted by this function don't
show the program name, while the replaced two functions did.  That's
acceptable, I think; a lot of other functions do the same.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-21 20:22:23 -07:00
Junio C Hamano
8e3abd4c97 Merge branch 'jc/racy'
* jc/racy:
  Remove the "delay writing to avoid runtime penalty of racy-git avoidance"
  Add check program "git-check-racy"
  Documentation/technical/racy-git.txt
  avoid nanosleep(2)
2006-08-16 14:00:34 -07:00
Jakub Narebski
19a8721ef8 gitweb: Show project's git URL on summary page
From 31e4de9f22a3b17d4ad0ac800132e4e1a0a15006 Mon Sep 17 00:00:00 2001
From: David Rientjes <rientjes@google.com>
Date: Tue, 15 Aug 2006 11:43:04 -0700
Subject: [PATCH] gitweb: Show project's git URL on summary page

Add support for showing multiple clone/fetch git URLs for project on
a summary page. URL for project is created from base URL and project
name.

For example for XMMS2 project (xmms.se) the git base URL would be
git://git.xmms.se/xmms2.

With corrections from David Rientjes <rientjes@google.com>

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 21:54:26 -07:00
Junio C Hamano
42f774063d Add check program "git-check-racy"
This will help counting the racily clean paths, but it should be
useless for daily use.  Do not even enable it in the makefile.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 21:38:07 -07:00
Junio C Hamano
c9c3470aec Merge branch 'maint'
* maint:
  finish_connect(): thinkofix
  git-mv: succeed even if source is a prefix of destination
  Solaris does not support C99 format strings before version 10
2006-08-15 21:15:32 -07:00
Dennis Stosberg
60a144f280 Fix compilation with Sun CC
- Add the CFLAGS variable to config.mak.in to override the Makefile's
  default, which is gcc-specific and won't work with Sun CC.
- Prefer "cc" over "gcc", because Pasky's Git.pm will not compile with gcc
  on Solaris at all. On Linux and the free BSDs "cc" is linked to "gcc"
  anyway.
- Set correct flag to generate position-independent code.
- Add "-xO3" (= use default optimization level) to CFLAGS.

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 03:13:47 -07:00
Junio C Hamano
d7b6c3c0f5 Merge branch 'master' into pb/gitpm
* master: (166 commits)
  git-apply --binary: clean up and prepare for --reverse
  Fix detection of ipv6 on Solaris
  Look for sockaddr_storage in sys/socket.h
  Solaris has strlcpy() at least since version 8
  git-apply --reverse: simplify reverse option.
  t4116 apply --reverse test
  Make sha1flush void and remove conditional return.
  Make upload_pack void and remove conditional return.
  Make track_tree_refs void.
  Make pack_objects void.
  Make fsck_dir void.
  Make checkout_all void.
  Make show_entry void
  Make pprint_tag void and cleans up call in cmd_cat_file.
  Remove combine-diff.c::uninteresting()
  read-cache.c cleanup
  http-push.c cleanup
  diff.c cleanup
  builtin-push.c cleanup
  builtin-grep.c cleanup
  ...
2006-08-15 03:13:34 -07:00
Dennis Stosberg
f4e14ca9e0 Solaris has strlcpy() at least since version 8
See http://docs.sun.com/app/docs/doc/816-3321/6m9k23sjk?a=view

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 02:57:24 -07:00
Dennis Stosberg
66c4509b73 Solaris does not support C99 format strings before version 10
Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-15 02:55:39 -07:00
Yasushi SHOJI
2de21fac98 gitweb: configurable home link string
I've always found difficult to figure out git URL for clone from
gitweb URL because git:// and http:// are different on many site
including kernel.org.

I've found this enhancement at http://dev.laptop.org/git when I was on
git channel, and thought that it'd be nice if all public gitweb site
show it's git URL on its page.

This patch allow us to change the home link string.  The current
default is "projects" as we all see on gitweb now.

ie. kernel.org might set this variable to "git://git.kernel.org/pub/scm/"

Signed-off-by: Yasushi SHOJI <yashi@atmark-techno.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-14 18:09:33 -07:00
Junio C Hamano
eb4541569d Merge branch 'js/read-tree' 2006-08-12 19:29:11 -07:00
Junio C Hamano
efced1e06e Merge branch 'lt/web' 2006-08-12 19:24:09 -07:00
Junio C Hamano
86183fbb09 Merge branch 'jn/conf' 2006-08-12 19:23:09 -07:00
Junio C Hamano
eed94a570e Merge branch 'master' into js/c-merge-recursive
Adjust to hold_lock_file_for_update() change on the master.
2006-08-12 18:35:14 -07:00
Rene Scharfe
2e3ed670eb git-verify-pack: make builtin
Convert git-verify-pack to a builtin command.  Also rename ac to argc
and av to argv for consistancy.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-10 14:19:06 -07:00
Junio C Hamano
1b1b678e3c autoconf: clean temporary file mak.append
When configure is interrupted in the middle it leaves
config.mak.append behind.  Add it to .gitignore and make sure
$(MAKE) clean removes it.

Also earlier .gitignore listed config.mak.in which is a tracked
file.  Fix it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-08 17:19:28 -07:00
Junio C Hamano
102cb08521 Merge branch 'master' into mk/rename 2006-08-08 15:42:20 -07:00
Jakub Narebski
3900145ed7 autoconf: Add configure target to main Makefile
While at it fill git version information in configure.ac
configure target needs autoconf, of course.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-08 13:32:04 -07:00
Junio C Hamano
9673198ee8 Merge branch 'master' into pb/gitpm
This is to resolve the conflicts with Ryan's annotate updates early.
2006-08-07 17:02:07 -07:00
Junio C Hamano
0d958ac47a Makefile: Cygwin does not seem to need NO_STRLCPY
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-05 13:52:05 -07:00
Jakub Narebski
465e649d0c autoconf: Typo cleanup, reordering etc.
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-04 11:53:13 -07:00
Junio C Hamano
f754fa9c54 builtins: Makefile clean-up
This cleans up the build procedure for built-in commands by:

 - generating mostly redundant definition of BUILT_INS from
   BUILTIN_OBJS in the Makefile,
 - renaming a few files to make the above possible, and
 - sorting the built-in command table in git.c.

It might be a good idea to binary search (or perfect hash) the built-in
command table, but that can be done later when somebody feels like.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-04 01:51:04 -07:00
Junio C Hamano
e414156ab6 Make git-checkout-index a builtin
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-04 01:23:19 -07:00
Matthias Kestenholz
640ce1052b Make git-symbolic-ref a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-03 23:15:11 -07:00
Matthias Kestenholz
6441363079 Make git-unpack-objects a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-03 23:15:11 -07:00
Matthias Kestenholz
5d4a600335 Make git-pack-objects a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-03 23:15:11 -07:00
Matthias Kestenholz
d6b64ed0f3 Make git-name-rev a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-03 23:15:11 -07:00
Junio C Hamano
c8b87ef8b0 .gitignore: git-merge-recur is a built file.
Also it is OK to omit the documentation for it at least for now.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-03 16:17:51 -07:00
Junio C Hamano
70b9c59656 Cygwin needs NO_C99_FORMAT???
I noticed that t3800 test breaks with git built without this
option.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 17:06:50 -07:00
Matthias Kestenholz
e12c095aa6 Make git-repo-config a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 17:05:14 -07:00
Junio C Hamano
06c084d28b gitweb: do not use @@FOO@@ for replaced tokens
This makes it easier to run gitweb/gitweb.perl without token substitution.
Using @@ makes Perl emit "unintended interpolation" warnings.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 13:58:04 -07:00
Jeff King
c8d138a8c0 gitweb: optionally read config from GITWEB_CONFIG
Configuration will first be taken from variables inside the gitweb.cgi
script, which in turn come from the Makefile. Afterwards, the contents of
GITWEB_CONFIG are read, overriding the builtin defaults.

This should eliminate the need for editing the gitweb script at all. Users
should edit the Makefile and/or add a config file.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 13:56:34 -07:00
Matthias Kestenholz
53bb2c002a Make git-prune-packed a builtin
Signed-off-by: Matthias Kestenholz <matthias@spinlock.ch>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 11:36:01 -07:00
Ramsay Allan Jones
579d1fbfaf Add NO_C99_FORMAT to support older compilers.
The NO_C99_FORMAT macro allows compilers that lack support for the
ll,hh,j,z,t size specifiers (eg. gcc 2.95.2) to adapt the code to avoid
runtime errors in the formatted IO functions.

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 00:27:18 -07:00
Ramsay Allan Jones
7ffe7098dc Fix installation of templates on ancient systems.
Do not use $(call) for 'shell quoting' paths, and pass DESTDIR down
to the templates makefile.

[jc: we have fixed the main Makefile long time ago, but somehow
 forgot to apply the same fix to templates Makefile.]

Signed-off-by: Ramsay Allan Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-02 00:27:18 -07:00
Junio C Hamano
22987ae0bc Makefile: gitweb/gitweb.cgi is now generated.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-01 16:23:47 -07:00
Martin Waitz
281f2f6b45 gitweb: use out-of-line GIT logo.
Use the normal web server instead of the CGI to provide the git logo,
just like the gitweb.css.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-01 15:55:19 -07:00
Martin Waitz
5d043a3d85 gitweb: fill in gitweb configuration by Makefile
Generate gitweb/gitweb.cgi to reduce the need to patch gitweb.cgi
by the end user.  The GIT installation directory is already known
by the Makefile, and can be inserted directly into gitweb.
All other gitweb configuration parameters can now be specified by
providing GITWEB_* variables while building GIT.  These are described
in gitweb/README.

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-08-01 15:44:47 -07:00
Junio C Hamano
c1a788acee Merge branch 'js/read-tree' into js/c-merge-recursive
* js/read-tree: (107 commits)
  read-tree: move merge functions to the library
  read-trees: refactor the unpack_trees() part
  tar-tree: illustrate an obscure feature better
  git.c: allow alias expansion without a git directory
  setup_git_directory_gently: do not barf when GIT_DIR is given.
  Build on Debian GNU/kFreeBSD
  Call setup_git_directory() much earlier
  Call setup_git_directory() early
  Display an error from update-ref if target ref name is invalid.
  Fix http-fetch
  t4103: fix binary patch application test.
  git-apply -R: binary patches are irreversible for now.
  Teach git-apply about '-R'
  Makefile: ssh-pull.o depends on ssh-fetch.c
  log and diff family: honor config even from subdirectories
  git-reset: detect update-ref error and report it.
  lost-found: use fsck-objects --full
  Teach git-http-fetch the --stdin switch
  Teach git-local-fetch the --stdin switch
  Make pull() support fetching multiple targets at once
  ...
2006-07-30 23:42:10 -07:00
Johannes Schindelin
16da134b1f read-trees: refactor the unpack_trees() part
Basically, the options are passed by a struct unpack_trees_options now.
That's all.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-30 23:31:31 -07:00
Gerrit Pape
ca7a741647 Build on Debian GNU/kFreeBSD
Patch from Petr Salinger to make the build process detect and support the
Debian GNU/kFreeBSD architecture, see
 http://bugs.debian.org/380209

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-30 13:36:12 -07:00
Junio C Hamano
522a98caa5 Merge branch 'js/mv'
* js/mv:
  builtin git-mv: support moving directories
  Make git-mv a builtin
  Extract helper bits from c-merge-recursive work
2006-07-30 13:24:48 -07:00
Junio C Hamano
2dcb927f37 Merge branch 'jn/make'
* jn/make:
  Set datarootdir in config.mak.in
  Quote all calls to GIT_CONF_APPEND_LINE
  Typofix in configure.ac comment.
  configure.ac vertical whitespace usage cleanup
  autoconf: Checks for some programs
  autoconf: Checks for libraries
  autoconf: Checks for some library functions.
  autoconf: Checks for typedefs, structures, and compiler characteristics.
  autoconf: Preparing the way for autodetection
  Copy description of build configuration variables to configure.ac
  Teach make clean about configure and autoconf
  autoconf: Use autoconf to write installation directories to config.mak.autogen
2006-07-30 13:24:29 -07:00
Johannes Schindelin
2941cab99c Makefile: ssh-pull.o depends on ssh-fetch.c
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-28 11:15:35 -07:00
Junio C Hamano
a060b803b4 Makefile: git-merge-recur depends on xdiff libraries.
Tighten dependencies to allow parallel build.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-27 22:02:45 -07:00
Johannes Schindelin
11be42a476 Make git-mv a builtin
This also moves add_file_to_index() to read-cache.c. Oh, and while
touching builtin-add.c, it also removes a duplicate git_config() call.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 13:36:36 -07:00
Junio C Hamano
24cf6e5847 Merge branch 'pb/configure'
* pb/configure:
  Rename man1 and man7 variables to man1dir and man7dir
  Allow INSTALL, bindir, mandir to be set in main Makefile
2006-07-26 13:35:35 -07:00
Johannes Schindelin
941ba215fb git-instaweb: respect bindir from Makefile
Not everybody installs git to /usr/bin/git.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-26 12:24:19 -07:00
Shawn Pearce
8eb38cad44 Disable linking with Fink or DarwinPorts.
It may be desirable for the compiler to disable linking against Fink
or DarwinPorts, especially if both are installed on the system and
the user wants GIT to be linked specifically to only one of them.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-23 23:39:37 -07:00
Johannes Schindelin
6d297f8137 Status update on merge-recursive in C
This is just an update for people being interested. Alex and me were
busy with that project for a few days now. While it has progressed nicely,
there are quite a couple TODOs in merge-recursive.c, just search for "TODO".

For impatient people: yes, it passes all the tests, and yes, according
to the evil test Alex did, it is faster than the Python script.

But no, it is not yet finished. Biggest points are:

- there are still three external calls
- in the end, it should not be necessary to write the index more than once
  (just before exiting)
- a lot of things can be refactored to make the code easier and shorter

BTW we cannot just plug in git-merge-tree yet, because git-merge-tree
does not handle renames at all.

This patch is meant for testing, and as such,

- it compile the program to git-merge-recur
- it adjusts the scripts and tests to use git-merge-recur instead of
  git-merge-recursive
- it provides "TEST", a script to execute the tests regarding -recursive
- it inlines the changes to read-cache.c (read_cache_from(), discard_cache()
  and refresh_cache_entry())

Brought to you by Alex Riesen and Dscho

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-13 23:10:19 -07:00
Junio C Hamano
3939b805f4 Merge branch 'lt/prune'
* lt/prune:
  builtin "git prune"
2006-07-12 22:31:55 -07:00
Junio C Hamano
096b173234 Merge branch 'lt/merge-tree'
* lt/merge-tree:
  Improved three-way blob merging code
  Prepare "git-merge-tree" for future work
  xdiff: generate "anti-diffs" aka what is common to two files
2006-07-12 22:31:22 -07:00
Junio C Hamano
e6ff54a261 Merge branch 'ew/svn'
* ew/svn:
  Fix some doubled word typos
  Typofix in Makefile comment.
  Makefile: export NO_SVN_TESTS
  git-svn: migrate out of contrib (follow-up)
  git-svn: migrate out of contrib
2006-07-09 23:37:19 -07:00
Pavel Roskin
02853588a4 Typofix in Makefile comment.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-09 02:44:58 -07:00
Pavel Roskin
addf88e455 Assorted typo fixes
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-09 02:42:41 -07:00
Linus Torvalds
ba84a797e7 builtin "git prune"
This actually removes the objects to be pruned, unless you specify "-n"
(at which point it will just tell you which files it would prune).

This doesn't do the pack-file pruning that the shell-script used to do,
but if somebody really wants to, they could add it easily enough. I wonder
how useful it is, though, considering that "git repack -a -d" is just a
lot more efficient and generates a better end result.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-09 00:57:22 -07:00
Jakub Narebski
92b878ade1 Teach make clean about configure and autoconf
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-08 14:24:06 -07:00
Junio C Hamano
998c4daaf4 Work around sed and make interactions on the backslash at the end of line.
Traditionally 'i' and 'a' commands to sed have been unfriendly
with make, primarily because different make implementations did
unexpected things to backslashes at the end of lines.  So work
it around by not using 'i' command.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-08 14:15:09 -07:00
Michal Rokos
d9bffc08fd Using 'perl' in *.sh
Some GIT's shell script are using bare 'perl' for perl invocation.
Use @@PERL@@ symbol and replace it with PERL_PATH_SQ everywhere.

Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-08 11:35:20 -07:00
Michal Rokos
6e959ab05a sed -e '/RE/r rfile/' needs space in 'r rfile'
Some implementations of sed (like HP-UX one) mandate a space between 'r'
and 'rfile'.

Signed-off-by: Michal Rokos <michal.rokos@nextsoft.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-08 11:28:32 -07:00
Johannes Schindelin
140245b3e2 Makefile: export NO_SVN_TESTS
Without this patch, it really is not sufficient to define NO_SVN_TESTS
in config.mak or the Makefile.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-07 12:43:45 -07:00
Eric Wong
60d02ccc18 git-svn: migrate out of contrib
Allow NO_SVN_TESTS to be defined to skip git-svn tests.  These
tests are time-consuming due to SVN being slow, and even more so
if SVN Perl libraries are not available.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-06 17:02:47 -07:00
Junio C Hamano
c31cfb3db3 Merge branch 'ew/instaweb'
* ew/instaweb:
  instaweb: fix unportable ';' usage in sed
  Makefile: replace ugly and unportable sed invocation
  Add git-instaweb, instantly browse the working repo with gitweb
  gitweb: Declare global variables with "our"
  gitweb: Enable tree (directory) history display
  gitweb: optimize per-file history generation
2006-07-06 17:01:00 -07:00
Junio C Hamano
b296990c3b Merge branch 'jc/sha1'
* jc/sha1:
  A better-scheduled PPC SHA-1 implementation.
  test-sha1: test hashing large buffer
  Makefile: add framework to verify and bench sha1 implementations.
2006-07-05 16:36:25 -07:00
Johannes Schindelin
00449f992b Make git-fmt-merge-msg a builtin
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-03 19:42:41 -07:00
Petr Baudis
6fcca938b0 Use $GITPERLLIB instead of $RUNNING_GIT_TESTS and centralize @INC munging
This makes the Git perl scripts check $GITPERLLIB instead of
$RUNNING_GIT_TESTS, which makes more sense if you are setting up your shell
environment to use a non-installed Git instance.

It also weeds out the @INC munging from the individual scripts and makes
Makefile add it during the .perl files processing, so that we can change
just a single place when we modify this shared logic. It looks ugly in the
scripts, too. ;-)

And instead of doing arcane things with the @INC array, we just do 'use lib'
instead, which is essentialy the same thing anyway.

I first want to do three separate patches but it turned out that it's quite
a lot neater when bundled together, so I hope it's ok.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-03 18:34:53 -07:00
Junio C Hamano
8fced61cbc Makefile: tighten git-http-{fetch,push} dependencies
Although our "git-%$X:" implicit target had dependency on
$(GITLIBS) which included xdiff/lib.a, git-http-{fetch,push} had
their own building rules and with an obsolete dependency on
$(LIB_FILES).  Update the rules to depend on $(GITLIBS), to make
parallel build work correctly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-03 00:58:34 -07:00
Junio C Hamano
3553309f5b Git.pm: clean generated files.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:44 -07:00
Junio C Hamano
893973a6f2 Perly git: work around buggy make implementations.
FC4 uses gnumake 3.80 whose annoying "Entering directory..."
messages are not silenced with -s alone.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:43 -07:00
Junio C Hamano
c35ebc902f Makefile: Set USE_PIC on x86-64
On some platforms, Git.xs refuses to link with the rest of git
unless the latter is compiled with -fPIC, and we have USE_PIC
control in the Makefile for the user to set it.  At least we
know x86-64 is such, so set it in the Makefile.

The original suggestion by Marco Roeland conservatively did this
only for Linux x86-64, but let's keep the Makefile simple and if
it breaks somebody let them holler.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:43 -07:00
Dennis Stosberg
c9093fb38b Add possibility to pass CFLAGS and LDFLAGS specific to the perl subdir
Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:43 -07:00
Petr Baudis
8d7f586f13 Git.pm: Support for perl/ being built by a different compiler
dst_ on #git reported that on Solaris 9, Perl was built by Sun CC
and perl/ is therefore being built with it as well, while the rest
of Git is built with gcc. The problem (the first one visible, anyway)
is that we passed perl/ even various gcc-specific options. This
separates those to a special variable.

This is not really meant for an application yet since it's not clear
if it will alone help anything.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:43 -07:00
Dennis Stosberg
de86e131b5 Makefile fix for Solaris
Solaris' /bin/sh does not support $( )-style command substitution

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:43 -07:00
Dennis Stosberg
c2eeb4dcfe "test" in Solaris' /bin/sh does not support -e
Running "make clean" currently fails:
  [ ! -e perl/Makefile ] || make -C perl/ clean
  /bin/sh: test: argument expected
  make: *** [clean] Error 1

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:42 -07:00
Junio C Hamano
f6276fe159 Git.pm: tentative fix to test the freshly built Git.pm
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:42 -07:00
Petr Baudis
d595a473ee Git.pm: assorted build related fixes.
- We passed our own *.a archives as LIBS to the submake that runs
   in perl/; separate LIBS and EXTLIBS and pass the latter which
   tells what the system libraries are used.

 - The quoting of preprocesor symbol definitions passed down to
   perl/ submake was loose and we lost double quotes around
   include directives.  Use *_SQ to quote them properly.

 - The installation location of perl/ submake is not
   architecture neutral anymore, so use SITEARCH instead of
   SITELIB.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:42 -07:00
Junio C Hamano
523bbaa458 perl: fix make clean
When perl/Makefile is stale with respect to perl/Makefile.PL, it
prevents "make clean" from completing which is quite irritating.
Fix it by calling subdirectory make clean twice as needed.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:42 -07:00
Junio C Hamano
f6af75d29c Perl interface: add build-time configuration to allow building with -fPIC
On x86-64 it seems that Git.xs does not link without compiling
the main git objects with -fPIC.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:41 -07:00
Petr Baudis
63df97ae7b Git.pm: Implement Git::version()
Git::version() returns the Git version string.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:40 -07:00
Petr Baudis
b1edc53d06 Introduce Git.pm (v4)
This patch introduces a very basic and barebone Git.pm module
with a sketch of how the generic interface would look like;
most functions are missing, but this should give some good base.
I will continue expanding it.

Most desirable now is more careful error reporting, generic_in() for feeding
input to Git commands and the repository() constructor doing some poking
with git-rev-parse to get the git directory and subdirectory prefix.
Those three are basically the prerequisities for converting git-mv.
I will send them as follow-ups to this patch.

Currently Git.pm just wraps up exec()s of Git commands, but even that
is not trivial to get right and various Git perl scripts do it in
various inconsistent ways. In addition to Git.pm, there is now also
Git.xs which provides barebone Git.xs for directly interfacing with
libgit.a, and as an example providing the hash_object() function using
libgit.

This adds the Git module, integrates it to the build system and as
an example converts the git-fmt-merge-msg.perl script to it (the result
is not very impressive since its advantage is not quite apparent in this
one, but I just picked up the simplest Git user around).

Compared to v3, only very minor things were fixed in this patch (some
whitespaces, a missing export, tiny bug in git-fmt-merge-msg.perl);
at first I wanted to post them as a separate patch but since this
is still only in pu, I decided that it will be cleaner to just resend
the patch.

My current working state is available all the time at

	http://pasky.or.cz/~xpasky/git-perl/Git.pm

and an irregularily updated API documentation is at

	http://pasky.or.cz/~xpasky/git-perl/Git.html

Many thanks to Jakub Narebski, Junio and others for their feedback.

Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:14:40 -07:00
Jakub Narebski
556677144b autoconf: Use autoconf to write installation directories to config.mak.autogen
This is beginning of patch series introducing installation configuration
using autoconf (and no other autotools) to git. The idea is to generate
config.mak.autogen using ./configure (generated from configure.ac by running
autoconf) from config.mak.in, so one can use autoconf as an _alternative_ to
ordinary Makefile, and creating one's own config.mak. Local settings in
config.mak override generated settings in config.mak.autogen

This patch includes minimal configure.ac and config.mak.in, so one can set
installation directories using autoconf generated ./configure script
e.g. ./configure --prefix=/usr

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 17:11:52 -07:00
Johannes Schindelin
07002287f3 Makefile: replace ugly and unportable sed invocation
Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-02 11:04:50 -07:00
Eric Wong
a51d37c1df Add git-instaweb, instantly browse the working repo with gitweb
I got tired of having to configure gitweb for every repository
I work on.  I sometimes prefer gitweb to standard GUIs like gitk
or gitview; so this lets me automatically configure gitweb to
browse my working repository and also opens my browser to it.

Updates from the original patch:

Added Apache/mod_perl2 compatibility if Dennis Stosberg's gitweb
has been applied, too: <20060621130708.Gcbc6e5c@leonov.stosberg.net>

General cleanups in shell code usage.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-07-01 18:29:26 -07:00
Jakub Narebski
7b8cf0cf29 Rename man1 and man7 variables to man1dir and man7dir
This patch renames man1 and man7 variables to man1dir and man7dir,
according to "Makefile Conventions: Variables for Installation
Directories" in make.info of GNU Make.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-29 23:49:16 -07:00
Jakub Narebski
e14421b9aa Allow INSTALL, bindir, mandir to be set in main Makefile
Makefiles in subdirectories now use existing value of INSTALL, bindir,
mandir if it is set, allowing those to be set in main Makefile or in
included config.mak.  Main Makefile exports variables which it sets.

Accidentally it renames bin to bindir in Documentation/Makefile
(should be bindir from start, but is unused, perhaps to be removed).

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-29 23:49:16 -07:00
Linus Torvalds
0c7993839b Improved three-way blob merging code
This fleshes out the code that generates a three-way merge of a set of
blobs.

It still actually does the three-way merge using an external executable
(ie just calling "merge"), but the interfaces have been cleaned up a lot
and are now fully based on the 'mmfile_t' interface, so if libxdiff were
to ever grow a compatible three-way-merge, it could probably be directly
plugged in.

It also uses the previous XDL_EMIT_COMMON functionality extension to
libxdiff to generate a made-up base file for the merge for the case where
no base file previously existed. This should be equivalent to what we
currently do in git-merge-one-file.sh:

	diff -u -La/$orig -Lb/$orig $orig $src2 | git-apply --no-add

except it should be much simpler and can be done using the direct libxdiff
interfaces.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-28 22:24:45 -07:00
Peter Eriksen
817151e61a Rename safe_strncpy() to strlcpy().
This cleans up the use of safe_strncpy() even more.  Since it has the
same semantics as strlcpy() use this name instead.  Also move the
definition from inside path.c to its own file compat/strlcpy.c, and use
it conditionally at compile time, since some platforms already has
strlcpy().  It's included in the same way as compat/setenv.c.

Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-24 23:16:25 -07:00
Junio C Hamano
b65bc21e7d Makefile: add framework to verify and bench sha1 implementations.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-24 01:10:40 -07:00
Junio C Hamano
1f33026937 Makefile: do not recompile main programs when libraries have changed.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-22 16:20:54 -07:00
Junio C Hamano
5ab2c0a475 Merge branch 'js/lsfix'
* js/lsfix:
  Initialize lock_file struct to all zero.
  Make git-update-ref a builtin
  Make git-update-index a builtin
  Make git-stripspace a builtin
  Make git-mailinfo a builtin
  Make git-mailsplit a builtin
  Make git-write-tree a builtin
2006-06-22 10:35:13 -07:00
Junio C Hamano
16bf4e1f1e Merge branch 'jc/upload-corrupt'
* jc/upload-corrupt:
  daemon: send stderr to /dev/null instead of closing.
  upload-pack/fetch-pack: support side-band communication
  Retire git-clone-pack
  upload-pack: prepare for sideband message support.
  upload-pack: avoid sending an incomplete pack upon failure
2006-06-22 10:25:51 -07:00
Junio C Hamano
bbc932c845 Makefile: do not force unneeded recompilation upon GIT_VERSION changes
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-22 02:04:27 -07:00
Yakov Lerner
c1f8064b14 Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used.
Before this patch, -DDEFAULT_GIT_TEMPLATE_DIR was passed on compilation
command line to all and every .c file compiled. In fact the macro
is used by only one .c file, and unused by all other .c files.
Remove -DDEFAULT_GIT_TEMPLATE_DIR where unused. Follow the example of
exec_cmd.o. Pass -DDEFAULT_GIT_TEMPLATE_DIR only where actually used.

Signed-off-by: Yakov Lerner <iler.ml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-22 00:11:23 -07:00
Junio C Hamano
efc7fa5355 Retire git-clone-pack
The program is not used by git-clone since git-fetch-pack was extended
to allow its caller do what git-clone-pack alone did, and git-clone was
updated to use it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-21 02:34:14 -07:00
Linus Torvalds
855419f764 Add specialized object allocator
This creates a simple specialized object allocator for basic
objects.

This avoids wasting space with malloc overhead (metadata and
extra alignment), since the specialized allocator knows the
alignment, and that objects, once allocated, are never freed.

It also allows us to track some basic statistics about object
allocations. For example, for the mozilla import, it shows
object usage as follows:

     blobs:   627629 (14710 kB)
     trees:  1119035 (34969 kB)
   commits:   196423  (8440 kB)
      tags:     1336    (46 kB)

and the simpler allocator shaves off about 2.5% off the memory
footprint off a "git-rev-list --all --objects", and is a bit
faster too.

[ Side note: this concludes the series of "save memory in object storage".
  The thing is, there simply isn't much more to be saved on the objects.

  Doing "git-rev-list --all --objects" on the mozilla archive has a final
  total RSS of 131498 pages for me: that's about 513MB. Of that, the
  object overhead is now just 56MB, the rest is going somewhere else (put
  another way: the fact that this patch shaves off 2.5% of the total
  memory overhead, considering that objects are now not much more than 10%
  of the total shows how big the wasted space really was: this makes
  object allocations much more memory- and time-efficient).

  I haven't looked at where the rest is, but I suspect the bulk of it is
  just the pack-file loading. It may be that we should pack the tree
  objects separately from the blob objects: for git-rev-list --objects, we
  don't actually ever need to even look at the blobs, but since trees and
  blobs are interspersed in the pack-file, we end up not being dense in
  the tree accesses, so we end up looking at more pages than we strictly
  need to.

  So with a 535MB pack-file, it's entirely possible - even likely - that
  most of the remaining RSS is just the mmap of the pack-file itself. We
  don't need to map in _all_ of it, but we do end up mapping a fair
  amount. ]

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-19 18:42:21 -07:00
Lukas Sandström
854b4629f9 Make git-update-ref a builtin
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18 22:12:20 -07:00
Lukas Sandström
fefe81c996 Make git-update-index a builtin
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18 22:12:19 -07:00
Lukas Sandström
7499c99615 Make git-stripspace a builtin
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18 22:12:16 -07:00
Lukas Sandström
34488e3c37 Make git-mailinfo a builtin
[jc: with a bit of constness tightening]

Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18 22:10:28 -07:00
Lukas Sandström
e690e84315 Make git-mailsplit a builtin
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18 21:58:20 -07:00
Lukas Sandström
8ed05fb5e9 Make git-write-tree a builtin
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18 21:58:19 -07:00
Junio C Hamano
64e86c5786 Merge branch 'yl/build'
* yl/build:
  auto-detect changed prefix and/or changed build flags
2006-06-18 21:18:49 -07:00
Linus Torvalds
3e4339e6f9 Remove "refs" field from "struct object"
This shrinks "struct object" to the absolutely minimal size possible.
It now contains /only/ the object flags and the SHA1 hash name of the
object.

The "refs" field, which is really needed only for fsck, is maintained in
a separate hashed lookup-table, allowing all normal users to totally
ignore it.

This helps memory usage, although not as much as I hoped: it looks like
the allocation overhead of malloc (and the alignment constraints in
particular) means that while the structure size shrinks, the actual
allocation overhead mostly does not.

[ That said: memory usage is actually down, but not as much as it should
  be: I suspect just one of the object types actually ended up shrinking
  its effective allocation size.

  To get to the next level, we probably need specialized allocators that
  don't pad the allocation more than necessary. ]

The separation makes for some code cleanup, though, and makes the ref
tracking that fsck wants a clearly separate thing.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18 13:51:27 -07:00
Rene Scharfe
9cd625b79b Make release tarballs friendlier to older tar versions
git-tar-tree adds an extended pax header to archives if its first
parameter points to a commit.  It confuses older tars and isn't
very useful in the case of git anyway, so stop doing it.

Idea: Junio, implementation: Junio.  I just wrote it up. :-)

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-18 11:29:36 -07:00
Yakov Lerner
ca3bcabf11 auto-detect changed prefix and/or changed build flags
Detect changed prefix and/or changed build flags in the middle
of the build (or between 'make' and 'make install'), and if change
is detected, make sure all objects are compiled with same build
flags and same prefix, thus avoiding inconsistent/broken build.

[jc: removed otherwise unnecessary Makefile target to test the
 change this patch introduces. ]

Signed-off-by: Yakov Lerner <iler.ml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-17 19:17:34 -07:00
Rene Scharfe
52ba03cbb1 Built-in git-get-tar-commit-id
By being an internal command git-get-commit-id can make use of
struct ustar_header and other stuff and stops wasting precious
disk space.

Note: I recycled one of the two "tar-tree" entries instead of
splitting that cleanup into a separate patch.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-10 11:14:00 -07:00
Junio C Hamano
9dc2164ab3 make clean: remove dist-doc targets.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-07 12:37:46 -07:00
Junio C Hamano
021b6e4549 Make index file locking code reusable to others.
The framework to create lockfiles that are removed at exit is
first used to reliably write the index file, but it is
applicable to other things, so stop calling it "cache_file".

This also rewords a few remaining error message that called the
index file "cache file".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-06 14:30:58 -07:00
Junio C Hamano
dd8239f997 HTTP cleanup
This ifdef's out more functions that are not used while !USE_MULTI
in http code.  Also the dependency of http related objects on http.h
header file was missing in the Makefile.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-06 14:26:57 -07:00
Christian Couder
895f10c3b5 Builtin git-rev-parse.
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-06-03 23:45:30 -07:00
Junio C Hamano
3f69d405d7 Merge branch 'jc/cache-tree'
* jc/cache-tree: (26 commits)
  builtin-rm: squelch compiler warnings.
  git-write-tree writes garbage on sparc64
  Fix crash when reading the empty tree
  fsck-objects: do not segfault on missing tree in cache-tree
  cache-tree: a bit more debugging support.
  read-tree: invalidate cache-tree entry when a new index entry is added.
  Fix test-dump-cache-tree in one-tree disappeared case.
  fsck-objects: mark objects reachable from cache-tree
  cache-tree: replace a sscanf() by two strtol() calls
  cache-tree.c: typefix
  test-dump-cache-tree: validate the cached data as well.
  cache_tree_update: give an option to update cache-tree only.
  read-tree: teach 1-way merege and plain read to prime cache-tree.
  read-tree: teach 1 and 2 way merges about cache-tree.
  update-index: when --unresolve, smudge the relevant cache-tree entries.
  test-dump-cache-tree: report number of subtrees.
  cache-tree: sort the subtree entries.
  Teach fsck-objects about cache-tree.
  index: make the index file format extensible.
  cache-tree: protect against "git prune".
  ...

Conflicts:

	Makefile, builtin.h, git.c: resolved the same way as in next.
2006-05-28 22:57:47 -07:00
Jim Meyering
fc36f6a6c9 Don't write directly to a make target ($@).
Otherwise, if make is suspended, or killed with prejudice, or if the
system crashes, you could be left with an up-to-date, yet corrupt,
generated file.

I left off the `clean' addition, because I believe "make clean" should
not remove wildcard patterns like "*+", on the off-chance that someone
uses names like that for files they care about.  Besides, in practice,
those temporary files are left behind so rarely that they're not a bother,
and they're removed again as part of the next build.

[jc: sign-off?]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-25 22:57:06 -07:00
Martin Waitz
c53603249c Documentation/Makefile: remove extra /
As both DESTDIR and the prefix are supposed to be absolute pathnames
they can simply be concatenated without an extra / (like in the main Makefile).
The extra slash may even break installation on Windows.

[jc: adjusted an earlier workaround for this problem in the dist-doc
 target in the main Makefile as well. ]

Signed-off-by: Martin Waitz <tali@admingilde.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-25 22:48:45 -07:00
Timo Hirvonen
f81daefe56 Builtin git-cat-file
Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-24 13:35:35 -07:00
Junio C Hamano
73f0a1577b Merge branch 'js/fmt-patch'
This makes "git format-patch" a built-in.

* js/fmt-patch:
  git-rebase: use canonical A..B syntax to format-patch
  git-format-patch: now built-in.
  fmt-patch: Support --attach
  fmt-patch: understand old <his> notation
  Teach fmt-patch about --keep-subject
  Teach fmt-patch about --numbered
  fmt-patch: implement -o <dir>
  fmt-patch: output file names to stdout
  Teach fmt-patch to write individual files.
  Use RFC2822 dates from "git fmt-patch".
  git-fmt-patch: thinkofix to show [PATCH] properly.
  rename internal format-patch wip
  Minor tweak on subject line in --pretty=email
  Tentative built-in format-patch.
2006-05-24 12:19:47 -07:00
Junio C Hamano
f2054be4c4 Merge branch 'jc/builtin-n-tar-tree'
This pulls in "make many commands built-in" branches.

* jc/builtin-n-tar-tree:
  built-in tar-tree and remote tar-tree
  Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff-tree.
  Builtin git-show-branch.
  Builtin git-apply.
  Builtin git-commit-tree.
  Builtin git-read-tree.
  Builtin git-tar-tree.
  Builtin git-ls-tree.
  Builtin git-ls-files.
2006-05-24 11:24:50 -07:00
Junio C Hamano
376bb3a352 Merge branch 'lt/dirwalk'
This makes 'git add' and 'git rm' built-ins.

* lt/dirwalk:
  Add builtin "git rm" command
  Move pathspec matching from builtin-add.c into dir.c
  Prevent bogus paths from being added to the index.
  builtin-add: fix unmatched pathspec warnings.
  Remove old "git-add.sh" remnants
  builtin-add: warn on unmatched pathspecs
  Do "git add" as a builtin
  Clean up git-ls-file directory walking library interface
  libify git-ls-files directory traversal
2006-05-24 11:04:16 -07:00
Junio C Hamano
1af0d11283 Merge branch 'jc/tartree' into jc/builtin-n-tar-tree
* jc/tartree:
  built-in tar-tree and remote tar-tree
2006-05-23 14:44:31 -07:00
Peter Eriksen
e8cc9cd98e Builtin git-diff-files, git-diff-index, git-diff-stages, and git-diff-tree.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:13 -07:00
Peter Eriksen
51ce34b992 Builtin git-show-branch.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:13 -07:00
Peter Eriksen
ac6245e31a Builtin git-apply.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:13 -07:00
Peter Eriksen
6d96ac18e5 Builtin git-commit-tree.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:12 -07:00
Peter Eriksen
d147e501f3 Builtin git-read-tree.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:12 -07:00
Peter Eriksen
56d1398ad3 Builtin git-tar-tree.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:12 -07:00
Peter Eriksen
aae01bda7f Builtin git-ls-tree.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:12 -07:00
Peter Eriksen
0864f26421 Builtin git-ls-files.
Signed-off-by: Peter Eriksen <s022018@student.dtu.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-23 13:11:12 -07:00
Sean
7f7e6eacf9 Install git builtins into gitexecdir rather than bindir.
Moving "git-cmd" commands out of the path and into a special
git exec path, should include the builtins.

[jc: fixed the case where bindir == gitexecdir - ln -f fails
 with a complaint that src and dst are the same, likewise for
 the fallback cp.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-22 18:52:19 -07:00
Yakov Lerner
6ba68ab288 NO_INET_NTOP and compat/inet_ntop.c for some systems (e.g. old Cygwin).
For systems which lack inet_ntop(), this adds compat/inet_ntop.c,
and related build constant, NO_INET_NTOP. Older Cygwin(s) lack
inet_ntop().

Signed-off-by: Yakov Lerner <iler.ml@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-21 16:44:36 -07:00
Junio C Hamano
685637381a git-format-patch: now built-in.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-21 02:48:21 -07:00
Junio C Hamano
93872e0700 Merge branch 'lt/dirwalk' into jc/dirwalk-n-cache-tree
This commit is what this branch is all about.  It records the
evil merge needed to adjust built-in git-add and git-rm for
the cache-tree extension.

* lt/dirwalk:
  Add builtin "git rm" command
  Move pathspec matching from builtin-add.c into dir.c
  Prevent bogus paths from being added to the index.
  builtin-add: fix unmatched pathspec warnings.
  Remove old "git-add.sh" remnants
  builtin-add: warn on unmatched pathspecs
  Do "git add" as a builtin
  Clean up git-ls-file directory walking library interface
  libify git-ls-files directory traversal

Conflicts:

	Makefile
	builtin.h
	git.c
	update-index.c
2006-05-20 01:52:19 -07:00
Junio C Hamano
283c8eef6c Merge branch 'jc/cache-tree' into jc/dirwalk-n-cache-tree
* jc/cache-tree: (24 commits)
  Fix crash when reading the empty tree
  fsck-objects: do not segfault on missing tree in cache-tree
  cache-tree: a bit more debugging support.
  read-tree: invalidate cache-tree entry when a new index entry is added.
  Fix test-dump-cache-tree in one-tree disappeared case.
  fsck-objects: mark objects reachable from cache-tree
  cache-tree: replace a sscanf() by two strtol() calls
  cache-tree.c: typefix
  test-dump-cache-tree: validate the cached data as well.
  cache_tree_update: give an option to update cache-tree only.
  read-tree: teach 1-way merege and plain read to prime cache-tree.
  read-tree: teach 1 and 2 way merges about cache-tree.
  update-index: when --unresolve, smudge the relevant cache-tree entries.
  test-dump-cache-tree: report number of subtrees.
  cache-tree: sort the subtree entries.
  Teach fsck-objects about cache-tree.
  index: make the index file format extensible.
  cache-tree: protect against "git prune".
  Add test-dump-cache-tree
  Use cache-tree in update-index.
  ...
2006-05-20 00:56:11 -07:00
Junio C Hamano
217542640e built-in tar-tree and remote tar-tree
This makes tar-tree a built-in.  As an added bonus, you can now
say:

	git tar-tree --remote=remote-repository <ent> [<base>]

This does not work with git-daemon yet, but should work with
localhost and git over ssh transports.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-19 17:48:34 -07:00
Linus Torvalds
d9b814cc97 Add builtin "git rm" command
This changes semantics very subtly, because it adds a new atomicity
guarantee.

In particular, if you "git rm" several files, it will now do all or
nothing. The old shell-script really looped over the removed files one by
one, and would basically randomly fail in the middle if "-f" was used and
one of the files didn't exist in the working directory.

This C builtin one will not re-write the index after each remove, but
instead remove all files at once. However, that means that if "-f" is used
(to also force removal of the file from the working directory), and some
files have already been removed from the workspace, it won't stop in the
middle in some half-way state like the old one did.

So what happens is that if the _first_ file fails to be removed with "-f",
we abort the whole "git rm". But once we've started removing, we don't
leave anything half done. If some of the other files don't exist, we'll
just ignore errors of removal from the working tree.

This is only an issue with "-f", of course.

I think the new behaviour is strictly an improvement, but perhaps more
importantly, it is _different_. As a special case, the semantics are
identical for the single-file case (which is the only one our test-suite
seems to test).

The other question is what to do with leading directories. The old "git
rm" script didn't do anything, which is somewhat inconsistent. This one
will actually clean up directories that have become empty as a result of
removing the last file, but maybe we want to have a flag to decide the
behaviour?

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-19 17:28:33 -07:00
Junio C Hamano
7c4f59d181 Fix build procedure for builtin-init-db
c3c8835fbb182d971d71939b9a3ec7c8b86d6caf broke the default template
location which is in builtin-init-db.o, by not supplying the
compilation-time constant to the right build commands.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-19 17:23:07 -07:00
Junio C Hamano
667661d46e Merge branch 'eb/quilt'
* eb/quilt:
  Implement a --dry-run option to git-quiltimport
  Implement git-quiltimport
2006-05-19 16:57:11 -07:00
Junio C Hamano
3532998f40 Merge branch 'ts/doctar'
* ts/doctar:
  Documentation/Makefile: create tarballs for the man pages and html files
2006-05-19 16:26:01 -07:00
Timo Hirvonen
c3c8835fbb Builtin git-init-db
Basically this just renames init-db.c to builtin-init-db.c and makes
some strings const.

Signed-off-by: Timo Hirvonen <tihirvon@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-19 15:31:20 -07:00
Eric W. Biederman
d3d8f361a8 Implement git-quiltimport
Importing a quilt patch series into git is not very difficult
but parsing the patch descriptions and all of the other
minutia take a bit of effort to get right, so this automates it.

Since git and quilt complement each other it makes sense
to make it easy to go back and forth between the two.

If a patch is encountered that it cannot derive the author
from the user is asked.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18 22:55:57 -07:00
Tilman Sauerbeck
52db0495dc Documentation/Makefile: create tarballs for the man pages and html files
[jc: rewrote by stealing from what I run to update html and
 man branches automatically]

Signed-off-by: Tilman Sauerbeck <tilman@code-monkey.de>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18 20:15:45 -07:00
Lukas Sandström
9370bae2ce Make git-check-format-ref a builtin.
Signed-off-by: Lukas Sandström <lukass@etek.chalmers.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18 15:51:38 -07:00
Linus Torvalds
5fb61b8dcf Make "git rev-list" be a builtin
This was surprisingly easy. The diff is truly minimal: rename "main()" to
"cmd_rev_list()" in rev-list.c, and rename the whole file to reflect its
new built-in status.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-18 15:46:11 -07:00
Linus Torvalds
c699f9b924 Remove old "git-add.sh" remnants
Repeat after me: "It's now a built-in"

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 22:27:42 -07:00
Linus Torvalds
0d78153952 Do "git add" as a builtin
First try. Let's see how well this works.

In many ways, the hard parts of "git commit" are not so different from
this, and a builtin commit would share a lot of the code, I think.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 11:52:40 -07:00
Linus Torvalds
453ec4bdf4 libify git-ls-files directory traversal
This moves the core directory traversal and filename exclusion logic
into the general git library, making it available for other users
directly.

If we ever want to do "git commit" or "git add" as a built-in (and we
do), we want to be able to handle most of git-ls-files as a library.

NOTE! Not all of git-ls-files is libified by this.  The index matching
and pathspec prefix calculation is still in ls-files.c, but this is a
big part of it.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-17 01:56:40 -07:00
Linus Torvalds
63dffdf03d Remove old "git-grep.sh" remnants
It's built-in now.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-16 17:21:21 -07:00
Junio C Hamano
efca578eec Merge branch 'jc/grep'
* jc/grep: (22 commits)
  Fix silly typo in new builtin grep
  builtin-grep: unparse more command line options.
  builtin-grep: use external grep when we can take advantage of it
  builtin-grep: -F (--fixed-strings)
  builtin-grep: -w fix
  builtin-grep: typofix
  builtin-grep: tighten argument parsing.
  builtin-grep: documentation
  Teach -f <file> option to builtin-grep.
  builtin-grep: -L (--files-without-match).
  builtin-grep: binary files -a and -I
  builtin-grep: terminate correctly at EOF
  builtin-grep: tighten path wildcard vs tree traversal.
  builtin-grep: support -w (--word-regexp).
  builtin-grep: support -c (--count).
  builtin-grep: allow more than one patterns.
  builtin-grep: allow -<n> and -[ABC]<n> notation for context lines.
  builtin-grep: printf %.*s length is int, not ptrdiff_t.
  builtin-grep: do not use setup_revisions()
  builtin-grep: support '-l' option.
  ...
2006-05-15 18:12:06 -07:00
Junio C Hamano
d55aaefa3e Merge branch 'fix'
* fix:
  Fix pack-index issue on 64-bit platforms a bit more portably.
  Install git-send-email by default
  Fix compilation on newer NetBSD systems
  git config syntax updates
  Another config file parsing fix.
  checkout: use --aggressive when running a 3-way merge (-m).
2006-05-15 13:48:22 -07:00
Eric Wong
f3dd5eae58 Install git-send-email by default
After 567ffeb7722eefab3991cb894c96548b92b57cc2 and
4bc87a28be020a6bf7387161c65ea3d8e4a0228b, git-send-email no
longer requires any non-standard Perl modules, so there's no
reason to special-case it.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 13:00:28 -07:00
Dennis Stosberg
e88856b485 Fix compilation on newer NetBSD systems
NetBSD >=2.0 has iconv() in libc.  A libiconv is not required and
does not exist.

See: http://netbsd.gw.com/cgi-bin/man-cgi?iconv+3+NetBSD-2.0

[jc: with a bit of simplification later discussed on the list.]

Signed-off-by: Dennis Stosberg <dennis@stosberg.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-15 13:00:01 -07:00
Eric Wong
15739c89fb Install git-send-email by default
After 567ffeb7722eefab3991cb894c96548b92b57cc2 and
4bc87a28be020a6bf7387161c65ea3d8e4a0228b, git-send-email no
longer requires any non-standard Perl modules, so there's no
reason to special-case it.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-14 22:37:00 -07:00
Junio C Hamano
4edd44725c Merge branch 'np/delta'
* np/delta:
  improve diff-delta with sparse and/or repetitive data
  tiny optimization to diff-delta
  replace adler32 with Rabin's polynomial in diff-delta
  use delta index data when finding best delta matches
  split the diff-delta interface
2006-05-09 16:40:28 -07:00
Junio C Hamano
051308f6e9 binary patch.
This adds "binary patch" to the diff output and teaches apply
what to do with them.

On the diff generation side, traditionally, we said "Binary
files differ\n" without giving anything other than the preimage
and postimage object name on the index line.  This was good
enough for applying a patch generated from your own repository
(very useful while rebasing), because the postimage would be
available in such a case.  However, this was not useful when the
recipient of such a patch via e-mail were to apply it, even if
the preimage was available.

This patch allows the diff to generate "binary" patch when
operating under --full-index option.  The binary patch follows
the usual extended git diff headers, and looks like this:

	"GIT binary patch\n"
	<length byte><data>"\n"
	...
	"\n"

Each line is prefixed with a "length-byte", whose value is upper
or lowercase alphabet that encodes number of bytes that the data
on the line decodes to (1..52 -- 'A' means 1, 'B' means 2, ...,
'Z' means 26, 'a' means 27, ...).  <data> is 1 or more groups of
5-byte sequence, each of which encodes up to 4 bytes in base85
encoding.  Because 52 / 4 * 5 = 65 and we have the length byte,
an output line is capped to 66 characters.  The payload is the
same diff-delta as we use in the packfiles.

On the consumption side, git-apply now can decode and apply the
binary patch when --allow-binary-replacement is given, the diff
was generated with --full-index, and the receiving repository
has the preimage blob, which is the same condition as it always
required when accepting an "Binary files differ\n" patch.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-05 15:24:32 -07:00
Junio C Hamano
e388c73825 core.prefersymlinkrefs: use symlinks for .git/HEAD
When inspecting a project whose build infrastructure used to
assume that .git/HEAD is a symlink ref, core.prefersymlinkrefs
in the config file of such a project would help to bisect its
history.

Signed-off-by: Junio C Hamano <junkio@cox.net>
(cherry picked from 9f0bb90d161edf8c43f5261d12bf83f14eb02ff4 commit)
2006-05-05 14:37:08 -07:00
Junio C Hamano
fb335158d5 Makefile: do not link rev-list any specially.
We used to depend on bignum from openssl for rev-list to compute
merge-order, but there is no reason to use different build
recipe from other programs anymore.  Just build it with git-%$X
rule like everybody else.

Noticed by Alexey Dobriyan.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-04 17:38:41 -07:00
Junio C Hamano
5892fc6504 Merge branch 'jc/logs'
* jc/logs:
  builtin-log/whatchanged/show: make them official.
2006-05-04 00:04:32 -07:00
Junio C Hamano
df71b4f7f9 Merge branch 'jc/symref'
* jc/symref:
  core.prefersymlinkrefs: use symlinks for .git/HEAD
2006-05-03 23:54:55 -07:00
Junio C Hamano
230f544e87 Merge branch 'jc/diff'
* jc/diff:
  builtin-diff: call it "git-diff", really.
  builtin-diff.c: die() formatting type fix.
  built-in diff: assorted updates.
  built-in diff.
2006-05-03 23:54:34 -07:00
Junio C Hamano
d820f91871 Merge branch 'jc/count'
* jc/count:
  builtin-count-objects: open packs when running -v
  builtin-count-objects: make it official.
  built-in count-objects.
2006-05-03 23:40:39 -07:00
Junio C Hamano
9f0bb90d16 core.prefersymlinkrefs: use symlinks for .git/HEAD
When inspecting a project whose build infrastructure used to
assume that .git/HEAD is a symlink ref, core.prefersymlinkrefs
in the config file of such a project would help to bisect its
history.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-02 20:09:56 -07:00
Junio C Hamano
54eb2d3ff9 builtin-push: make it official.
Remove the shell script version, and hardlink the git binary to it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-01 23:40:37 -07:00
Junio C Hamano
7b763f7c65 builtin-log/whatchanged/show: make them official.
Remove the shell script version, and hardlink the git binary to
them.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-01 23:15:09 -07:00
Junio C Hamano
8ab99476ec builtin-diff: call it "git-diff", really.
Call it "git diff" not "git diffn", remove the shell script
version, and hardlink the git binary to it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-01 23:07:28 -07:00
Junio C Hamano
468eb79ed4 builtin-count-objects: make it official.
Remove the shell-script version, make the hardlink from the git
binary, and update the documentation to describe a new option.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-01 23:06:06 -07:00
Junio C Hamano
5010cb5fcc built-in "git grep"
This attempts to set up built-in "git grep" to further reduce
our dependence on the shell, while at the same time optionally
allowing to run grep against object database.  You could do
funky things like these:

	git grep --cached -e pattern	;# grep from index
	git grep -e pattern master	;# or in a rev
	git grep -e pattern master next ;# or in multiple revs
	git grep -e pattern pu^@	;# even like this with an
					;# extension from another topic ;-)
	git grep -e pattern master..next ;# or even from rev ranges
	git grep -e pattern master~20:Documentation
					;# or an arbitrary tree
	git grep -e pattern next:git-commit.sh
        				;# or an arbitrary blob

Right now, it does not understand and/or obey many options grep
should accept, and the pattern must be given with -e option due
to the way the parameter parser is structured, both of which
obviously need to be fixed for usability.

But this is going in the right direction.  The shell script
version is one of the worst Portability offender in the git
barebone Porcelainish; it uses xargs -0 to pass paths around and
shell arrays to sift flags and parameters.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-05-01 01:26:46 -07:00
Linus Torvalds
755225de6c git builtin "push"
This adds a builtin "push" command, which is largely just a C'ification of
the "git-push.sh" script.

Now, the reason I did it as a built-in is partly because it's yet another
step on relying less on shell, but it's actually mostly because I've
wanted to be able to push to _multiple_ repositories, and the most obvious
and simplest interface for that would seem be to just have a "remotes"
file that has multiple URL entries.

(For "pull", having multiple entries should either just select the first
one, or you could fall back on the others on failure - your choice).

And quite frankly, it just became too damn messy to do that in shell.
Besides, we actually have a fair amount of infrastructure in C, so it just
wasn't that hard to do.

Of course, this is almost totally untested. It probably doesn't work for
anything but the one trial I threw at it. "Simple" doesn't necessarily
mean "obviously correct".

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-30 00:59:18 -07:00
Junio C Hamano
65056021f2 built-in diff.
This starts to replace the shell script version of "git diff".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-28 23:20:52 -07:00
Nicolas Pitre
3dc5a9e4cd replace adler32 with Rabin's polynomial in diff-delta
This brings another small repacking speedup for sensibly the same pack
size.  On the Linux kernel repo, git-repack -a -f is 3.7% faster for a
0.4% larger pack.

Credits to Geert Bosch who brought the Rabin's polynomial idea to my
attention.

This also eliminate the issue of adler32() reading past the data buffer,
as noticed by Johannes Schindelin.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-28 22:41:31 -07:00
Junio C Hamano
c74320872b built-in count-objects.
Also it learned to do -v (verbose) to report:

	- number of loose objects
	- disk occupied by loose objects
	- number of objects in local packs
	- number of loose objects that are also in pack
	- unrecognised garbage in .git/objects/??/.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-27 21:35:27 -07:00
Junio C Hamano
b8ed7f0f40 Merge branch 'master' into jc/cache-tree
* master:
  commit-tree: allow generic object name for the tree as well.
  Makefile: remove and create xdiff library from scratch.
  t0000-basic: Add ls-tree recursive test back.
  Libified diff-index: backward compatibility fix.
  Libify diff-index.
  Libify diff-files.
  Makefile: remove and create libgit.a from scratch.
  Document the configuration file
  Document git-var -l listing also configuration variables
  rev-parse: better error message for ambiguous arguments
  make update-index --chmod work with multiple files and --stdin
  socksetup: don't return on set_reuse_addr() error
  Fix "git show --stat"
  git-update-index --unresolve
  Add git-unresolve <paths>...
  Add colordiff for git to contrib/colordiff.
  gitk: Let git-rev-list do the argument list parsing
2006-04-26 03:29:09 -07:00
Junio C Hamano
2d86d2c6fc Makefile: remove and create xdiff library from scratch.
... in the same spirit as 71459c193d04870076efa0a387c317390b53e3e2.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-26 03:12:58 -07:00
Junio C Hamano
e9b5b75ca8 Merge branch 'jc/diff'
* jc/diff:
  Libified diff-index: backward compatibility fix.
  Libify diff-index.
  Libify diff-files.
2006-04-25 23:12:21 -07:00
Junio C Hamano
71459c193d Makefile: remove and create libgit.a from scratch.
Foolishly I renamed diff.o around which caused an old diff.o
taken out of libgit.a and got linked into resulting binary and
exhibited mysterious breakage for many people.  This borrows
from the kernel Makefile (scripts/Makefile.build) to first remove
the target and then recreate.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-25 23:11:17 -07:00
Junio C Hamano
17448209f5 Add test-dump-cache-tree
This was useful in diagnosing the corrupt index.aux format
problem.  But do not bother building or installing it by
default.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-24 00:26:31 -07:00
Junio C Hamano
749864627c Add cache-tree.
The cache_tree data structure is to cache tree object names that
would result from the current index file.

The idea is to have an optional file to record each tree object
name that corresponds to a directory path in the cache when we
run write_cache(), and read it back when we run read_cache().
During various index manupulations, we selectively invalidate
the parts so that the next write-tree can bypass regenerating
tree objects for unchanged parts of the directory hierarchy.

We could perhaps make the cache-tree data an optional part of
the index file, but that would involve the index format updates,
so unless we need it for performance reasons, the current plan
is to use a separate file, $GIT_DIR/index.aux to store this
information and link it with the index file with the checksum
that is already used for index file integrity check.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-23 20:18:16 -07:00
Junio C Hamano
6973dcaee7 Libify diff-files.
This is the first installment to libify diff brothers.

The updated diff-files uses revision.c::setup_revisions()
infrastructure to parse its command line arguments, which means
the pathname arguments are checked more strictly than before.
The tests are adjusted to separate possibly missing paths from
the rest of arguments with double-dashes, to show the kosher
way.

As Linus pointed out, renaming diff.c to diff-lib.c was simply
stupid, so I am renaming it back.  The new diff-lib.c is to
contain pieces extracted from diff brothers.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-22 02:37:45 -07:00
Junio C Hamano
08df61713c Makefile: dependency for builtin-help.o
builtin-help.c wants to include common-cmds.h which is a
generated file.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-21 21:56:31 -07:00
Linus Torvalds
70827b15bf Split up builtin commands into separate files from git.c
Right now it split it into "builtin-log.c" for log-related commands
("log", "show" and "whatchanged"), and "builtin-help.c" for the
informational commands (usage printing and "help" and "version").

This just makes things easier to read, I find.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-21 13:14:41 -07:00
Junio C Hamano
ba580aeafb diff: move diff.c to diff-lib.c to make room.
Now I am not doing any real "git-diff in C" yet, but this would
help before doing so.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-19 15:38:14 -07:00
Jonas Fonseca
8f2b72a936 Add git-annotate(1) and git-blame(1)
[jc: with entries in git.txt]

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-18 12:06:55 -07:00
A Large Angry SCM
e6bfaf3e33 Makefile fixups.
Signed-off-by: A Large Angry SCM <gitzilla@gmail.com>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-16 20:42:37 -07:00
Junio C Hamano
8c989ec528 Makefile: $(MAKE) check-docs
This target lists undocumented commands, and/or whose document
is not referenced from the main git documentation.

For now, there are some exceptions I added primarily because I
lack the energy to document them myself:

 - merge backends (we should really document them)
 - ssh-push/ssh-pull (does anybody still use them?)
 - annotate and blame (maybe after one of them eats the other ;-)

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-13 00:21:47 -07:00
Junio C Hamano
b5b1442ac3 Merge branch 'ds/index' into next
* ds/index:
  Replace index() with strchr().
  Solaris 9 also wants our own unsetenv/setenv.
  Retire git-log.sh (take #3)
2006-04-11 11:52:36 -07:00
Dennis Stosberg
40d88d4fa3 Solaris 9 also wants our own unsetenv/setenv.
[jc: the original had "index() is evil" but that should be a
separate patch.]
2006-04-11 11:42:26 -07:00
Junio C Hamano
f94fbbee90 Retire git-log.sh (take #3)
Do not install built-in commands as separate files -- use
hardlinks instead.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-11 11:29:36 -07:00
Junio C Hamano
6b32ee2381 Merge branch 'jc/withraw' into next
* jc/withraw:
  diff-* --patch-with-raw
  Retire git-log.sh (take#2)
  Retire git-log.sh
  Retire diffcore-pathspec.
  Improve the git-diff-tree -c/-cc documentation
2006-04-10 19:44:35 -07:00
Junio C Hamano
944e3a88fe Retire git-log.sh (take#2)
... and install a replacement properly.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-10 19:40:59 -07:00
Junio C Hamano
91730800e9 Retire git-log.sh
Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-10 17:52:17 -07:00
Junio C Hamano
77882f60d9 Retire diffcore-pathspec.
Nobody except diff-stages used it -- the callers instead filtered
the input to diffcore themselves.  Make diff-stages do that as
well and retire diffcore-pathspec.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-10 15:57:24 -07:00
Junio C Hamano
5f1c3f07b7 log-tree: separate major part of diff-tree.
This separates out the part that deals with one-commit diff-tree
(and --stdin form) into a separate log-tree module.

There are two goals with this.  The more important one is to be
able to make this part available to "git log --diff", so that we
can have a native "git whatchanged" command.  Another is to
simplify the commit log generation part simpler.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2006-04-09 01:35:13 -07:00