git.git
17 years agoMerge branch 'maint'
Shawn O. Pearce [Tue, 10 Jul 2007 01:28:27 +0000 (21:28 -0400)]
Merge branch 'maint'

* maint:
  Clarify documentation of fast-import's D subcommand

17 years agoClarify documentation of fast-import's D subcommand
Shawn O. Pearce [Tue, 10 Jul 2007 01:27:55 +0000 (21:27 -0400)]
Clarify documentation of fast-import's D subcommand

The 'D' subcommand within a commit can also delete a directory
recursively.  This wasn't clear in the prior version of the
documentation, leading to a question on the mailing list.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
17 years agoRevert 88494423 (removal of duplicate parents in the output codepath)
Junio C Hamano [Mon, 9 Jul 2007 02:05:31 +0000 (19:05 -0700)]
Revert 88494423 (removal of duplicate parents in the output codepath)

Now this is not needed, as we rewrite the parent list in the commit
object itself.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorevision.c: remove duplicated parents after history simplification
Junio C Hamano [Mon, 9 Jul 2007 02:03:19 +0000 (19:03 -0700)]
revision.c: remove duplicated parents after history simplification

When we simplify history due to path limits, the parents list
for a rewritten commit can end up having duplicates.  Instead of
filtering them out in the output codepath like earlier commit
88494423 did, remove them much earlier, when the parent
information actually gets rewritten.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocument custom hunk header selection
Junio C Hamano [Mon, 9 Jul 2007 00:15:09 +0000 (17:15 -0700)]
Document custom hunk header selection

Since the external interface seems to have stabilized for this
new feature, let's document it properly.

Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Mon, 9 Jul 2007 01:28:31 +0000 (18:28 -0700)]
Merge branch 'maint'

* maint:
  user-manual: fix directory name in git-archive example
  user-manual: more explanation of push and pull usage
  tutorial: Fix typo
  user-manual: grammar and style fixes

17 years agorebase -i: put a nice warning into the todo list
Johannes Schindelin [Sun, 8 Jul 2007 20:32:22 +0000 (21:32 +0100)]
rebase -i: put a nice warning into the todo list

It seems that not everybody expects a difference between keeping a "pick"
line, and deleting it.  So be a bit more explicit about that, with all
capitals to get the attention.

Noticed by vmiklos on IRC.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: remember the settings of -v, -s and -p when interrupted
Johannes Schindelin [Sun, 8 Jul 2007 02:02:47 +0000 (03:02 +0100)]
rebase -i: remember the settings of -v, -s and -p when interrupted

After interruption, be that an edit, or a conflicting commit, reset
the variables VERBOSE, STRATEGY and PRESERVE_MERGES, so that the
user does not have to respecify them with "rebase --continue".

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: actually show the diffstat when being verbose
Johannes Schindelin [Sun, 8 Jul 2007 02:02:13 +0000 (03:02 +0100)]
rebase -i: actually show the diffstat when being verbose

The "while" loop in the function do_rest is not supposed to ever be
exited.  Instead, the function do_one checks if there is nothing left,
and cleans up and exits if that is the case.  So the diffstat code
belongs there.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agorebase -i: handle --continue more like non-interactive rebase
Johannes Schindelin [Sun, 8 Jul 2007 02:01:29 +0000 (03:01 +0100)]
rebase -i: handle --continue more like non-interactive rebase

Non-interactive rebase requires the working tree to be clean, but
applies what is in the index without requiring the user to do it
herself.  Imitate that, but (since we are interactive, after all)
fire up an editor with the commit message.

It also fixes a subtle bug: a forgotten "continue" was removed, which
led to an infinite loop when continuing without remaining patches.

Both issues noticed by Frank Lichtenheld.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agot7004: Skip tests for signed tags in an old version of gpg.
Carlos Rica [Sun, 8 Jul 2007 19:36:34 +0000 (21:36 +0200)]
t7004: Skip tests for signed tags in an old version of gpg.

As said here: http://www.gnupg.org/documentation/faqs.html#q6.19
the gpg version 1.0.6 didn't parse trust packets correctly, so for
that version, creation of signed tags using the generated key fails.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Acked-by: Sven Verdoolaege <skimo@kotnet.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix merge-one-file for our-side-added/our-side-removed cases
Junio C Hamano [Sun, 8 Jul 2007 21:42:05 +0000 (14:42 -0700)]
Fix merge-one-file for our-side-added/our-side-removed cases

When commit ed93b449 changed the script so that it does not
touch untracked working tree file, we forgot that we still
needed to resolve the index entry (otherwise they are left
unmerged).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-commit: don't add multiple Signed-off-by: from the same identity
Gerrit Pape [Fri, 6 Jul 2007 14:42:27 +0000 (14:42 +0000)]
git-commit: don't add multiple Signed-off-by: from the same identity

If requested to signoff a commit, don't add another Signed-off-by: line
to the commit message if the exact same line is already there.

This was noticed and requested by Josh Triplett through
 http://bugs.debian.org/430851

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agobranch.autosetupmerge: allow boolean values, or "all"
Johannes Schindelin [Sun, 8 Jul 2007 12:41:21 +0000 (13:41 +0100)]
branch.autosetupmerge: allow boolean values, or "all"

Junio noticed that switching on autosetupmerge unilaterally started
cluttering the config for local branches.  That is not the original
intention of branch.autosetupmerge, which was meant purely for
convenience when branching off of remote branches, but that semantics
got lost somewhere.

