Code

git.git
16 years agoMerge branch 'maint'
Junio C Hamano [Mon, 11 Aug 2008 07:53:31 +0000 (00:53 -0700)]
Merge branch 'maint'

* maint:
  Documentation: fix invalid reference to 'mybranch' in user manual
  Fix deleting reflog entries from HEAD reflog
  reflog test: add more tests for 'reflog delete'
  Documentation: rev-list-options: Fix -g paragraph formatting

Conflicts:
Documentation/user-manual.txt

16 years agoDocumentation: fix invalid reference to 'mybranch' in user manual
Ivan Stankovic [Sun, 10 Aug 2008 16:22:14 +0000 (18:22 +0200)]
Documentation: fix invalid reference to 'mybranch' in user manual

Signed-off-by: Ivan Stankovic <pokemon@fly.srk.fer.hr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix deleting reflog entries from HEAD reflog
Junio C Hamano [Mon, 11 Aug 2008 06:21:25 +0000 (23:21 -0700)]
Fix deleting reflog entries from HEAD reflog

dwim_ref() used to resolve HEAD symbolic ref to its target (i.e. current
branch).  This incorrectly removed the reflog entry from the current
branch when 'git reflog delete HEAD@{1}' was asked for.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoreflog test: add more tests for 'reflog delete'
Pieter de Bie [Sat, 9 Aug 2008 23:33:29 +0000 (01:33 +0200)]
reflog test: add more tests for 'reflog delete'

This adds more tests for 'reflog delete' and marks it as
broken, as currently a call to 'git reflog delete HEAD@{1}'
deletes entries in the currently checked out branch's log,
not the HEAD log.

Noticed by John Wiegley

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: rev-list-options: Fix -g paragraph formatting
Thomas Rast [Sun, 10 Aug 2008 13:04:34 +0000 (15:04 +0200)]
Documentation: rev-list-options: Fix -g paragraph formatting

- Add an escape to @{now}.  Without the escape, the brace does
  something magic and eats half the sentence up to the closing brace
  at 'timestamp}'.

- Join the last paragraph with a '+'.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUpdate draft RelNotes for 1.6.0
Junio C Hamano [Sat, 9 Aug 2008 22:11:48 +0000 (15:11 -0700)]
Update draft RelNotes for 1.6.0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Sat, 9 Aug 2008 08:40:08 +0000 (01:40 -0700)]
Merge branch 'maint'

* maint:
  asciidoc markup fixes
  Fail properly when cloning from invalid HTTP URL

Conflicts:
Documentation/git-push.txt

16 years agomailinfo: fix MIME multi-part message boundary handling
Junio C Hamano [Sat, 9 Aug 2008 08:17:24 +0000 (01:17 -0700)]
mailinfo: fix MIME multi-part message boundary handling

After finding a MIME multi-part message boundary line, the handle_body()
function is supposed to first flush any accumulated contents from the
previous part to the output stream.  However, the code mistakenly output
the boundary line it found.

