Commit graph

238 commits

Author SHA1 Message Date
Linus Torvalds 66bf85a462 [PATCH] Add "git-update-ref" to update the HEAD (or other) ref
This is a careful version of the script stuff that currently just
blindly writes HEAD with a new value.

You can use

	git-update-ref HEAD <newhead>

or

	git-update-ref HEAD <newhead> <oldhead>

where the latter version verifies that the old value of HEAD matches
oldhead.

It basically allows a "ref" file to be a symbolic pointer to another ref
file by starting with the four-byte header sequence of "ref:".

More importantly, it allows the update of a ref file to follow these
symbolic pointers, whether they are symlinks or these "regular file
symbolic refs".

NOTE! It follows _real_ symlinks only if they start with "refs/":
otherwise it will just try to read them and update them as a regular file
(ie it will allow the filesystem to follow them, but will overwrite such a
symlink to somewhere else with a regular filename).

In general, using

	git-update-ref HEAD "$head"

should be a _lot_ safer than doing

	echo "$head" > "$GIT_DIR/HEAD"

both from a symlink following standpoint _and_ an error checking
standpoint.  The "refs/" rule for symlinks means that symlinks that point
to "outside" the tree are safe: they'll be followed for reading but not
for writing (so we'll never write through a ref symlink to some other
tree, if you have copied a whole archive by creating a symlink tree).

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-25 16:18:25 -07:00
Junio C Hamano a55797672d Clean generated files a bit more.
Now we conditionally compile things in compat/, so we should remove
object files there.  Python execution can leave *.pyc and *.pyo, which
need to be cleaned as well.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-24 23:48:29 -07:00
Junio C Hamano cf408cb4a0 Stop installing the backward compatible symlinks.
Also cmd-renames.sh can now be used to remove the backward compatible
symlinks -- this is not used by default in any way.

As discussed on the list with Pasky, git-ssh-push and git-ssh-pull will
keep calling each other for a while longer.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-24 23:42:34 -07:00
Junio C Hamano d66189e2c9 Use 0.99.7.GIT as version between 0.99.7 and 0.99.8
Pasky taught me how he does his versioning for ELinks.  This will sort
after 0.99.7 and interim fixes 0.99.7a, and before 0.99.8.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-24 14:58:57 -07:00
Junio C Hamano 229a7ed7ab Solaris: give a bit more built-in defaults.
Taking the make command line Peter Eriksen uses, give defaults
to SHELL_PATH, TAR, CURLDIR, NO_STRCASESTR, and INSTALL.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-24 11:26:22 -07:00
Patrick Mauritz 6d9bbc50a3 [PATCH] CURLDIR in Makefile
Support systems that do not install curl headers and libraries
in /usr/{include,lib}.

Signed-off-by: Patrick Mauritz <oxygene@studentenbude.ath.cx>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-24 11:26:22 -07:00
Junio C Hamano c8b48ba476 Prettyprint octopus merge message.
Including the current branch in the list of heads being merged
was not a good idea, so drop it.  And shorten the message by
grouping branches and tags together to form a single line.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-22 18:09:07 -07:00
Junio C Hamano 5cfcd07c93 Retire diff-helper.
The textual diff generation with built-in '-p' in diff-* brothers has
proven to be useful enough that git-diff-helper outlived its usefulness.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-22 01:54:13 -07:00
Junio C Hamano 9dcc829fe1 Retire rev-tree.
Some old scripts might still use git-rev-tree, but it really is
clearly inferior in every way to git-rev-list that such scripts should
be fixed anyway. Fixing them should be pretty easy.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-22 01:54:12 -07:00
Junio C Hamano 0fe51391a8 Retire git-export.
git-export was done as a concept example on how easy it is to export
the git data to something else. It's much less powerful than any
number of trivial one-liner scripts now, and real exporters would not
ever use git-export.

It's obviously much less powerful than "git-whatchanged", or just
about any combination of git-rev-list + git-diff-tree.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-22 01:54:12 -07:00
Nicolas Pitre 7c6ef2f214 [PATCH] ARM optimized SHA1 implementation
This is my ARM assembly SHA1 implementation for GIT. It is approximately
50% faster than the generic C version. On an XScale processor running at
400MHz:

	generic C version:	9.8 MB/s
	my version:		14.5 MB/s