If you still want that "new" behavior, you can switch
branch.autosetupmerge to the value "all".  Otherwise, it is interpreted
as a boolean, which triggers setting up defaults _only_ when branching
off of a remote branch, i.e. the originally intended behavior.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-stash: try reusing cached stat info as much as possible
Junio C Hamano [Sun, 8 Jul 2007 08:28:18 +0000 (01:28 -0700)]
git-stash: try reusing cached stat info as much as possible

Earlier when we read a tree into a temporary index, we read it
from scratch.  Start from the current index and use read-tree -m
to preserve cached stat information as much as possible, in
order to speed up "git add -u".  This makes "git stash" usable
in a source tree of nontrivial size.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agouser-manual: fix directory name in git-archive example
William Pursell [Fri, 29 Jun 2007 13:08:29 +0000 (14:08 +0100)]
user-manual: fix directory name in git-archive example

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agouser-manual: more explanation of push and pull usage
J. Bruce Fields [Mon, 18 Jun 2007 20:38:22 +0000 (16:38 -0400)]
user-manual: more explanation of push and pull usage

Recently a user on the mailing list complained that they'd read the
manual but couldn't figure out how to keep a couple private repositories
in sync.  They'd tried using push, and were surprised by the effect.

Add a little text in an attempt to make it clear that:
- Pushing to a branch that is checked out will have odd results.
- It's OK to synchronize just using pull if that's simpler.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agotutorial: Fix typo
J. Bruce Fields [Fri, 22 Jun 2007 03:17:40 +0000 (23:17 -0400)]
tutorial: Fix typo

"You" should be "Alice" here.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agouser-manual: grammar and style fixes
Andy Parkins [Tue, 12 Jun 2007 15:43:19 +0000 (16:43 +0100)]
user-manual: grammar and style fixes

 - "method of" is vulgar, "method for" is nicer
 - "recovery" becomes "recovering" from Steve Hoelzer's original version
   of this patch
 - "if you want" is nicer as "if you wish"
 - "you may" should be "you can"; "you may" is "you have permission to"
   rather than "you can"'s "it is possible to"

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
17 years agodiff.c: make built-in hunk header pattern a separate table
Junio C Hamano [Sun, 8 Jul 2007 07:25:59 +0000 (00:25 -0700)]
diff.c: make built-in hunk header pattern a separate table

This would hopefully make it easier to maintain.  Initially we
would have "java" and "tex" defined, as they are the only ones
we already have.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: make "No commits" in project list gray, not bold green
Matt McCutchen [Thu, 28 Jun 2007 22:15:22 +0000 (18:15 -0400)]
gitweb: make "No commits" in project list gray, not bold green

A missing return statement in git_get_last_activity made gitweb think
a project with no commits was in age class "age0", so the "No commits"
appeared in bold green, which was ridiculous.  I added the return so
those projects get "noage" and added a block to gitweb.css to format
the "No commits" text gray.

Signed-off-by: Matt McCutchen <hashproduct@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: make search form generate pathinfo-style URLs
Matt McCutchen [Thu, 28 Jun 2007 18:57:07 +0000 (14:57 -0400)]
gitweb: make search form generate pathinfo-style URLs

The search form generated traditional-style URLs with a "p=" parameter
even when the pathinfo feature was on.  This patch makes it generate
pathinfo-style URLs when appropriate.

Signed-off-by: Matt McCutchen <hashproduct@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: prefer git_get_project_owner() over get_file_owner()
Miklos Vajna [Tue, 3 Jul 2007 22:11:23 +0000 (00:11 +0200)]
gitweb: prefer git_get_project_owner() over get_file_owner()

This way if $projects_list exists, it'll be used, otherwise get_file_owner()
will be used as before.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Acked-by: Luben Tuikov <ltuikov@yahoo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogitweb: make repeated calls to git_get_project_owner() bearable
Junio C Hamano [Wed, 4 Jul 2007 05:10:42 +0000 (22:10 -0700)]
gitweb: make repeated calls to git_get_project_owner() bearable

If repeated calls to git_get_project_owner() are made, we would have read the
same file over and over again.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'js/stash'
Junio C Hamano [Sat, 7 Jul 2007 20:38:06 +0000 (13:38 -0700)]
Merge branch 'js/stash'

* js/stash:
  Teach git-stash to "apply --index"

17 years agoMerge branch 'jc/diff-mark'
Junio C Hamano [Sat, 7 Jul 2007 20:37:32 +0000 (13:37 -0700)]
Merge branch 'jc/diff-mark'

* jc/diff-mark:
  diff: honor binariness specified in attributes
  Fix configuration syntax to specify customized hunk header patterns.
  Per-path attribute based hunk header selection.
  Future-proof source for changes in xdemitconf_t
  Introduce diff_filespec_is_binary()

17 years agoMerge branch 'maint'
Junio C Hamano [Sat, 7 Jul 2007 19:29:09 +0000 (12:29 -0700)]
Merge branch 'maint'

* maint:
  Fix "apply --reverse" with regard to whitespace

17 years agodiff: honor binariness specified in attributes
Junio C Hamano [Sat, 7 Jul 2007 19:25:11 +0000 (12:25 -0700)]
diff: honor binariness specified in attributes

The code shuffling mistakenly lost binariness specified with the
attribute mecahnism and made it always guess from the data.