The old code that used one global, fixed-length buffer line[] used an
alternate static buffer newline[] for keeping track of this accumulated
contents and flushed newline[] upon seeing the boundary; when 3b6121f
(git-mailinfo: use strbuf's instead of fixed buffers, 2008-07-13)
converted a fixed-length buffer in this program to use strbuf,these two
buffers were converted to "line" and "prev" (the latter of which now has a
much more sensible name) strbufs, but the code mistakenly flushed "line"
(which contains the boundary we have just found), instead of "prev".

This resulted in the first boundary to be output in front of the first
line of the message.

The rewritten implementation of handle_boundary() lost the terminating
newline; this would then result in the second line of the message to be
stuck with the first line.

The is_multipart_boundary() was designed to catch both the internal
boundary and the terminating one (the one with trailing "--"); this also
was broken with the rewrite, and the code in the handle_boundary() to
handle the terminating boundary was never triggered.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-rm: Add a --force flag
Pieter de Bie [Fri, 8 Aug 2008 22:37:02 +0000 (00:37 +0200)]
builtin-rm: Add a --force flag

This adds a --force flag to git-rm, making it somewhat easier for
subversion people to switch.

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: wrap long lines in a few places
Eric Wong [Fri, 8 Aug 2008 08:41:58 +0000 (01:41 -0700)]
git-svn: wrap long lines in a few places

Oops, I let a few patches slip by with long lines in them.
Extracted from an unrelated patch by: Marcus Griep <marcus@griep.us>

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: Allow deep branch names by supporting multi-globs
Marcus Griep [Fri, 8 Aug 2008 08:41:57 +0000 (01:41 -0700)]
git-svn: Allow deep branch names by supporting multi-globs

Some repositories use a deep branching strategy, such as:

    branches/1.0/1.0.rc1
    branches/1.0/1.0.rc2
    branches/1.0/1.0.rtm
    branches/1.0/1.0.gold

Only allowing a single glob stiffles this.

This change allows for a single glob 'set' to accept this deep
branching strategy.

The ref glob depth must match the branch glob depth.  When using
the -b or -t options for init or clone, this is automatically
done.

For example, using the above branches:

  svn-remote.svn.branches = branches/*/*:refs/remote/*/*

gives the following branch names:

  1.0/1.0.rc1
  1.0/1.0.rc2
  1.0/1.0.rtm
  1.0/1.0.gold

[ew:
  * removed unrelated line-wrapping changes
  * fixed line-wrapping in a few more places
  * removed trailing whitespace
  * fixed bashism in test
  * removed unnecessary httpd startup in test
  * changed copyright on tests to 2008 Marcus Griep
  * added executable permissions to new tests
]

Signed-off-by: Marcus Griep <marcus@griep.us>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix multi-glob assertion in git-svn
Marcus Griep [Fri, 8 Aug 2008 08:41:56 +0000 (01:41 -0700)]
Fix multi-glob assertion in git-svn

Fixes bad regex match check for multiple globs (would always return
one glob regardless of actual number).

[ew: fixed a bashism in the test and some minor line-wrapping]

Signed-off-by: Marcus Griep <marcus@griep.us>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofilter-branch: be more helpful when an annotated tag changes
Thomas Rast [Thu, 7 Aug 2008 23:50:31 +0000 (01:50 +0200)]
filter-branch: be more helpful when an annotated tag changes

Previously, git-filter-branch failed if it attempted to update an
annotated tag.  Now we ignore this condition if --tag-name-filter is
given, so that we can later rewrite the tag.  If no such option was
provided, we warn the user that he might want to run with
"--tag-name-filter cat" to achieve the intended effect.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: filter-branch: document how to filter all refs
Thomas Rast [Thu, 7 Aug 2008 14:16:03 +0000 (16:16 +0200)]
Documentation: filter-branch: document how to filter all refs

Document the '--' option that can be used to pass rev-list options
(not just arguments), and give an example usage of '-- --all'.  Remove
reference to "the new branch name"; filter-branch takes arbitrary
arguments to rev-list since dfd05e3.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMakefile: add a target which will abort compilation with ancient shells
Brandon Casey [Thu, 7 Aug 2008 19:06:26 +0000 (14:06 -0500)]
Makefile: add a target which will abort compilation with ancient shells

This adds a make target which can be used to try to execute certain shell
constructs which are required for compiling and running git.

This patch provides a test for the $() notation for command substition
which is used in the Makefile and extensively in the git scripts.

The make target is named in such a way as to be a hint to the user that
SHELL_PATH should be set to an appropriate shell. If the shell command
fails, the user should receive a message similar to the following:

make: *** [please_set_SHELL_PATH_to_a_more_modern_shell] Error 2

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash: remove redundant check for 'git stash apply' options
SZEDER Gábor [Wed, 6 Aug 2008 15:45:23 +0000 (17:45 +0200)]
bash: remove redundant check for 'git stash apply' options

It will never trigger anyway because of the first check, and even if it
would, it would not offer the command line option.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoGIT-VERSION-GEN: mark the version 'dirty' only if there are modified files
Junio C Hamano [Fri, 8 Aug 2008 20:31:27 +0000 (13:31 -0700)]
GIT-VERSION-GEN: mark the version 'dirty' only if there are modified files

We used to mark the version string with '-dirty' if the cache was not up
to date, but the only thing we want to know is if the binaries are built
from modified source.  Refresh the cache to avoid false dirtyness.

Christian Jaeger noticed this issue while building under fakeroot
environment (without -u) that lies about the file ownership data.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMakefile: set SHELL to value of SHELL_PATH
Brandon Casey [Thu, 7 Aug 2008 19:03:42 +0000 (14:03 -0500)]
Makefile: set SHELL to value of SHELL_PATH

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: user-manual: "git commit -a" doesn't motivate .gitignore
Jonathan Nieder [Wed, 6 Aug 2008 21:22:00 +0000 (16:22 -0500)]
Documentation: user-manual: "git commit -a" doesn't motivate .gitignore

"git commit -a" ignores untracked files and follows all tracked
files, regardless of whether they are listed in .gitignore.  So
don't use it to motivate gitignore.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Acked-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: add ability to specify --commit-url for dcommit
Eric Wong [Thu, 7 Aug 2008 09:06:16 +0000 (02:06 -0700)]
git-svn: add ability to specify --commit-url for dcommit

This allows one to use public svn:// URLs for fetch and
svn+ssh:// URLs for committing (without using the complicated
rewriteRoot option, reimporting or git-filter-branch).

Using this can also help avoid unnecessary server
authentication/encryption overhead on busy SVN servers.

Along with the new --revision option, this can also be allowed
to override the branch detection in dcommit, too.  This is
potentially dangerous and not recommended!  (And also purposely
undocumented, but the loaded gun is there in case somebody
wants to make it safe).

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: commit-tree: remove 16 parents restriction
Thomas Rast [Fri, 8 Aug 2008 07:52:55 +0000 (09:52 +0200)]
Documentation: commit-tree: remove 16 parents restriction

ef98c5ca lifted the 16 parents restriction in builtin-commit-tree.c,
but forgot to update the documentation.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoasciidoc markup fixes
Junio C Hamano [Thu, 7 Aug 2008 23:05:25 +0000 (16:05 -0700)]
asciidoc markup fixes