It's not that I expect a lot of big GIT users on ARM, but I stillknow
about one important ARM user that might benefit from it, and writing
that code was fun.

I also reworked the makefile a bit so any optimized SHA1 implementations
is used regardless of whether NO_OPENSSL is defined or not.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-20 18:10:00 -07:00
Junio C Hamano 343d35c916 Ship our own copy of subprocess.py
so people without the latest Python could run merge-recursive.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-19 19:47:54 -07:00
Linus Torvalds ef34af24dc [PATCH] strcasestr compatibility replacement
Some C libraries lack strcasestr(); add a stupid replacement
to help folks with such.

[jc: original Linus posting, updated with his "also need <ctype.h>",
 updated further with a fix from Joachim B Haga <cjhaga@fys.uio.no>"]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-19 08:49:39 -07:00
Junio C Hamano 8ac93bc98f Merge branch 'master' of . 2005-09-18 01:18:15 -07:00
Junio C Hamano 5a90d4ac1a [PATCH] getdomainname should be usable on SunOS with -lnsl
Jason Riedy suggests that we should be able to use getdomainname
if we properly specify which libraries to link.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-17 11:57:50 -07:00
Junio C Hamano f71a69ab05 Be more backward compatible with git-ssh-{push,pull}.
HPA reminded me that these programs knows about the name of the
counterpart on the other end and simply symlinking the old name to
new name locally would not be enough.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-15 14:56:37 -07:00
Junio C Hamano 0f56479d73 Retire info/rev-cache
It was one of those things that were well intentioned but did not turn
out to be useful in practice.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-15 12:46:31 -07:00
Peter Eriksen 53764ee43d [PATCH] Use '-d' as the first flag to 'install'
... in order to please Solaris 'install'.  GNU install is not harmed
with this.

[jc: Documentation/Makefile also fixed.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-15 12:46:31 -07:00
Junio C Hamano 4803c2802c Merge branch 'master' of . 2005-09-13 22:30:13 -07:00
Fredrik Kuivinen e4cf17ce0d [PATCH] Rename the 'fredrik' merge strategy to 'recursive'.
Otherwise we would regret when Fredrik comes up with another merge
algorithm with different pros-and-cons with the current one.

Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-13 00:20:54 -07:00
Junio C Hamano 3db6b224cf Merge branch 'master' of . 2005-09-12 22:02:42 -07:00
Linus Torvalds f22cc3fcbf [PATCH] Add "git grep" helper
Very convenient shorthand for

	git-ls-files [file-patterns] | xargs grep <pattern>

which I tend to do all the time.

Yes, it's trivial, but it's really nice. I can do

	git grep '\<some_variable\>' arch/i386 include/asm-i386

and it does exactly what you'd think it does. And since it just uses the
normal git-ls-files file patterns, you can do things like

	git grep something 'include/*.h'

and it will search all header files under the include/ subdirectory.

Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-12 13:20:03 -07:00
Junio C Hamano 53e2cc9b9b Prepare 0.99.7 release candidate branch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 19:48:09 -07:00
Junio C Hamano 720d150c48 Add a new merge strategy by Fredrik Kuivinen.
I really wanted to try this out, instead of asking for an adjustment
to the 'git merge' driver and waiting.  For now the new strategy is
called 'fredrik' and not in the list of default strategies to be tried.

The script wants Python 2.4 so this commit also adjusts Debian and RPM
build procecure files.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 19:46:53 -07:00
Junio C Hamano 2276aa6c09 Use Daniel's read-tree in the merge strategy 'resolve'.
And rename the one Linus kept calling stupid, 'stupid'.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:30:41 -07:00
Junio C Hamano 91063bbc6c Multi-backend merge driver.
The new command 'git merge' takes the current head and one or more
remote heads, with the commit log message for the automated case.

If the heads being merged are simple fast-forwards, it acts the
same way as the current 'git resolve'.  Otherwise, it tries
different merge strategies and takes the result from the one that
succeeded auto-merging, if there is any.

If no merge strategy succeeds auto-merging, their results are
evaluated for number of paths needed for hand resolving, and the
one with the least number of such paths is left in the working
tree.  The user is asked to resolve them by hand and make a
commit manually.

The calling convention from the 'git merge' driver to merge
strategy programs is very simple:

 - A strategy program is to be called 'git-merge-<strategy>'.

 - They take input of this form:

	<common1> <common2> ... '--' <head> <remote1> <remote2>...

   That is, one or more the common ancestors, double dash, the
   current head, and one or more remote heads being merged into
   the current branch.

 - Before a strategy program is called, the working tree is
   matched to the current <head>.

 - The strategy program exits with status code 0 when it
   successfully auto-merges the given heads.  It should do
   update-cache for all the merged paths when it does so -- the
   index file will be used to record the merge result as a
   commit by the driver.

 - The strategy program exits with status code 1 when it leaves
   conflicts behind.  It should do update-cache for all the
   merged paths that it successfully auto-merged, and leave the
   cache entry in the index file as the same as <head> for paths
   it could not auto-merge, and leave its best-effort result
   with conflict markers in the working tree when it does so.

 - The strategy program exists with status code other than 0 or
   1 if it does not handle the given merge at all.

As examples, this commit comes with merge strategies based on
'git resolve' and 'git octopus'.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-10 18:30:41 -07:00
Junio C Hamano a9ab586a5d Retire support for old environment variables.
We have deprecated the old environment variable names for quite a
while and now it's time to remove them.  Gone are:

    SHA1_FILE_DIRECTORIES AUTHOR_DATE AUTHOR_EMAIL AUTHOR_NAME
    COMMIT_AUTHOR_EMAIL COMMIT_AUTHOR_NAME SHA1_FILE_DIRECTORY

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-09 14:48:54 -07:00
Marco Roeland 03d98d395a [PATCH] remove duplicate git-send-email-script.perl target in Makefile
Remove duplicate git-send-email-perl target in Makefile.

When WITH_SEND_EMAIL was defined, as in the Debian 'deb' target,
git-send-email-perl was added twice to SCRIPT_PERL, leading to a
duplicate definition in the Makefile. Creating a ".deb" then failed.

Signed-off-by: Marco Roeland <marco.roeland@xs4all.nl>
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-09 11:20:54 -07:00
Junio C Hamano bc6146d2ab 'build' scripts before installing.
Earlier we renamed git-foo.sh to git-foo while installing, which
was mostly done by inertia than anything else.  This however
made writing tests to use scripts harder.

This patch builds the scripts the same way as we build binaries
from their sources.  As a side effect, you can now specify
non-standard paths you have your Perl binary is in when running
the make.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-08 18:50:33 -07:00
Junio C Hamano 6a2e50f9df git --version tells which version of git you have.
Originally from Martin Atukunda <matlads@dsmagic.com> but adjusted for
post-rename code.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-07 22:08:30 -07:00
Patrick Mauritz f0ebff0dfe [PATCH] Portability fix for Solaris 10/x86
* getdomainname unavailable there.
 * needs -lsocket for linkage.
 * needs __EXTENSIONS__ at the beginning of convert-objects.c

[JC: I've done this slightly differently from what Patrick originally
sent to the list and dropped the bit that deals with installations
that has curl header and library at non-default location.  I am
resisting the slipperly slope called autoconf.]

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-07 22:08:28 -07:00
Junio C Hamano 215a7ad1ef Big tool rename.
As promised, this is the "big tool rename" patch.  The primary differences
since 0.99.6 are:

  (1) git-*-script are no more.  The commands installed do not
      have any such suffix so users do not have to remember if
      something is implemented as a shell script or not.

  (2) Many command names with 'cache' in them are renamed with
      'index' if that is what they mean.

There are backward compatibility symblic links so that you and
Porcelains can keep using the old names, but the backward
compatibility support  is expected to be removed in the near
future.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-07 17:45:20 -07:00
Junio C Hamano 99977bd5fd GIT 0.99.6 2005-09-07 15:59:24 -07:00
Junio C Hamano 597c9cc540 Flatten tools/ directory to make build procedure simpler.
Also make platform specific part more isolated.  Currently we only
have Darwin defined, but I've taken a look at SunOS specific patch
(which I dropped on the floor for now) as well.  Doing things this way
would make adding it easier.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-07 12:22:56 -07:00
Junio C Hamano 712d865523 Merge branch 'master' of . 2005-09-05 01:42:11 -07:00
Junio C Hamano 0516de30e8 Retire git-clone-dumb-http.
... and fold it into git-clone-script.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-05 00:47:39 -07:00
Junio C Hamano 8de8a292eb Install archimport-script.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-09-04 23:32:56 -07:00
Junio C Hamano 7a03433742 Merge refs/heads/master from . 2005-08-29 19:09:48 -07:00
Junio C Hamano e47e35acdd Remove git-apply-patch-script.
Now the rebase is rewritten to use git cherry-pick, there is no user
for that ancient script.  I've checked Cogito and StGIT to make sure
they do not use it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-29 12:52:03 -07:00
Junio C Hamano 48313592bf Redo "revert" using three-way merge machinery.
The reverse patch application using "git apply" sometimes is too
rigid.  Since the user would get used to resolving conflicting merges
by hand during the normal merge experience, using the same machinery
would be more helpful rather than just giving up.

Cherry-picking and reverting are essentially the same operation.
You pick one commit, and apply the difference that commit introduces
to its own commit ancestry chain to the current tree.  Revert applies
the diff in reverse while cherry-pick applies it forward.  They share
the same logic, just different messages and merge direction.

Rewrite "git rebase" using "git cherry-pick".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-29 12:52:02 -07:00
Junio C Hamano 0f58317531 Merge master branch changes into release candidate branch.
Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-26 22:47:27 -07:00
Junio C Hamano 90bc118fc5 Enable git-send-email-script on Debian.
You can define WITH_SEND_EMAIL to include the send-email command as
part of the installation.  Since Debian, unlike RPM/Fedora, has the
two necessary Perl modules available as part of the mainline
distribution, there is no reason for us to shy away from shipping
send-email.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-26 21:46:32 -07:00
Junio C Hamano 09661fdbfc Prepare 0.99.6 branch. 2005-08-24 23:10:41 -07:00
Junio C Hamano 434d6ba031 Merge refs/heads/master from . 2005-08-24 16:56:48 -07:00
Junio C Hamano d9f3be7e2e [PATCH] Infamous 'octopus merge'
This script uses the list of heads and their origin multi-head "git
fetch" left in the $GIT_DIR/FETCH_HEAD file, and makes an octopus
merge on top of the current HEAD using them.

The implementation tries to be strict for the sake of safety.  It
insists that your working tree is clean (no local changes) and matches
the HEAD, and when any of the merged heads does not automerge, the
whole process is aborted and tries to rewind your working tree is to
the original state.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-24 16:50:51 -07:00
Junio C Hamano e0bfc81e05 [PATCH] Retire git-parse-remote.
Update git-pull to match updated git-fetch and allow pull to
fetch from multiple remote references.  There is no support for
resolving more than two heads, which will be done with "git
octopus".

Update "git ls-remote" to use git-parse-remote-script.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-24 16:50:50 -07:00
Junio C Hamano ac4b0cff00 [PATCH] Start adding the $GIT_DIR/remotes/ support.
All the necessary parsing code is in git-parse-remote-script;
update git-push-script to use it.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-24 16:50:49 -07:00
Junio C Hamano 89305da8a2 Merge refs/heads/master from . 2005-08-23 00:07:17 -07:00
Junio C Hamano f5e375c9a9 Clean-up output from "git show-branch" and document it.
When showing only one branch a lot of default output becomes redundant,
so clean it up a bit, and document what is shown.  Retire the earlier
implementation "git-show-branches-script".

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-22 23:18:17 -07:00
Junio C Hamano f76412ed6d [PATCH] Add 'git show-branch'.
The 'git show-branches' command turns out to be reasonably useful,
but painfully slow.  So rewrite it in C, using ideas from merge-base
while enhancing it a bit more.

 - Unlike show-branches, it can take --heads (show me all my
   heads), --tags (show me all my tags), or --all (both).

 - It can take --more=<number> to show beyond the merge-base.

 - It shows the short name for each commit in the extended SHA1
   syntax.

 - It can find merge-base for more than two heads.

Examples:

    $ git show-branch --more=6 HEAD

    is almost the same as "git log --pretty=oneline --max-count=6".

    $ git show-branch --merge-base master mhf misc

    finds the merge base of the three given heads.

    $ git show-branch master mhf misc

    shows logs from the top of these three branch heads, up to their
    common ancestor commit is shown.

    $ git show-branch --all --more=10

    is poor-man's gitk, showing all the tags and heads, and
    going back 10 commits beyond the merge base of those refs.

Signed-off-by: Junio C Hamano <junkio@cox.net>
2005-08-22 18:34:10 -07:00