Noticed by Johannes, with two test cases to t4020.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix "apply --reverse" with regard to whitespace
Johannes Schindelin [Sat, 7 Jul 2007 17:50:39 +0000 (18:50 +0100)]
Fix "apply --reverse" with regard to whitespace

"git apply" used to take check the whitespace in the wrong
direction.

Noticed by Daniel Barkalow.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agodiff-lib.c: don't strdup twice
René Scharfe [Sat, 7 Jul 2007 18:19:08 +0000 (20:19 +0200)]
diff-lib.c: don't strdup twice

The static function read_directory in diff-lib.c is only ever called
with struct path_list lists with .strdup_paths turned on, i.e.
path_list_insert will strdup the paths for us (again).  Let's take
advantage of that and stop doing it twice.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix configuration syntax to specify customized hunk header patterns.
Junio C Hamano [Sat, 7 Jul 2007 08:49:58 +0000 (01:49 -0700)]
Fix configuration syntax to specify customized hunk header patterns.

This updates the hunk header customization syntax.  The special
case 'funcname' attribute is gone.

You assign the name of the type of contents to path's "diff"
attribute as a string value in .gitattributes like this:

*.java diff=java
*.perl diff=perl
*.doc diff=doc

If you supply "diff.<name>.funcname" variable via the
configuration mechanism (e.g. in $HOME/.gitconfig), the value is
used as the regexp set to find the line to use for the hunk
header (the variable is called "funcname" because such a line
typically is the one that has the name of the function in
programming language source text).

If there is no such configuration, built-in default is used, if
any.  Currently there are two default patterns: default and java.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-branch: default to --track
Johannes Schindelin [Fri, 6 Jul 2007 21:54:09 +0000 (22:54 +0100)]
git-branch: default to --track

"git branch --track" will setup config variables when branching from
a remote branch, so that if you say "git pull" while being on that
branch, it automatically fetches the correct remote, and merges the
correct branch.

Often people complain that this is not the default for "git branch".
Make it so.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-send-email: allow an email alias for --from
Michael Hendricks [Thu, 5 Jul 2007 01:11:36 +0000 (19:11 -0600)]
git-send-email: allow an email alias for --from

Signed-off-by: Michael Hendricks <michael@ndrix.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agocvsserver: always initialize state in argsplit()
Frank Lichtenheld [Sun, 17 Jun 2007 08:31:02 +0000 (10:31 +0200)]
cvsserver: always initialize state in argsplit()

Other code assumes that this is initialized, so do it
even if there were no arguments given.

Signed-off-by: Dirk Koopman <djk@tobit.co.uk>
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agostash: allow running from a subdirectory
James Bowes [Fri, 6 Jul 2007 19:57:47 +0000 (15:57 -0400)]
stash: allow running from a subdirectory

Signed-off-by: James Bowes <jbowes@dangerouslyinc.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-submodule(1): update description and key names
Lars Hjemli [Fri, 6 Jul 2007 17:38:38 +0000 (19:38 +0200)]
git-submodule(1): update description and key names

When git-submodule was updated to allow mapping between submodule name and
submodule path, the documentation was left untouched.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoEnable "git rerere" by the config variable rerere.enabled
Johannes Schindelin [Fri, 6 Jul 2007 12:05:59 +0000 (13:05 +0100)]
Enable "git rerere" by the config variable rerere.enabled

Earlier, "git rerere" was enabled by creating the directory
.git/rr-cache.  That is definitely not in line with most other
features, which are enabled by a config variable.

So, check the config variable "rerere.enabled". If it is set
to "false" explicitely, do not activate rerere, even if
.git/rr-cache exists. This should help when you want to disable
rerere temporarily.

If "rerere.enabled" is not set at all, fall back to detection
of the directory .git/rr-cache.

[jc: with minimum tweaks]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd [verse] to the SYNOPSIS section of git-submodule.txt.
Matt Kraai [Sat, 7 Jul 2007 00:56:31 +0000 (17:56 -0700)]
Add [verse] to the SYNOPSIS section of git-submodule.txt.

The SYNOPSIS section of git-submodule.txt contains two forms.  Since
it doesn't use the verse style, the line boundary between them is not
preserved and the second form can appear on the same line as the first
form.  Adding [verse] enables the verse style, which preserves the
line boundary between them.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoChange "added.moved or removed" to "added, moved or removed" in
Matt Kraai [Sat, 7 Jul 2007 01:23:54 +0000 (18:23 -0700)]
Change "added.moved or removed" to "added, moved or removed" in

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFixed a formulation mistake in Documentation/user-manual.txt
Marcus Fritzsch [Fri, 6 Jul 2007 07:02:20 +0000 (09:02 +0200)]
Fixed a formulation mistake in Documentation/user-manual.txt

This one fixes a small formulation weirdness in
Documentation/user-manual.txt

Signed-off-by: Marcus Fritzsch <m@fritschy.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoTeach git-stash to "apply --index"
Johannes Schindelin [Mon, 2 Jul 2007 11:14:49 +0000 (12:14 +0100)]
Teach git-stash to "apply --index"

When given this subcommand, git-stash will try to merge the stashed
index into the current one. Only trivial merges are possible, since
we have no index for the index ;-) If a trivial merge is not possible,
git-stash will bail out with a hint to skip the --index option.