I see quite a few pages on k.org site, e.g.

    http://www.kernel.org/pub/software/scm/git/docs/git-rerere.html
    (scroll down to find "After this test merge")

are misformatted to lose teletype text '+' that is followed by a comma,
and turns the following paragraph all typeset in teletype.

This patch seems to fix the issue at the site (meaning, with the
particular vintage of asciidoc and docbook toolchain), without breaking
things with the version I have at my primary development machine, but
wider testing is very much appreciated.

After this patch,

    git grep '`+`,' -- Documentation

should report noting.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoclone --mirror: avoid storing repeated tags
Johannes Schindelin [Fri, 8 Aug 2008 02:29:35 +0000 (04:29 +0200)]
clone --mirror: avoid storing repeated tags

With --mirror, clone asks for refs/* already, so it does not need to
ask for ref/tags/*, too.

Noticed by Cesar Eduardo Barros.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'lt/config-fsync' into maint
Junio C Hamano [Thu, 7 Aug 2008 01:56:23 +0000 (18:56 -0700)]
Merge branch 'lt/config-fsync' into maint

* lt/config-fsync:
  Add config option to enable 'fsync()' of object files
  Split up default "i18n" and "branch" config parsing into helper routines
  Split up default "user" config parsing into helper routine
  Split up default "core" config parsing into helper routine

16 years agoMerge branch 'jc/reflog-expire' into maint
Junio C Hamano [Thu, 7 Aug 2008 01:52:50 +0000 (18:52 -0700)]
Merge branch 'jc/reflog-expire' into maint

* jc/reflog-expire:
  Make default expiration period of reflog used for stash infinite
  Per-ref reflog expiry configuration

16 years agoMerge branch 'ag/rewrite_one' into maint
Junio C Hamano [Thu, 7 Aug 2008 01:48:32 +0000 (18:48 -0700)]
Merge branch 'ag/rewrite_one' into maint

* ag/rewrite_one:
  Fix quadratic performance in rewrite_one.

16 years agoFail properly when cloning from invalid HTTP URL
Petr Baudis [Thu, 7 Aug 2008 00:06:30 +0000 (02:06 +0200)]
Fail properly when cloning from invalid HTTP URL

Currently, when cloning from invalid HTTP URL, git clone will possibly
return curl error, then a confusing message about remote HEAD and then
return success and leave an empty repository behind, confusing either
the end-user or the automated service calling it (think repo.or.cz).

This patch changes the error() calls in get_refs_via_curl() to die()s,
akin to the other get_refs_*() functions.

Cc: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Petr Baudis <pasky@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoGIT 1.6.0-rc2 v1.6.0-rc2
Junio C Hamano [Wed, 6 Aug 2008 19:44:55 +0000 (12:44 -0700)]
GIT 1.6.0-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoperl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section
Brandon Casey [Tue, 5 Aug 2008 23:23:08 +0000 (18:23 -0500)]
perl/Makefile: handle paths with spaces in the NO_PERL_MAKEMAKER section

Use double quotes to protect against paths which may contain spaces.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoSync with 1.5.6.5
Junio C Hamano [Wed, 6 Aug 2008 20:50:42 +0000 (13:50 -0700)]
Sync with 1.5.6.5

16 years agoGIT 1.5.6.5 v1.5.6.5
Junio C Hamano [Wed, 6 Aug 2008 19:04:06 +0000 (12:04 -0700)]
GIT 1.5.6.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFiles given on the command line are relative to $cwd
Junio C Hamano [Wed, 6 Aug 2008 18:43:47 +0000 (11:43 -0700)]
Files given on the command line are relative to $cwd

When running "git commit -F file" and "git tag -F file" from a
subdirectory, we should take it as relative to the directory we started
from, not relative to the top-level directory.

This adds a helper function "parse_options_fix_filename()" to make it more
convenient to fix this class of issues.  Ideally, parse_options() should
support a new type of option, "OPT_FILENAME", to do this uniformly, but
this patch is meant to go to 'maint' to fix it minimally.

One thing to note is that value for "commit template file" that comes from
the command line is taken as relative to $cwd just like other parameters,
but when it comes from the configuration varilable 'commit.template', it
is taken as relative to the working tree root as before.  I think this
difference actually is sensible (not that I particularly think
commit.template itself is sensible).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge git://repo.or.cz/git-gui
Junio C Hamano [Wed, 6 Aug 2008 20:32:18 +0000 (13:32 -0700)]
Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui:
  git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'
  git-gui: add a part about format strings in po/README
  git-gui: update po/it.po
  git-gui: update Japanese translation
  git-gui: Update swedish translation.
  git-gui: Update git-gui.pot for 0.11 nearing release
  git-gui: Update German translation

16 years agoMerge git://git.kernel.org/pub/scm/gitk/gitk
Junio C Hamano [Wed, 6 Aug 2008 20:32:12 +0000 (13:32 -0700)]
Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
  gitk: Update swedish translation.
  gitk: Updated German translation
  gitk: Fallback to selecting the head commit upon load
  gitk: Fixed automatic row selection during load
  gitk: Fixed broken exception handling in diff
  gitk: On Windows, use a Cygwin-specific flag for kill
  gitk: Arrange to kill diff-files & diff-index on quit
  gitk: Kill back-end processes on window close

16 years agoMerge branch 'rs/archive-parse-options'
Junio C Hamano [Wed, 6 Aug 2008 20:31:38 +0000 (13:31 -0700)]
Merge branch 'rs/archive-parse-options'

* rs/archive-parse-options:
  archive: allow --exec and --remote without equal sign

16 years agofix diff-tree --stdin documentation
Junio C Hamano [Wed, 6 Aug 2008 05:32:28 +0000 (22:32 -0700)]
fix diff-tree --stdin documentation

Long time ago, the feature of "diff-tree --stdin" to take a commit and its
parents on one line was broken, and did not support the common:

    git rev-list --parents $commits... -- $paths... |
    git diff-tree --stdin -v -p

usage pattern by Porcelains properly.  For diff-tree to talk sensibly
about commits, it needs to see commits, not just trees; the code was fixed
to take list of commits on the standard input in 1.2.0.

However we left the documentation stale for a long time, until Karl
Hasselström finally noticed it very recently.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoOptimize sha1_object_info for loose objects, not concurrent repacks
Steven Grimm [Tue, 5 Aug 2008 20:08:41 +0000 (13:08 -0700)]
Optimize sha1_object_info for loose objects, not concurrent repacks

When dealing with a repository with lots of loose objects, sha1_object_info
would rescan the packs directory every time an unpacked object was referenced
before finally giving up and looking for the loose object. This caused a lot
of extra unnecessary system calls during git pack-objects; the code was
rereading the entire pack directory once for each loose object file.

This patch looks for a loose object before falling back to rescanning the
pack directory, rather than the other way around.

Signed-off-by: Steven Grimm <koreth@midwinter.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTeach fsck and prune that tmp_obj_ file names may not be 14 bytes long
Brandon Casey [Tue, 5 Aug 2008 18:01:50 +0000 (13:01 -0500)]
Teach fsck and prune that tmp_obj_ file names may not be 14 bytes long

As Shawn pointed out, not all temporary file creation routines can
ensure that the generated temporary file is of a certain length.
e.g. Java's createTempFile(prefix, suffix). So just depend on the
prefix 'tmp_obj_' for detection.

Update prune, and fix the "fix" introduced by a08c53a1 :)

Signed-off-by: Brandon "appendixless" Casey <casey@nrlssc.navy.mil>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash completion: Add completion for 'git mv'
Lee Marlow [Tue, 5 Aug 2008 05:50:38 +0000 (23:50 -0600)]
bash completion: Add completion for 'git mv'

Add completions for all long options specified in the docs
    --dry-run

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash completion: Add completion for 'git ls-files'
Lee Marlow [Tue, 5 Aug 2008 05:50:37 +0000 (23:50 -0600)]
bash completion: Add completion for 'git ls-files'

Add completions for all long options specified in the docs
    --cached --deleted --modified --others --ignored
    --stage --directory --no-empty-directory --unmerged
    --killed --exclude= --exclude-from=
    --exclude-per-directory= --exclude-standard
    --error-unmatch --with-tree= --full-name
    --abbrev --ignored --exclude-per-directory

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash completion: Add completion for 'git archive'
Lee Marlow [Tue, 5 Aug 2008 05:50:36 +0000 (23:50 -0600)]
bash completion: Add completion for 'git archive'

Add completions for all long options specified in the docs
    --format= --list --verbose
    --prefix= --remote= --exec=

The --format= long option can be completed with available formats
and the --remote= can be completed with defined remote repositories.

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash completion: More completions for 'git stash'
Lee Marlow [Tue, 5 Aug 2008 05:50:35 +0000 (23:50 -0600)]
bash completion: More completions for 'git stash'

Add branch subcommand to completions and USAGE for git-stash.sh.
Complete stash names for show, apply, drop, pop, and branch.
Add "--index" long option for apply.

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash completion: Add completion for 'git revert'
Lee Marlow [Tue, 5 Aug 2008 05:50:34 +0000 (23:50 -0600)]
bash completion: Add completion for 'git revert'

Add completions for all long options specified in the docs
    --edit --mainline --no-edit --no-commit --signoff

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash completion: Add completion for 'git init'
Lee Marlow [Tue, 5 Aug 2008 05:50:33 +0000 (23:50 -0600)]
bash completion: Add completion for 'git init'

Add completions for all long options specified in the docs
    --quiet --bare --template= --shared
    --shared={false|true|umask|group|all|world|everybody}

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash completion: Add completion for 'git clean'
Lee Marlow [Tue, 5 Aug 2008 05:50:32 +0000 (23:50 -0600)]
bash completion: Add completion for 'git clean'

Add completions for all long options specified in the docs
    --dry-run --quiet

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash completion: Add completion for 'git clone'
Lee Marlow [Tue, 5 Aug 2008 05:50:31 +0000 (23:50 -0600)]
bash completion: Add completion for 'git clone'

Add completions for all long options specified in the docs
    --local --no-hardlinks --shared --reference
    --quiet --no-checkout --bare --mirror --origin
    --upload-pack --template= --depth

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot9119: conditionally re-enable test depending on svn(1) version
Eric Wong [Tue, 5 Aug 2008 07:35:18 +0000 (00:35 -0700)]
t9119: conditionally re-enable test depending on svn(1) version

I've tested this with svn 1.4.4

This also adds quoting to make it work odd characters
in the trash path.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix race condition in t9119-git-svn-info.sh
David D. Kilzer [Tue, 5 Aug 2008 07:35:17 +0000 (00:35 -0700)]
Fix race condition in t9119-git-svn-info.sh

Changed the ptouch bash function to use the "Text Last Updated"
date reported by 'svn info' when changing the modified time
(mtime) of the file/symlink/directory in the git working
directory.  Previously it used the mtime of the item in the
svn working directory, which caused the race condition.

[ew: swapped argument order of ptouch() to minimize diff]

From: David D. Kilzer <ddkilzer@kilzer.net>

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: properly set path for "info" command
Eric Wong [Tue, 5 Aug 2008 07:35:16 +0000 (00:35 -0700)]
git-svn: properly set path for "info" command

canonicalize_path() was previously changed to better
fit SVN 1.5, but it makes the "info" command not match
svn(1) in two places:

  1) URL ended up with a trailing slash when run without an
     argument.

  2) "Path: " was displayed instead of "Path: ." when run
     without an argument.

We will also handle odd cases where a user wants to
get information on a file or directory named "0", too.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: typos / spelling fixes
Mike Ralphson [Tue, 5 Aug 2008 16:12:05 +0000 (17:12 +0100)]
Documentation: typos / spelling fixes

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Wed, 6 Aug 2008 04:21:08 +0000 (21:21 -0700)]
Merge branch 'maint'

* maint:
  RelNotes 1.5.6.5 updates
  diff.renamelimit is a basic diff configuration
  git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.
  Documentation: typos / spelling fixes in older RelNotes

16 years agoRelNotes 1.5.6.5 updates
Junio C Hamano [Wed, 6 Aug 2008 04:20:59 +0000 (21:20 -0700)]
RelNotes 1.5.6.5 updates

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodiff.renamelimit is a basic diff configuration
Linus Torvalds [Tue, 5 Aug 2008 18:27:30 +0000 (11:27 -0700)]
diff.renamelimit is a basic diff configuration

The configuration was added as a core option in 3299c6f (diff: make
default rename detection limit configurable., 2005-11-15), but 9ce392f
(Move diff.renamelimit out of default configuration., 2005-11-21)
separated diff-related stuff out of the core.

Up to that point it was Ok.

When we separated the Porcelain options out of the git_diff_config in
83ad63c (diff: do not use configuration magic at the core-level,
2006-07-08), we should have been more careful.

This mistake made diff-tree plumbing and git-show Porcelain to notice
different set of renames when the user explicitly asked for rename
detection.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.
Jim Meyering [Tue, 5 Aug 2008 14:54:42 +0000 (16:54 +0200)]
git-cvsimport.perl: Print "UNKNOWN LINE..." on stderr, not stdout.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: typos / spelling fixes in older RelNotes
Mike Ralphson [Tue, 5 Aug 2008 16:12:06 +0000 (17:12 +0100)]
Documentation: typos / spelling fixes in older RelNotes

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocorrect access right for git-svn-dcommit test
Dmitry Potapov [Mon, 4 Aug 2008 15:30:24 +0000 (19:30 +0400)]
correct access right for git-svn-dcommit test

The tests requires anonymous write access. Therefore, "anon-access =
write" is added to conf/svnserve.conf. But because it was added to
the end of the file, it is impossible to guarantee in what section
it will be located. It turned out that on SVN 1.5, it was placed in
the wrong section and as result the test failed.

Signed-off-by: Dmitry Potapov <dpotapov@gmail.com>
Tested-by: Brad King <brad.king@kitware.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix typos in INSTALL
Abhijit Menon-Sen [Tue, 5 Aug 2008 02:11:04 +0000 (07:41 +0530)]
Fix typos in INSTALL

Signed-off-by: Abhijit Menon-Sen <ams@toroid.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix typo in perl/Git.pm
Abhijit Menon-Sen [Tue, 5 Aug 2008 02:06:16 +0000 (07:36 +0530)]
Fix typo in perl/Git.pm

Signed-off-by: Abhijit Menon-Sen <ams@toroid.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix hash slice syntax error
Abhijit Menon-Sen [Mon, 4 Aug 2008 05:02:47 +0000 (10:32 +0530)]
Fix hash slice syntax error

Signed-off-by: Abhijit Menon-Sen <ams@toroid.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoGit.pm: localise $? in command_close_bidi_pipe()
Abhijit Menon-Sen [Mon, 4 Aug 2008 11:38:27 +0000 (17:08 +0530)]
Git.pm: localise $? in command_close_bidi_pipe()

Git::DESTROY calls _close_cat_blob and _close_hash_and_insert_object,
which in turn call command_close_bidi_pipe, which calls waitpid, which
alters $?. If this happens during global destruction, it may alter the
program's exit status unexpectedly. Making $? local to the function
solves the problem.

(The problem was discovered due to a failure of test #8 in
t9106-git-svn-commit-diff-clobber.sh.)

Signed-off-by: Abhijit Menon-Sen <ams@toroid.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash completion: Add completion for 'git grep'
Lee Marlow [Sat, 2 Aug 2008 00:56:33 +0000 (18:56 -0600)]
bash completion: Add completion for 'git grep'

Add completions for all long options specified in the docs

    --cached
    --text --ignore-case --word-regexp --invert-match
    --full-name
    --extended-regexp --basic-regexp --fixed-strings
    --files-with-matches --name-only
    --files-without-match
    --count
    --and --or --not --all-match

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd output flushing before fork()
Anders Melchiorsen [Mon, 4 Aug 2008 10:18:40 +0000 (12:18 +0200)]
Add output flushing before fork()

This adds fflush(NULL) before fork() in start_command(), to keep
the generic interface safe.

A remaining use of fork() with no flushing is in a comment in
show_tree(). Rewrite that comment to use start_command().

Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'
Johannes Sixt [Mon, 4 Aug 2008 20:09:46 +0000 (22:09 +0200)]
git-gui: Adapt discovery of oguilib to execdir 'libexec/git-core'

The new execdir is two levels below the root directory, while
the old execdir 'bin' was only one level below.  This commit
adapts the discovery of oguilib that uses relative paths
accordingly. We determine whether we have the extra level in the same
way in which the Makefile defines sharedir, i.e. whether the last
directory part is 'git-core'.

Inspired-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-svn: Abort with an error if 'fetch' parameter is invalid.
Avery Pennarun [Wed, 30 Jul 2008 20:53:55 +0000 (16:53 -0400)]
git-svn: Abort with an error if 'fetch' parameter is invalid.

Previously, if a config entry looked like this:

         svn-remote.svn.fetch=:refs/heads/whatever

git-svn would silently do nothing if you asked it to "git svn fetch", and
give a strange error if asked to "git svn dcommit".  What it really wants is
a line that looks like this:

svn-remote.svn.fetch=:refs/remotes/whatever

So we should simply abort if we get the wrong thing.

On the other hand, there's actually no good reason for git-svn to enforce
using the refs/remotes namespace, but the code seems to have hardcoded this
in several places and I'm not brave enough to try to fix it all right now.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFlush output in start_async
Anders Melchiorsen [Mon, 4 Aug 2008 00:30:03 +0000 (02:30 +0200)]
Flush output in start_async

This prevents double output in case stdout is redirected.

Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitk: Update swedish translation.
Mikael Magnusson [Sun, 3 Aug 2008 17:04:21 +0000 (19:04 +0200)]
gitk: Update swedish translation.

Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agoModify mingw_main() workaround to avoid link errors
Steffen Prohaska [Sat, 26 Jul 2008 09:41:44 +0000 (11:41 +0200)]
Modify mingw_main() workaround to avoid link errors

With MinGW's

   gcc.exe (GCC) 3.4.5 (mingw special)
   GNU ld version 2.17.50 20060824

the old define caused link errors:

   git.o: In function `main':
   C:/msysgit/git/git.c:500: undefined reference to `mingw_main'
   collect2: ld returned 1 exit status

The modified define works.

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Acked-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Sun, 3 Aug 2008 21:14:10 +0000 (14:14 -0700)]
Merge branch 'maint'

* maint:
  git-name-rev: don't use printf without format

16 years agoclone --bare: Add ".git" suffix to the directory name to clone into
Johannes Schindelin [Fri, 1 Aug 2008 14:01:36 +0000 (16:01 +0200)]
clone --bare: Add ".git" suffix to the directory name to clone into

We have a tradition that bare repositories live in directories ending
in ".git".  To make this more a convention than just a tradition, teach
"git clone --bare" to add a ".git" suffix to the directory name.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: add a part about format strings in po/README
Michele Ballabio [Sun, 3 Aug 2008 11:12:14 +0000 (13:12 +0200)]
git-gui: add a part about format strings in po/README

This should help tranlators that need to reorder words and strings.
Original explanation by Christian Stimming.

Also remove unneeded backslashes.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: update po/it.po
Michele Ballabio [Wed, 21 May 2008 14:09:14 +0000 (16:09 +0200)]
git-gui: update po/it.po

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: update Japanese translation
しらいしななこ [Sun, 3 Aug 2008 08:01:50 +0000 (17:01 +0900)]
git-gui: update Japanese translation

This updates Japanese translation to match the updated git-gui.pot.

Signed-off-by: しらいしななこ <nanako3@lavabit.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-name-rev: don't use printf without format
René Scharfe [Sun, 3 Aug 2008 13:44:33 +0000 (15:44 +0200)]
git-name-rev: don't use printf without format

printf() without an explicit format string is not a good coding practise,
unless the printed string is guaranteed to not contain percent signs.  While
fixing this, we might as well combine the calls to fwrite() and printf().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitk: Updated German translation
Christian Stimming [Sat, 24 May 2008 20:42:30 +0000 (22:42 +0200)]
gitk: Updated German translation

This includes suggestions by Stephan Beyer.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Paul Mackerras <paulus@samba.org>
16 years agogit-gui: Update swedish translation.
Mikael Magnusson [Sat, 2 Aug 2008 23:46:23 +0000 (01:46 +0200)]
git-gui: Update swedish translation.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agodiff: chapter and part in funcname for tex
Giuseppe Bilotta [Sat, 2 Aug 2008 21:56:44 +0000 (23:56 +0200)]
diff: chapter and part in funcname for tex

This patch enhances the tex funcname by adding support for
chapter and part sectioning commands. It also matches
the starred version of the sectioning commands.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTeach "git diff -p" Pascal/Delphi funcname pattern
Avery Pennarun [Fri, 1 Aug 2008 21:00:15 +0000 (17:00 -0400)]
Teach "git diff -p" Pascal/Delphi funcname pattern

Finds classes, records, functions, procedures, and sections.  Most lines
need to start at the first column, or else there's no way to differentiate
a procedure's definition from its declaration.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodiff: add ruby funcname pattern
Giuseppe Bilotta [Thu, 31 Jul 2008 07:21:48 +0000 (09:21 +0200)]
diff: add ruby funcname pattern

Provide a regexp that catches class, module and method definitions in
Ruby scripts, since the built-in default only finds classes.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix reference to Everyday Git, which is an HTML document and not a man page.
Jon Jensen [Sat, 2 Aug 2008 21:41:48 +0000 (15:41 -0600)]
Fix reference to Everyday Git, which is an HTML document and not a man page.

Signed-off-by: Jon Jensen <jon@endpoint.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash completion: Add more long options for 'git log'
Lee Marlow [Sat, 2 Aug 2008 00:56:53 +0000 (18:56 -0600)]
bash completion: Add more long options for 'git log'

Options added: --parents --children --full-history

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobash completion: remove unused function _git_diff_tree
Lee Marlow [Sat, 2 Aug 2008 04:47:09 +0000 (22:47 -0600)]
bash completion: remove unused function _git_diff_tree

completion for git diff-tree was removed in 5cfb4fe

Signed-off-by: Lee Marlow <lee.marlow@gmail.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoclone: Add an option to set up a mirror
Johannes Schindelin [Sat, 2 Aug 2008 19:38:56 +0000 (21:38 +0200)]
clone: Add an option to set up a mirror

The command line

$ git clone --mirror $URL

is now a short-hand for

$ git clone --bare $URL
$ (cd $(basename $URL) && git remote add --mirror origin $URL)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Update git-gui.pot for 0.11 nearing release
Shawn O. Pearce [Sat, 2 Aug 2008 21:48:33 +0000 (14:48 -0700)]
git-gui: Update git-gui.pot for 0.11 nearing release

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agogit-gui: Update German translation
Christian Stimming [Sat, 2 Aug 2008 07:54:51 +0000 (09:54 +0200)]
git-gui: Update German translation

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoMerge branch 'maint'
Junio C Hamano [Sat, 2 Aug 2008 18:58:34 +0000 (11:58 -0700)]
Merge branch 'maint'

* maint:
  git-name-rev: allow --name-only in combination with --stdin
  builtin-name-rev.c: split deeply nested part from the main function

Conflicts:
Documentation/git-name-rev.txt

16 years agogit-name-rev: allow --name-only in combination with --stdin
Pieter de Bie [Thu, 31 Jul 2008 13:20:34 +0000 (15:20 +0200)]
git-name-rev: allow --name-only in combination with --stdin

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-name-rev.c: split deeply nested part from the main function
Junio C Hamano [Sat, 2 Aug 2008 18:04:22 +0000 (11:04 -0700)]
builtin-name-rev.c: split deeply nested part from the main function

The main function of this command implementation tries to do too many
things.  Split out a handling of single input line into a separate
function to reduce nesting level and clutter.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Sat, 2 Aug 2008 06:55:51 +0000 (23:55 -0700)]
Merge branch 'maint'

16 years agoStart 1.5.6.5 RelNotes to describe accumulated fixes
Junio C Hamano [Sat, 2 Aug 2008 06:54:01 +0000 (23:54 -0700)]
Start 1.5.6.5 RelNotes to describe accumulated fixes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake git-add -i accept ranges like 7-
Ciaran McCreesh [Mon, 14 Jul 2008 18:29:37 +0000 (19:29 +0100)]
Make git-add -i accept ranges like 7-

git-add -i ranges expect number-number. But for the supremely lazy, typing in
that second number when selecting "from patch 7 to the end" is wasted effort.
So treat an empty second number in a range as "until the last item".

Signed-off-by: Ciaran McCreesh <ciaran.mccreesh@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUpdate my e-mail address
Junio C Hamano [Mon, 21 Jul 2008 19:14:42 +0000 (12:14 -0700)]
Update my e-mail address

The old cox.net address is still getting mails from gitters.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-diff(1): "--c" -> "--cc" typo fix
Jonathan Nieder [Mon, 21 Jul 2008 18:34:06 +0000 (13:34 -0500)]
git-diff(1): "--c" -> "--cc" typo fix

git diff does not take a --c option.

Signed-off-by: Jonathan Nieder <jrnieder@uchicago.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-submodule: move ill placed shift.
Pierre Habouzit [Mon, 21 Jul 2008 18:15:59 +0000 (20:15 +0200)]
git-submodule: move ill placed shift.

When running git submodule update -i, the "-i" is shifted before recursing
into cmd_init and then again outside of the loop. This causes some /bin/sh
to complain about shifting when there are no arguments left (and would
discard anything written after -i too).

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot/t4202-log.sh: add newline at end of file
Brandon Casey [Tue, 22 Jul 2008 21:23:31 +0000 (16:23 -0500)]
t/t4202-log.sh: add newline at end of file

Some shells hang when parsing the script if the last statement is not
followed by a newline. So add one.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosort_in_topological_order(): avoid setting a commit flag
Johannes Schindelin [Wed, 23 Jul 2008 00:51:36 +0000 (01:51 +0100)]
sort_in_topological_order(): avoid setting a commit flag

We used to set the TOPOSORT flag of commits during the topological
sorting, but we can just as well use the member "indegree" for it:
indegree is now incremented by 1 in the cases where the commit used
to have the TOPOSORT flag.

This is the same behavior as before, since indegree could not be
non-zero when TOPOSORT was unset.

Incidentally, this fixes the bug in show-branch where the 8th column
was not shown: show-branch sorts the commits in topological order,
assuming that all the commit flags are available for show-branch's
private matters.

But this was not true: TOPOSORT was identical to the flag corresponding
to the 8th ref.  So the flags for the 8th column were unset by the
topological sorting.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: clarify diff --cc
Junio C Hamano [Wed, 23 Jul 2008 23:16:05 +0000 (16:16 -0700)]
Documentation: clarify diff --cc

The definition of an "uninteresting" hunk was not in line with reality.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoPropagate -u/--upload-pack option of "git clone" to transport.
Steve Haslam [Fri, 25 Jul 2008 17:51:51 +0000 (18:51 +0100)]
Propagate -u/--upload-pack option of "git clone" to transport.

The -u option to override the remote system's path to git-upload-pack was
being ignored by "git clone"; caused by a missing call to
transport_set_option to set TRANS_OPT_UPLOADPACK. Presumably this crept in
when git-clone was converted from shell to C.

Signed-off-by: Steve Haslam <shaslam@lastminute.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation: fix diff.external example
Anders Melchiorsen [Sun, 27 Jul 2008 11:12:15 +0000 (13:12 +0200)]
Documentation: fix diff.external example

The diff.external examples pass a flag to gnu-diff, but GNU diff
does not follow the GIT_EXTERNAL_DIFF interface.

Signed-off-by: Anders Melchiorsen <mail@cup.kalibalik.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agomake sure parsed wildcard refspec ends with slash
Junio C Hamano [Sun, 27 Jul 2008 06:15:51 +0000 (23:15 -0700)]
make sure parsed wildcard refspec ends with slash

A wildcard refspec is internally parsed into a refspec structure with src
and dst strings.  Many parts of the code assumed that these do not include
the trailing "/*" when matching the wildcard pattern with an actual ref we
see at the remote.  What this meant was that we needed to make sure not
just that the prefix matched, and also that a slash followed the part that
matched.

But a codepath that scans the result from ls-remote and finds matching
refs forgot to check the "matching part must be followed by a slash" rule.
This resulted in "refs/heads/b1" from the remote side to mistakenly match
the source side of "refs/heads/b/*:refs/remotes/b/*" refspec.

Worse, the refspec crafted internally by "git-clone", and a hardcoded
preparsed refspec that is used to implement "git-fetch --tags", violated
this "parsed widcard refspec does not end with slash" rule; simply adding
the "matching part must be followed by a slash" rule then would have
broken codepaths that use these refspecs.

This commit changes the rule to require a trailing slash to parsed
wildcard refspecs.  IOW, "refs/heads/b/*:refs/remotes/b/*" is parsed as
src = "refs/heads/b/" and dst = "refs/remotes/b/".  This allows us to
simplify the matching logic because we only need to do a prefixcmp() to
notice "refs/heads/b/one" matches and "refs/heads/b1" does not.

Acked-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoinit: handle empty "template" parameter
Jeff King [Mon, 28 Jul 2008 06:02:04 +0000 (02:02 -0400)]
init: handle empty "template" parameter

If a user passes "--template=", then our template parameter
is blank. Unfortunately, copy_templates() assumes it has at
least one character, and does all sorts of bad things like
reading from template[-1] and then proceeding to link all of
'/' into the .git directory.

This patch just checks for that condition in copy_templates
and aborts. As a side effect, this means that --template=
now has the meaning "don't copy any templates."

Signed-off-by: Junio C Hamano <gitster@pobox.com>