For good measure, finally include a test case.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoPer-path attribute based hunk header selection.
Junio C Hamano [Fri, 6 Jul 2007 07:45:10 +0000 (00:45 -0700)]
Per-path attribute based hunk header selection.

This makes"diff -p" hunk headers customizable via gitattributes mechanism.
It is based on Johannes's earlier patch that allowed to define a single
regexp to be used for everything.

The mechanism to arrive at the regexp that is used to define hunk header
is the same as other use of gitattributes.  You assign an attribute, funcname
(because "diff -p" typically uses the name of the function the patch is about
as the hunk header), a simple string value.  This can be one of the names of
built-in pattern (currently, "java" is defined) or a custom pattern name, to
be looked up from the configuration file.

  (in .gitattributes)
  *.java   funcname=java
  *.perl   funcname=perl

  (in .git/config)
  [funcname]
    java = ... # ugly and complicated regexp to override the built-in one.
    perl = ... # another ugly and complicated regexp to define a new one.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFuture-proof source for changes in xdemitconf_t
Johannes Schindelin [Wed, 4 Jul 2007 18:05:46 +0000 (19:05 +0100)]
Future-proof source for changes in xdemitconf_t

The instances of xdemitconf_t were initialized member by member.
Instead, initialize them to all zero, so we do not have
to update those places each time we introduce a new member.

[jc: minimally fixed by getting rid of a new global]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoIntroduce diff_filespec_is_binary()
Junio C Hamano [Fri, 6 Jul 2007 07:18:54 +0000 (00:18 -0700)]
Introduce diff_filespec_is_binary()

This replaces an explicit initialization of filespec->is_binary
field used for rename/break followed by direct access to that
field with a wrapper function that lazily iniaitlizes and
accesses the field.  We would add more attribute accesses for
the use of diff routines, and it would be better to make this
abstraction earlier.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoPrefer EMAIL to username@hostname.
Matt Kraai [Fri, 6 Jul 2007 00:29:41 +0000 (17:29 -0700)]
Prefer EMAIL to username@hostname.

The environment variable $EMAIL gives a better default of user's
preferred e-mail address than the hardcoded "username@hostname",
as it is understood by many existing programs.

We still honor GIT_*_EMAIL environment variables and user.email
configuration variable give them higher precedence, so that the
user can override $EMAIL or "username@hostname", as they are
likely to be more specific to the context of working on a
particular project.

Signed-off-by: Matt Kraai <kraai@ftbfs.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agomake git-clone GIT_WORK_TREE aware
Matthias Lederhofer [Thu, 5 Jul 2007 23:10:44 +0000 (01:10 +0200)]
make git-clone GIT_WORK_TREE aware

If GIT_WORK_TREE is set git-clone will use that path for the
working tree.

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-clone: split up long &&-command-chain and use a function for cleanup
Matthias Lederhofer [Thu, 5 Jul 2007 22:54:33 +0000 (00:54 +0200)]
git-clone: split up long &&-command-chain and use a function for cleanup

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofix remote.origin.url in tutorial.txt
Alecs King [Thu, 5 Jul 2007 16:21:16 +0000 (00:21 +0800)]
fix remote.origin.url in tutorial.txt

Bob cloned from Alice.
The origin url is actually Alice's repo.

Signed-off-by: Alecs King <alecsk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofilter-branch: fail gracefully when a filter fails
Johannes Schindelin [Wed, 4 Jul 2007 14:36:01 +0000 (15:36 +0100)]
filter-branch: fail gracefully when a filter fails

A common mistake is to provide a filter which fails unwantedly. For
example, this will stop in the middle:

git filter-branch --env-filter '
test $GIT_COMMITTER_EMAIL = xyz &&
export GIT_COMMITTER_EMAIL = abc' rewritten

When $GIT_COMMITTER_EMAIL is not "xyz", the test fails, and consequently
the whole filter has a non-zero exit status. However, as demonstrated
in this example, filter-branch would just stop, and the user would be
none the wiser.

Also, a failing msg-filter would not have been caught, as was the
case with one of the tests.

This patch fixes both issues, by paying attention to the exit status
of msg-filter, and by saying what failed before exiting.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd -v|--verbose to git remote to show remote url
Alex Riesen [Thu, 5 Jul 2007 22:06:56 +0000 (00:06 +0200)]
Add -v|--verbose to git remote to show remote url

Many other commands already have such an option, and I find it
practical to see where all the remotes actually come from.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofilter-branch documentation: clarify which filters are eval'ed
Johannes Schindelin [Thu, 5 Jul 2007 16:07:48 +0000 (17:07 +0100)]
filter-branch documentation: clarify which filters are eval'ed

All filters, except the commit filter, are evaluated.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-stash: allow more descriptive reminder message when saving
Junio C Hamano [Thu, 5 Jul 2007 05:46:09 +0000 (22:46 -0700)]
git-stash: allow more descriptive reminder message when saving

This allows you to say:

$ git stash starting to implement X

while creating a stash, and the resulting "stash list entry
would read as:

$ git stash list
        stash@{0}: On master: starting to implement X

instead of the default message which talks about the commit the
stash happens to be based on (hence does not have much to do
with what the stashed change is trying to do).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd urls.txt to git-clone man page
Andrew Ruder [Wed, 4 Jul 2007 22:21:36 +0000 (17:21 -0500)]
Add urls.txt to git-clone man page

Since git-clone is one of the many commands taking
URLs to remote repositories as an argument, it should include
the URL-types list from urls.txt.

Split up urls.txt into urls.txt and urls-remotes.txt.  The latter
should be used by anything besides git-clone where a discussion of
using .git/config and .git/remotes/ to name URLs just doesn't make
as much sense.

Signed-off-by: Andrew Ruder <andy@aeruder.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix git-stash(1) markup.
Junio C Hamano [Thu, 5 Jul 2007 05:09:20 +0000 (22:09 -0700)]
Fix git-stash(1) markup.

Noticed by Randal L. Schwartz.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAllow rebase to run if upstream is completely merged
Johannes Sixt [Wed, 4 Jul 2007 20:09:10 +0000 (22:09 +0200)]
Allow rebase to run if upstream is completely merged

Consider this history:

  o--o-...-B          <- origin
      \     \
       x--x--M--x--x  <- master

In this situation, rebase considers master fully up-to-date and would
not do anything. However, if there were additional commits on origin,
the rebase would run and move the commits x on top of origin.

Here we change rebase to short-circuit out only if the history since origin
is strictly linear. Consequently, the above as well as a history like this
would be linearized:

  o--o               <- origin
      \
       x--x
        \  \
         x--M--x--x  <- master

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRemove USE_PAGER from git-pickaxe and git-annotate
Andrew Ruder [Wed, 4 Jul 2007 22:21:49 +0000 (17:21 -0500)]
Remove USE_PAGER from git-pickaxe and git-annotate

git-blame (and friends) specifically leave the pager turned off
in the case that --incremental is specified as this isn't for
human consumption.  git-pickaxe and git-annotate will turn it on
themselves otherwise.

Signed-off-by: Andrew Ruder <andy@aeruder.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-svn: fix blocking with svn:// servers after do_switch
Eric Wong [Wed, 4 Jul 2007 21:07:42 +0000 (14:07 -0700)]
git-svn: fix blocking with svn:// servers after do_switch

We now explicitly disconnect before starting new SVN::Ra
connections.  SVN::Ra objects will automatically be disconnected
from the server on DESTROY.

SVN servers seem to have problems accepting multiple connections
from one client, and the SVN library has trouble being connected
to multiple servers at once.  This appears to cause opening the
second connection to block, and cause git-svn to be unusable
after using the do_switch() function.

git-svn opens another connection because a workaround is
necesary for the buggy reparent function handling on certain
versions of svn:// and svn+ssh:// servers.  Instead of using the
reparent function (analogous to chdir), it will reopen a new
connection to a different URL on the SVN server.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofilter-branch documentation: some more touch-ups.
Johannes Sixt [Wed, 4 Jul 2007 07:32:47 +0000 (09:32 +0200)]
filter-branch documentation: some more touch-ups.

- The map function used to fail, but no longer does (since 3520e1e8687.)
- Fix the "edge-graft" example.
- Show the same using .git/info/grafts.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofilter-branch: added missing warn function
Steffen Prohaska [Wed, 4 Jul 2007 08:36:24 +0000 (10:36 +0200)]
filter-branch: added missing warn function

--tag-name-filter may have failed before because
warn is used for reporting but was not available.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAlter git-checkout reflog message to include "from" branch
Sean [Wed, 4 Jul 2007 08:33:36 +0000 (04:33 -0400)]
Alter git-checkout reflog message to include "from" branch

As suggested by Junio, adding the current branch name to the
reflog message for git-checkout would be helpful.  For example:

   "checkout: moving from next to master"

Signed-off-by: Sean Estabrooks <seanlkml@sympatico.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-init: set core.worktree if GIT_WORK_TREE is specified
Matthias Lederhofer [Tue, 3 Jul 2007 22:49:19 +0000 (00:49 +0200)]
git-init: set core.worktree if GIT_WORK_TREE is specified

Now you can do the following to create a repository which
has a separate working tree:

    /tmp/foo$ export GIT_DIR=/tmp/bar
    /tmp/foo$ git --work-tree . init
    Initialized empty Git repository in /tmp/bar/
    /tmp/foo$ git config core.worktree
    /tmp/foo

Signed-off-by: Matthias Lederhofer <matled@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDo not check if getcwd() result begins with a slash.
Junio C Hamano [Wed, 4 Jul 2007 19:45:42 +0000 (12:45 -0700)]
Do not check if getcwd() result begins with a slash.

In user space, and for getcwd(), the check to see if the
resulting path begins with a '/' does not make sense.  This is
merely a mistake by Linus who is so used to code for the kernel,
where a d_path() return value pathname can be either a real
path, or something like "pipe:[8003]", and the difference is the
'/' at the beginning.

Pointed out by Dscho, Matthias Lederhofer and clarified by Linus.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofilter-branch: a few more touch ups to the man page
Johannes Schindelin [Wed, 4 Jul 2007 14:50:45 +0000 (15:50 +0100)]
filter-branch: a few more touch ups to the man page

All based on comments from Frank Lichtenheld.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Frank Lichtenheld <frank@lichtenheld.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofilter-branch: make output nicer
Johannes Schindelin [Wed, 4 Jul 2007 14:33:30 +0000 (15:33 +0100)]
filter-branch: make output nicer

Instead of filling the screen with progress lines, use \r so that
the progress can be seen, but warning messages are more visible.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoFix t5516 to create test repo without hooks
Alex Riesen [Wed, 4 Jul 2007 12:06:04 +0000 (14:06 +0200)]
Fix t5516 to create test repo without hooks

Otherwise the hooks will be executed on cygwin and the test will fail
because of the contributed hooks.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofilter-branch: Avoid an error message in the map function.
Johannes Sixt [Wed, 4 Jul 2007 12:08:17 +0000 (14:08 +0200)]
filter-branch: Avoid an error message in the map function.

When the map function didn't find the rewritten commit of the passed in
original id, it printed the original id, but it still fell through to
the 'cat', which failed with an error message.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoHandle format.subjectprefix for every command which accepts --pretty
Alex Riesen [Wed, 4 Jul 2007 10:37:27 +0000 (12:37 +0200)]
Handle format.subjectprefix for every command which accepts --pretty

Because the --pretty can be given as --pretty=email which historically produced
mails with patches. IOW, exactly what git-format-patch does.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoHandle missing prefix for "Subject:" as if no prefix given
Alex Riesen [Wed, 4 Jul 2007 10:33:46 +0000 (12:33 +0200)]
Handle missing prefix for "Subject:" as if no prefix given

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUpdate reflog message created for stashes
Junio C Hamano [Wed, 4 Jul 2007 19:37:17 +0000 (12:37 -0700)]
Update reflog message created for stashes

A stash is about a change on top of an existing commit, and not
about that commit that happened to be on which the change was
created.  Match the message we see in "git stash list" with the
commit log message to make this clear.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
17 years agorepack: don't report "Nothing new to pack." if -q is given
Uwe Kleine-König [Tue, 3 Jul 2007 08:47:58 +0000 (10:47 +0200)]
repack: don't report "Nothing new to pack." if -q is given

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd core.pager config variable.
Brian Gernhardt [Tue, 3 Jul 2007 18:18:11 +0000 (14:18 -0400)]
Add core.pager config variable.

This adds a configuration variable that performs the same function as,
but is overridden by, GIT_PAGER.

Signed-off-by: Brian Gernhardt <benji@silverinsanity.com>
Acked-by: Johannes E. Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-submodule: Fix two instances of the same typo
CJ van den Berg [Wed, 4 Jul 2007 16:22:14 +0000 (18:22 +0200)]
git-submodule: Fix two instances of the same typo

They break the output of git submodule status.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Wed, 4 Jul 2007 05:56:59 +0000 (22:56 -0700)]
Merge branch 'maint'

* maint:
  Document -<n> for git-format-patch
  glossary: add 'reflog'
  diff --no-index: fix --name-status with added files
  Don't smash stack when $GIT_ALTERNATE_OBJECT_DIRECTORIES is too long

17 years agofilter-branch: add a test for the commit removal example
Johannes Schindelin [Tue, 3 Jul 2007 16:50:19 +0000 (17:50 +0100)]
filter-branch: add a test for the commit removal example

In the man page, there is an example which describes how to remove
single commits (although it keeps the changes which were not reverted
in the next non-removed commit). Better make sure that it works as
expected.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agofsck --lost-found writes to subdirectories in .git/lost-found/
Jonas Fonseca [Wed, 4 Jul 2007 01:33:11 +0000 (03:33 +0200)]
fsck --lost-found writes to subdirectories in .git/lost-found/

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoAdd diff-option --ext-diff
Johannes Schindelin [Sat, 30 Jun 2007 17:47:07 +0000 (18:47 +0100)]
Add diff-option --ext-diff

To prevent funky games with external diff engines, git-log and
friends prevent external diff engines from being called. That makes
sense in the context of git-format-patch or git-rebase.

However, for "git log -p" it is not so nice to get the message
that binary files cannot be compared, while "git diff" has no
problems with them, if you provided an external diff driver.

With this patch, "git log --ext-diff -p" will do what you expect,
and the option "--no-ext-diff" can be used to override that
setting.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocument git-filter-branch
Johannes Schindelin [Tue, 3 Jul 2007 23:41:55 +0000 (00:41 +0100)]
Document git-filter-branch

This moves the documentation in git-filter-branch.sh to its own
man page, with a few touch ups (incorporating comments by Frank
Lichtenheld).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agostash: end commit log with a newline
Uwe Kleine-König [Tue, 3 Jul 2007 08:59:06 +0000 (10:59 +0200)]
stash: end commit log with a newline

If I do

git cat-file commit $commitid

for a commit created by stash, the next prompt starts directly after the
shortlog of HEAD.

Signed-off-by: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoUpdate draft Release Notes for 1.5.3
Junio C Hamano [Tue, 3 Jul 2007 19:04:24 +0000 (12:04 -0700)]
Update draft Release Notes for 1.5.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDocument -<n> for git-format-patch
Miklos Vajna [Tue, 3 Jul 2007 23:38:29 +0000 (01:38 +0200)]
Document -<n> for git-format-patch

The -<n> option was not mentioned in git-format-patch's manpage till
now. Fix this.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoglossary: add 'reflog'
Johannes Schindelin [Tue, 3 Jul 2007 20:28:24 +0000 (21:28 +0100)]
glossary: add 'reflog'

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agodiff --no-index: fix --name-status with added files
Johannes Schindelin [Tue, 3 Jul 2007 15:01:06 +0000 (16:01 +0100)]
diff --no-index: fix --name-status with added files

Without this patch, an added file would be reported as /dev/null.

Noticed by David Kastrup.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoDon't smash stack when $GIT_ALTERNATE_OBJECT_DIRECTORIES is too long
Jim Meyering [Tue, 3 Jul 2007 10:40:20 +0000 (12:40 +0200)]
Don't smash stack when $GIT_ALTERNATE_OBJECT_DIRECTORIES is too long

There is no restriction on the length of the name returned by
get_object_directory, other than the fact that it must be a stat'able
git object directory.  That means its name may have length up to
PATH_MAX-1 (i.e., often 4095) not counting the trailing NUL.

Combine that with the assumption that the concatenation of that name and
suffixes like "/info/alternates" and "/pack/---long-name---.idx" will fit
in a buffer of length PATH_MAX, and you see the problem.  Here's a fix:

    sha1_file.c (prepare_packed_git_one): Lengthen "path" buffer
    so we are guaranteed to be able to append "/pack/" without checking.
    Skip any directory entry that is too long to be appended.
    (read_info_alternates): Protect against a similar buffer overrun.

Before this change, using the following admittedly contrived environment
setting would cause many git commands to clobber their stack and segfault
on a system with PATH_MAX == 4096:

  t=$(perl -e '$s=".git/objects";$n=(4096-6-length($s))/2;print "./"x$n . $s')
  export GIT_ALTERNATE_OBJECT_DIRECTORIES=$t
  touch g
  ./git-update-index --add g

If you run the above commands, you'll soon notice that many
git commands now segfault, so you'll want to do this:

  unset GIT_ALTERNATE_OBJECT_DIRECTORIES

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMark disused commit walkers officially deprecated. v1.5.3-rc0
Junio C Hamano [Tue, 3 Jul 2007 06:29:54 +0000 (23:29 -0700)]
Mark disused commit walkers officially deprecated.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agogit-stash: make "save" the default action again.
Junio C Hamano [Tue, 3 Jul 2007 06:15:45 +0000 (23:15 -0700)]
git-stash: make "save" the default action again.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoRewrite "git-frotz" to "git frotz"
Junio C Hamano [Tue, 3 Jul 2007 05:52:14 +0000 (22:52 -0700)]
Rewrite "git-frotz" to "git frotz"

This uses the remove-dashes target to replace "git-frotz" to "git frotz".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoStart deprecating "git-command" in favor of "git command"
Linus Torvalds [Sat, 30 Jun 2007 18:49:17 +0000 (11:49 -0700)]
Start deprecating "git-command" in favor of "git command"

I realize that a lot of people use the "git-xyzzy" format, and we have
various historical reasons for it, but I also think that most people have
long since started thinking of the git command as a single command with
various subcommands, and we've long had the documentation talk about it
that way.

Slowly migrating away from the git-xyzzy format would allow us to
eventually no longer install hundreds of binaries (even if most of them
are symlinks or hardlinks) in users $PATH, and the _original_ reasons for
it (implementation issues and bash completion) are really long long gone.

Using "git xyzzy" also has some fundamental advantages, like the ability
to specify things like paging ("git -p xyzzy") and making the whole notion
of aliases act like other git commands (which they already do, but they do
*not* have a "git-xyzzy" form!)

Anyway, while actually removing the "git-xyzzy" things is not practical
right now, we can certainly start slowly to deprecate it internally inside
git itself - in the shell scripts we use, and the test vectors.

This patch adds a "remove-dashes" makefile target, which does that. It
isn't particularly efficient or smart, but it *does* successfully rewrite
a lot of our shell scripts to use the "git xyzzy" form for all built-in
commands.

(For non-builtins, the "git xyzzy" format implies an extra execve(), so
this script leaves those alone).

So apply this patch, and then run

make remove-dashes
make test
git commit -a

to generate a much larger patch that actually starts this transformation.

(The only half-way subtle thing about this is that it also fixes up
git-filter-branch.sh for the new world order by adding quoting around
the use of "git-commit-tree" as an argument. It doesn't need it in that
format, but when changed into "git commit-tree" it is no longer a single
word, and the quoting maintains the old behaviour).

NOTE! This does not yet mean that you can actually stop installing the
"git-xyzzy" binaries for the builtins. There are some remaining places
that want to use the old form, this just removes the most obvious ones
that can easily be done automatically.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'jo/init'
Junio C Hamano [Tue, 3 Jul 2007 04:48:08 +0000 (21:48 -0700)]
Merge branch 'jo/init'

* jo/init:
  Quiet the output from git-init when cloning, if requested.
  Add an option to quiet git-init.

17 years agogit-fsck: add --lost-found option
Johannes Schindelin [Tue, 3 Jul 2007 00:33:54 +0000 (01:33 +0100)]
git-fsck: add --lost-found option

With this option, dangling objects are not only reported, but also
written to .git/lost-found/commit/ or .git/lost-found/other/. This
option implies '--full' and '--no-reflogs'.

'git fsck --lost-found' is meant as a replacement for git-lost-found.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Tue, 3 Jul 2007 04:05:59 +0000 (21:05 -0700)]
Merge branch 'maint'

* maint:
  Correctly document the name of the global excludes file configuration

17 years agoformat-patch: Add format.subjectprefix config option
Adam Roben [Mon, 2 Jul 2007 00:48:59 +0000 (17:48 -0700)]
format-patch: Add format.subjectprefix config option

This change lets you use the format.subjectprefix config option to override the
default subject prefix.

Signed-off-by: Adam Roben <aroben@apple.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoTest 'git add' for unmerged entries when core.symlinks=false.
Johannes Sixt [Mon, 2 Jul 2007 11:28:42 +0000 (13:28 +0200)]
Test 'git add' for unmerged entries when core.symlinks=false.

In 20314271679e169f324c118c69c8d9e0399feec9 git add was fixed if unmerged
entries are in the index and core.filemode=false. core.symlinks=false is
a similar case, which touches the same code path. Here is a test that
makes sure that the symlink property in the index is preserved, too.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years ago"git-push $URL" without refspecs pushes only matching branches
Junio C Hamano [Mon, 2 Jul 2007 02:00:08 +0000 (19:00 -0700)]
"git-push $URL" without refspecs pushes only matching branches

When "git push" is run without any refspec (neither on the
command line nor in the config), we used to push "matching refs"
in the sense that anything under refs/ hierarchy that exist on
both ends were updated.  This used to be a sane default for
publishing your repository to another back when we did not have
refs/remotes/ hierarchy, but it does not make much sense these
days.

This changes the semantics to push only "matching branches".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoCorrectly document the name of the global excludes file configuration
Michael Hendricks [Mon, 2 Jul 2007 16:48:34 +0000 (10:48 -0600)]
Correctly document the name of the global excludes file configuration

Signed-off-by: Michael Hendricks <michael@ndrix.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'maint'
Junio C Hamano [Mon, 2 Jul 2007 23:41:44 +0000 (16:41 -0700)]
Merge branch 'maint'

* maint:
  Make git-prune submodule aware (and fix a SEGFAULT in the process)

17 years agoMake git-prune submodule aware (and fix a SEGFAULT in the process)
Andy Parkins [Mon, 2 Jul 2007 12:56:58 +0000 (13:56 +0100)]
Make git-prune submodule aware (and fix a SEGFAULT in the process)

I ran git-prune on a repository and got this:

 $ git-prune
 error: Object 228f8065b930120e35fc0c154c237487ab02d64a is a blob, not a commit
 Segmentation fault (core dumped)

This repository was a strange one in that it was being used to provide
its own submodule.  That is, the repository was cloned into a
subdirectory, an independent branch checked out in that subdirectory,
and then it was marked as a submodule.  git-prune then failed in the
above manner.

The problem was that git-prune was not submodule aware in two areas.

Linus said:

 > So what happens is that something traverses a tree object, looks at each
 > entry, sees that it's not a tree, and tries to look it up as a blob. But
 > subprojects are commits, not blobs, and then when you look at the object
 > more closely, you get the above kind of object type confusion.

and included a patch to add an S_ISGITLINK() test to reachable.c's
process_tree() function.  That fixed the first git-prune error, and
stopped it from trying to process the gitlink entries in trees as if
they were pointers to other trees (and of course failing, because
gitlinks _aren't_ trees).  That part of this patch is his.

The second area is add_cache_refs().  This is called before starting the
reachability analysis, and was calling lookup_blob() on every object
hash found in the index.  However, it is no longer true that every hash
in the index is a pointer to a blob, some of them are gitlinks, and are
not backed by any object at all, they are commits in another repository.
Normally this bug was not causing any problems, but in the case of the
self-referencing repository described above, it meant that the gitlink
hash was being marked as being of type OBJ_BLOB by add_cache_refs() call
to lookup_blob().  Then later, because that hash was also pointed to by
a ref, add_one_ref() would treat it as a commit; lookup_commit() would
return a NULL because that object was already noted as being an
OBJ_BLOB, not an OBJ_COMMIT; and parse_commit_buffer() would SEGFAULT on
that NULL pointer.

The fix made by this patch is to not blindly call lookup_blob() in
reachable.c's add_cache_refs(), and instead skip any index entries that
are S_ISGITLINK().

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
17 years agoMerge branch 'ew/svn'
Junio C Hamano [Mon, 2 Jul 2007 08:46:22 +0000 (01:46 -0700)]
Merge branch 'ew/svn'

* ew/svn:
  git-svn: allow dcommit to retain local merge information

17 years agoMerge branch 'ns/stash'
Junio C Hamano [Mon, 2 Jul 2007 08:45:57 +0000 (01:45 -0700)]
Merge branch 'ns/stash'

* ns/stash:
  Documentation: quote {non-attributes} for asciidoc
  git-stash: don't complain when listing in a repo with no stash
  git-stash: fix "can't shift that many" with no arguments
  git-stash: fix "no arguments" case in documentation
  git-stash: require "save" to be explicit and update documentation
  Document git-stash
  Add git-stash script

17 years agoMerge branch 'js/rebase'
Junio C Hamano [Mon, 2 Jul 2007 08:45:47 +0000 (01:45 -0700)]
Merge branch 'js/rebase'

* js/rebase:
  Teach rebase -i about --preserve-merges
  rebase -i: provide reasonable reflog for the rebased branch
  rebase -i: several cleanups
  ignore git-rebase--interactive
  Teach rebase an interactive mode
  Move the pick_author code to git-sh-setup

17 years agoMerge branch 'jc/diffcore'
Junio C Hamano [Mon, 2 Jul 2007 08:45:12 +0000 (01:45 -0700)]
Merge branch 'jc/diffcore'

* jc/diffcore:
  diffcore-delta.c: Ignore CR in CRLF for text files
  diffcore-delta.c: update the comment on the algorithm.
  diffcore_filespec: add is_binary
  diffcore_count_changes: pass diffcore_filespec