git
14 years agot3302-notes-index-expensive: Speed up create_repo()
Johan Herland [Sat, 12 Sep 2009 16:08:41 +0000 (18:08 +0200)] 
t3302-notes-index-expensive: Speed up create_repo()

Creating repos with 10/100/1000/10000 commits and notes takes a lot of time.
However, using git-fast-import to do the job is a lot more efficient than
using plumbing commands to do the same.

This patch decreases the overall run-time of this test on my machine from
~3 to ~1 minutes.

Signed-off-by: Johan Herland <johan@herland.net>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-import: Add support for importing commit notes
Johan Herland [Sat, 12 Sep 2009 16:08:40 +0000 (18:08 +0200)] 
fast-import: Add support for importing commit notes

Introduce a 'notemodify' subcommand of the 'commit' command. This subcommand
is similar to 'filemodify', except that no mode is supplied (all notes have
mode 0644), and the path is set to the hex SHA1 of the given "comittish".

This enables fast import of note objects along with their associated commits,
since the notes can now be named using the mark references of their
corresponding commits.

The patch also includes a test case of the added functionality.

Signed-off-by: Johan Herland <johan@herland.net>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoTeach "-m <msg>" and "-F <file>" to "git notes edit"
Johan Herland [Sat, 12 Sep 2009 16:08:39 +0000 (18:08 +0200)] 
Teach "-m <msg>" and "-F <file>" to "git notes edit"

The "-m" and "-F" options are already the established method
(in both git-commit and git-tag) to specify a commit/tag message
without invoking the editor. This patch teaches "git notes edit"
to respect the same options for specifying a notes message without
invoking the editor.

Multiple "-m" and/or "-F" options are concatenated as separate
paragraphs.

The patch also updates the "git notes" documentation and adds
selftests for the new functionality. Unfortunately, the added
selftests include a couple of lines with trailing whitespace
(without these the test will fail). This may cause git to warn
about "whitespace errors".

This patch has been improved by the following contributions:
- Thomas Rast: fix trailing whitespace in t3301

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd an expensive test for git-notes
Johannes Schindelin [Sat, 12 Sep 2009 16:08:38 +0000 (18:08 +0200)] 
Add an expensive test for git-notes

git-notes have the potential of being pretty expensive, so test with
a lot of commits.  A lot.  So to make things cheaper, you have to
opt-in explicitely, by setting the environment variable
GIT_NOTES_TIMING_TESTS.

This patch has been improved by the following contributions:
- Junio C Hamano: tests: fix "export var=val"

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoSpeed up git notes lookup
Johannes Schindelin [Sat, 12 Sep 2009 16:08:37 +0000 (18:08 +0200)] 
Speed up git notes lookup

To avoid looking up each and every commit in the notes ref's tree
object, which is very expensive, speed things up by slurping the tree
object's contents into a hash_map.

The idea for the hashmap singleton is from David Reiss, initial
benchmarking by Jeff King.

Note: the implementation allows for arbitrary entries in the notes
tree object, ignoring those that do not reference a valid object.  This
allows you to annotate arbitrary branches, or objects.

This patch has been improved by the following contributions:
- Junio C Hamano: fixed an obvious error in initialize_hash_map()

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd a script to edit/inspect notes
Johannes Schindelin [Sat, 12 Sep 2009 16:08:36 +0000 (18:08 +0200)] 
Add a script to edit/inspect notes

The script 'git notes' allows you to edit and show commit notes, by
calling either

git notes show <commit>

or

git notes edit <commit>

This patch has been improved by the following contributions:
- Tor Arne Vestbø: fix printing of multi-line notes
- Michael J Gruber: test and handle empty notes gracefully
- Thomas Rast:
  - only clean up message file when editing
  - use GIT_EDITOR and core.editor over VISUAL/EDITOR
  - t3301: fix confusing quoting in test for valid notes ref
  - t3301: use test_must_fail instead of !
  - refuse to edit notes outside refs/notes/
- Junio C Hamano: tests: fix "export var=val"
- Christian Couder: documentation: fix 'linkgit' macro in "git-notes.txt"
- Johan Herland: minor cleanup and bugfixing in git-notes.sh (v2)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Tor Arne Vestbø <tavestbo@trolltech.com>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoIntroduce commit notes
Johannes Schindelin [Sat, 12 Sep 2009 16:08:35 +0000 (18:08 +0200)] 
Introduce commit notes

Commit notes are blobs which are shown together with the commit
message.  These blobs are taken from the notes ref, which you can
configure by the config variable core.notesRef, which in turn can
be overridden by the environment variable GIT_NOTES_REF.

The notes ref is a branch which contains "files" whose names are
the names of the corresponding commits (i.e. the SHA-1).

The rationale for putting this information into a ref is this: we
want to be able to fetch and possibly union-merge the notes,
maybe even look at the date when a note was introduced, and we
want to store them efficiently together with the other objects.

This patch has been improved by the following contributions:
- Thomas Rast: fix core.notesRef documentation
- Tor Arne Vestbø: fix printing of multi-line notes
- Alex Riesen: Using char array instead of char pointer costs less BSS

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Tor Arne Vestbø <tavestbo@trolltech.com>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-import: test the new option command
Sverre Rabbelier [Sun, 6 Sep 2009 14:35:48 +0000 (16:35 +0200)] 
fast-import: test the new option command

Test three options (quiet and import/export-marks) and verify that the
commandline options override these.

Also make sure that a option command without a preceeding feature
git-options command is rejected and that non-git options are ignored.

Lastly, make sure that git options that we do not recognise are
ignored as well, but that they are rejected when parsed on the
commandline.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-import: add option command
Sverre Rabbelier [Sun, 6 Sep 2009 14:35:47 +0000 (16:35 +0200)] 
fast-import: add option command

This allows the frontend to specify any of the supported options as
long as no non-option command has been given. This way the
user does not have to include any frontend-specific options, but
instead she can rely on the frontend to tell fast-import what it
needs.

Also factor out parsing of argv and have it execute when we reach the
first non-option command, or after all commands have been read and
no non-option command has been encountered.

Non-git options and unrecognised git options are ignored, although
unrecognised options on the commandline still result in an error.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-import: test the new feature command
Sverre Rabbelier [Wed, 2 Sep 2009 17:57:01 +0000 (19:57 +0200)] 
fast-import: test the new feature command

Test that an unknown feature causes fast-import to abort, and that a
known feature is accepted.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-import: add feature command
Sverre Rabbelier [Wed, 2 Sep 2009 17:57:00 +0000 (19:57 +0200)] 
fast-import: add feature command

This allows the fronted to require a specific feature to be supported
by the frontend, or abort.

Also add support for the first feature, date-format=.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-import: put marks reading in it's own function
Sverre Rabbelier [Wed, 2 Sep 2009 17:56:59 +0000 (19:56 +0200)] 
fast-import: put marks reading in it's own function

All options do nothing but set settings, with the exception of the
--input-marks option. Delay the reading of the marks file till after
all options have been parsed.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-import: put option parsing code in separate functions
Sverre Rabbelier [Wed, 2 Sep 2009 17:56:58 +0000 (19:56 +0200)] 
fast-import: put option parsing code in separate functions

Putting the options in their own functions increases readability of
the option parsing block and makes it easier to reuse the option
parsing code later on.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Wed, 12 Aug 2009 23:36:04 +0000 (16:36 -0700)] 
Merge branch 'maint'

* maint:
  push: point to 'git pull' and 'git push --force' in case of non-fast forward
  Documentation: add: <filepattern>... is optional
  Change mentions of "git programs" to "git commands"
  Documentation: merge: one <remote> is required
  help.c: give correct structure's size to memset()

14 years agoMerge branch 'maint-1.6.3' into maint
Junio C Hamano [Wed, 12 Aug 2009 23:15:55 +0000 (16:15 -0700)] 
Merge branch 'maint-1.6.3' into maint

* maint-1.6.3:
  Change mentions of "git programs" to "git commands"
  Documentation: merge: one <remote> is required
  help.c: give correct structure's size to memset()

14 years agopush: point to 'git pull' and 'git push --force' in case of non-fast forward
Matthieu Moy [Sat, 8 Aug 2009 07:51:08 +0000 (09:51 +0200)] 
push: point to 'git pull' and 'git push --force' in case of non-fast forward

'git push' failing because of non-fast forward is a very common situation,
and a beginner does not necessarily understand "fast forward" immediately.

Add a new section to the git-push documentation and refer them to it.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: add: <filepattern>... is optional
Paul Bolle [Tue, 11 Aug 2009 13:03:10 +0000 (15:03 +0200)] 
Documentation: add: <filepattern>... is optional

<filepattern>... is optional (e.g. when the --all or --update
options are used) so use square brackets in the synopsis.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoChange mentions of "git programs" to "git commands"
Ori Avtalion [Fri, 7 Aug 2009 14:24:21 +0000 (17:24 +0300)] 
Change mentions of "git programs" to "git commands"

Most of the docs and printouts refer to "commands" when discussing what
the end users call via the "git" top-level program. We should refer them
as "git programs" when we discuss the fact that the commands are
implemented as separate programs, but in other contexts, it is better to
use the term "git commands" consistently.

Signed-off-by: Ori Avtalion <ori@avtalion.name>
Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: merge: one <remote> is required
Paul Bolle [Tue, 11 Aug 2009 13:03:58 +0000 (15:03 +0200)] 
Documentation: merge: one <remote> is required

merge only requires one <remote>, so "<remote>..." should be used in the
synopsis (and not "<remote> <remote>...").

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohelp.c: give correct structure's size to memset()
Johan Herland [Tue, 11 Aug 2009 10:10:21 +0000 (12:10 +0200)] 
help.c: give correct structure's size to memset()

These two structures are of the same type, but we'd better be consistent.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoallow pull --rebase on branch yet to be born
Jeff King [Wed, 12 Aug 2009 03:27:40 +0000 (23:27 -0400)] 
allow pull --rebase on branch yet to be born

When doing a "pull --rebase", we check to make sure that the index and
working tree are clean. The index-clean check compares the index against
HEAD. The test erroneously reports dirtiness if we don't have a HEAD yet.

In such an "unborn branch" case, by definition, a non-empty index won't
be based on whatever we are pulling down from the remote, and will lose
the local change.  Just check if $GIT_DIR/index exists and error out.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Tue, 11 Aug 2009 05:23:59 +0000 (22:23 -0700)] 
Merge branch 'maint'

* maint:
  Fix typos in git-remote.txt and git-symbolic-ref.txt
  git-instaweb: fix mod_perl detection for apache2

14 years agoMerge branch 'maint-1.6.3' into maint
Junio C Hamano [Tue, 11 Aug 2009 05:23:48 +0000 (22:23 -0700)] 
Merge branch 'maint-1.6.3' into maint

* maint-1.6.3:
  Fix typos in git-remote.txt and git-symbolic-ref.txt

14 years agoMerge branch 'jk/push-quiet'
Junio C Hamano [Tue, 11 Aug 2009 05:18:21 +0000 (22:18 -0700)] 
Merge branch 'jk/push-quiet'

* jk/push-quiet:
  transport: don't show push status if --quiet is given
  transport: pass "quiet" flag to pack-objects
  push: add --quiet flag

14 years agoMerge branch 'jc/maint-merge-recursive-fix'
Junio C Hamano [Tue, 11 Aug 2009 05:17:01 +0000 (22:17 -0700)] 
Merge branch 'jc/maint-merge-recursive-fix'

* jc/maint-merge-recursive-fix:
  merge-recursive: don't segfault while handling rename clashes

14 years agoMerge branch 'zf/maint-gitweb-acname'
Junio C Hamano [Tue, 11 Aug 2009 05:16:47 +0000 (22:16 -0700)] 
Merge branch 'zf/maint-gitweb-acname'

* zf/maint-gitweb-acname:
  gitweb: parse_commit_text encoding fix

14 years agoMerge branch 'ns/am-raw-email'
Junio C Hamano [Tue, 11 Aug 2009 05:16:42 +0000 (22:16 -0700)] 
Merge branch 'ns/am-raw-email'

* ns/am-raw-email:
  git-am: print fair error message when format detection fails
  am: allow individual e-mail files as input

14 years agoMerge branch 'np/maint-limit-delta-cache'
Junio C Hamano [Tue, 11 Aug 2009 05:16:09 +0000 (22:16 -0700)] 
Merge branch 'np/maint-limit-delta-cache'

* np/maint-limit-delta-cache:
  don't let the delta cache grow unbounded in 'git repack'

14 years agoMerge branch 'jp/symlink-dirs'
Junio C Hamano [Tue, 11 Aug 2009 05:15:41 +0000 (22:15 -0700)] 
Merge branch 'jp/symlink-dirs'

* jp/symlink-dirs:
  t6035-merge-dir-to-symlink depends on SYMLINKS prerequisite
  git-checkout: be careful about untracked symlinks
  lstat_cache: guard against full match of length of 'name' parameter
  Demonstrate bugs when a directory is replaced with a symlink

14 years agoMerge branch 'mk/grep-max-depth'
Junio C Hamano [Tue, 11 Aug 2009 05:15:12 +0000 (22:15 -0700)] 
Merge branch 'mk/grep-max-depth'

* mk/grep-max-depth:
  grep: Add --max-depth option.

14 years agoMerge branch 'js/run-command-updates'
Junio C Hamano [Tue, 11 Aug 2009 05:14:57 +0000 (22:14 -0700)] 
Merge branch 'js/run-command-updates'

* js/run-command-updates:
  api-run-command.txt: describe error behavior of run_command functions
  run-command.c: squelch a "use before assignment" warning
  receive-pack: remove unnecessary run_status report
  run_command: report failure to execute the program, but optionally don't
  run_command: encode deadly signal number in the return value
  run_command: report system call errors instead of returning error codes
  run_command: return exit code as positive value
  MinGW: simplify waitpid() emulation macros

14 years agoFix typos in git-remote.txt and git-symbolic-ref.txt
Štěpán Němec [Tue, 11 Aug 2009 00:52:07 +0000 (02:52 +0200)] 
Fix typos in git-remote.txt and git-symbolic-ref.txt

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoCheck return value of ftruncate call in http.c
Jeff Lasslett [Mon, 10 Aug 2009 16:05:06 +0000 (00:05 +0800)] 
Check return value of ftruncate call in http.c

In new_http_object_request(), check ftruncate() call return value and
handle possible errors.

Signed-off-by: Jeff Lasslett <jeff.lasslett@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohttp.c: replace usage of temporary variable for urls
Tay Ray Chuan [Mon, 10 Aug 2009 15:59:55 +0000 (23:59 +0800)] 
http.c: replace usage of temporary variable for urls

Use preq->url in new_http_pack_request and freq->url in
new_http_object_request when calling curl_setopt(CURLOPT_URL), instead
of using an intermediate variable, 'url'.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohttp.c: free preq when aborting
Tay Ray Chuan [Mon, 10 Aug 2009 15:55:48 +0000 (23:55 +0800)] 
http.c: free preq when aborting

Free preq in new_http_pack_request when aborting. preq was allocated
before jumping to the 'abort' label so this is safe.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'master' of git://git.bogomips.org/git-svn
Junio C Hamano [Mon, 10 Aug 2009 20:22:33 +0000 (13:22 -0700)] 
Merge branch 'master' of git://git.bogomips.org/git-svn

* 'master' of git://git.bogomips.org/git-svn:
  git-svn: ignore leading blank lines in svn:ignore
  svn: Honor --prefix option in init without --stdlayout
  svn: Add && to t9107-git-svn-migrate.sh

14 years agogit-svn: ignore leading blank lines in svn:ignore
Michael Haggerty [Fri, 7 Aug 2009 19:21:21 +0000 (21:21 +0200)] 
git-svn: ignore leading blank lines in svn:ignore

Subversion ignores all blank lines in svn:ignore properties.  The old
git-svn code ignored blank lines everywhere except for the first line
of the svn:ignore property.  This patch makes the "git svn
show-ignore" and "git svn create-ignore" commands ignore leading blank
lines, too.

Also include leading blank lines in the test suite.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
14 years agosvn: Honor --prefix option in init without --stdlayout
Adam Brewster [Tue, 4 Aug 2009 01:40:38 +0000 (21:40 -0400)] 
svn: Honor --prefix option in init without --stdlayout

Most users who type

  git svn init file:///tmp/repo --prefix=my-svn/

would expect the root of the svn repository to be tracked by
refs/remotes/my-svn/git-svn.

Acked-by: Eric Wong <normalperson@yhbt.net>
14 years agosvn: Add && to t9107-git-svn-migrate.sh
Adam Brewster [Tue, 4 Aug 2009 01:40:37 +0000 (21:40 -0400)] 
svn: Add && to t9107-git-svn-migrate.sh

It was probably intended for the test to fail unless all of the
commands succeed.

[ew: fixed tests to actually work]

Signed-off-by: Eric Wong <normalperson@yhbt.net>
14 years agogit-instaweb: fix mod_perl detection for apache2
Mark A Rada [Sat, 8 Aug 2009 22:24:02 +0000 (18:24 -0400)] 
git-instaweb: fix mod_perl detection for apache2

The script was looking for something that matched the '^our $gitbin'
regex, which no longer exists in gitweb.cgi.

Now it looks for 'MOD_PERL', which should be on the line that checks
to see if the script is running in a mod_perl environment.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocument 'stash clear' recovery via unreachable commits
Thomas Rast [Sun, 9 Aug 2009 00:47:36 +0000 (02:47 +0200)] 
Document 'stash clear' recovery via unreachable commits

Add an example to the stash documentation that shows how to quickly
find candidate commits among the 'git fsck --unreachable' output.
Unless you have merges of branch names containing WIP, or edit your
merge messages to say WIP, there will be no false positives.

Snippet written by Björn "doener" Steinbrink and me after zepolen_
asked on IRC.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/Makefile: include config.mak
Jeff King [Sun, 9 Aug 2009 08:50:37 +0000 (04:50 -0400)] 
t/Makefile: include config.mak

This is useful if you want to specify GIT_TEST_OPTS that you
always use.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotests: allow user to specify trash directory location
Jeff King [Sun, 9 Aug 2009 08:39:45 +0000 (04:39 -0400)] 
tests: allow user to specify trash directory location

The tests generate a large amount of I/O activity creating
and destroying repositories and files. We can improve the
time it takes to run the test suite by creating trash
directories on filesystems with better performance
characteristic, even though we may not want the rest of the
git repository on those filesystems (e.g., because they are
not network connected, or because they are temporary
ramdisks).

For example, on a dual processor system:

  $ cd t && time make -j32
  real    1m51.562s
  user    0m59.260s
  sys     1m20.933s

  # /dev/shm is tmpfs
  $ cd t && time make -j32 GIT_TEST_OPTS="--root=/dev/shm"
  real    1m1.484s
  user    0m53.555s
  sys     1m5.264s

We almost halve the wall clock time, and we utilize the
dual processors much better.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotests: provide $TRASH_DIRECTORY variable
Jeff King [Sun, 9 Aug 2009 08:38:11 +0000 (04:38 -0400)] 
tests: provide $TRASH_DIRECTORY variable

Most scripts don't care about the absolute path to the trash
directory. The one exception was t4014 script, which pieced
together $TEST_DIRECTORY and $test itself to get an absolute
directory.

Instead, let's provide a $TRASH_DIRECTORY which specifies
the same thing. This keeps the $test variable internal to
test-lib.sh and paves the way for trash directories in other
locations.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotests: use "$TEST_DIRECTORY" instead of ".."
Jeff King [Sun, 9 Aug 2009 08:37:52 +0000 (04:37 -0400)] 
tests: use "$TEST_DIRECTORY" instead of ".."

The $TEST_DIRECTORY variable allows tests to find the
top-level test directory regardless of the current working
directory.

In the past, this has been used to accomodate tests which
change directories, but it is also the first step to being
able to move trash directories outside of the
$TEST_DIRECTORY hierarchy.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot0001-init: split the existence test from the permission test
Johannes Sixt [Sun, 9 Aug 2009 16:02:55 +0000 (18:02 +0200)] 
t0001-init: split the existence test from the permission test

The test for correct permissions after init created a deep directory
must be guarded by POSIXPERM. But testing that the deep dirctory exists
is good even on platforms that do not provide the POSIXPERM prerequiste.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot0001-init: fix a file name
Johannes Sixt [Sun, 9 Aug 2009 15:38:04 +0000 (17:38 +0200)] 
t0001-init: fix a file name

Without this change, grep fails because it does not find the file
instead of because it does not find the text in the file.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot6035-merge-dir-to-symlink depends on SYMLINKS prerequisite
Johannes Sixt [Sun, 9 Aug 2009 15:35:02 +0000 (17:35 +0200)] 
t6035-merge-dir-to-symlink depends on SYMLINKS prerequisite

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoapi-run-command.txt: describe error behavior of run_command functions
Johannes Sixt [Sat, 8 Aug 2009 20:44:20 +0000 (22:44 +0200)] 
api-run-command.txt: describe error behavior of run_command functions

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Sat, 8 Aug 2009 05:35:17 +0000 (22:35 -0700)] 
Merge branch 'maint'

* maint:
  verify-pack -v: do not report "chain length 0"
  t5510: harden the way verify-pack is used

14 years agoMerge branch 'maint-1.6.3' into maint
Junio C Hamano [Sat, 8 Aug 2009 03:44:26 +0000 (20:44 -0700)] 
Merge branch 'maint-1.6.3' into maint

* maint-1.6.3:
  verify-pack -v: do not report "chain length 0"
  t5510: harden the way verify-pack is used

14 years agoMerge branch 'maint-1.6.2' into maint-1.6.3
Junio C Hamano [Sat, 8 Aug 2009 03:44:15 +0000 (20:44 -0700)] 
Merge branch 'maint-1.6.2' into maint-1.6.3

* maint-1.6.2:
  verify-pack -v: do not report "chain length 0"
  t5510: harden the way verify-pack is used

14 years agoMerge branch 'maint-1.6.1' into maint-1.6.2
Junio C Hamano [Sat, 8 Aug 2009 03:44:09 +0000 (20:44 -0700)] 
Merge branch 'maint-1.6.1' into maint-1.6.2

* maint-1.6.1:
  verify-pack -v: do not report "chain length 0"
  t5510: harden the way verify-pack is used

14 years agoMerge branch 'maint-1.6.0' into maint-1.6.1
Junio C Hamano [Sat, 8 Aug 2009 03:44:02 +0000 (20:44 -0700)] 
Merge branch 'maint-1.6.0' into maint-1.6.1

* maint-1.6.0:
  verify-pack -v: do not report "chain length 0"
  t5510: harden the way verify-pack is used

14 years agoverify-pack -v: do not report "chain length 0"
Junio C Hamano [Fri, 7 Aug 2009 22:36:31 +0000 (15:36 -0700)] 
verify-pack -v: do not report "chain length 0"

When making a histogram of delta chain length in the pack, the program
collects number of objects whose delta depth exceeds the MAX_CHAIN limit
in histogram[0], and showed it as the number of items that exceeds the
limit correctly.  HOWEVER, it also showed the same number labeled as
"chain length = 0".

In fact, we are not showing the number of objects whose chain length is
zero, i.e. the base objects.  Correct this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot5510: harden the way verify-pack is used
Junio C Hamano [Sat, 8 Aug 2009 03:12:13 +0000 (20:12 -0700)] 
t5510: harden the way verify-pack is used

The test ignored the exit status from verify pack command, and also relied
on not seeing any delta chain statistics.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoShow usage string for 'git log -h', 'git show -h' and 'git diff -h'
Matthieu Moy [Thu, 6 Aug 2009 10:47:21 +0000 (12:47 +0200)] 
Show usage string for 'git log -h', 'git show -h' and 'git diff -h'

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-am: print fair error message when format detection fails
Nicolas Sebrecht [Fri, 7 Aug 2009 01:08:13 +0000 (20:08 -0500)] 
git-am: print fair error message when format detection fails

Avoid git ending with this message:
"Patch format  is not supported."

With improved error message in the format detection failure case by
Giuseppe Bilotta.

Signed-off-by: Nicolas Sebrecht <ni.s@laposte.net>
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoam: allow individual e-mail files as input
Junio C Hamano [Fri, 7 Aug 2009 01:08:12 +0000 (20:08 -0500)] 
am: allow individual e-mail files as input

We traditionally allowed a mbox file or a directory name of a maildir (but
never an individual file inside a maildir) to be given to "git am".  Even
though an individual file in a maildir (or more generally, a piece of
RFC2822 e-mail) is not a mbox file, it contains enough information to
create a commit out of it, so there is no reason to reject one.  Running
mailsplit on such a file feels stupid, but it does not hurt.

This builds on top of a5a6755 (git-am foreign patch support: introduce
patch_format, 2009-05-27) that introduced mailbox format detection.  The
codepath to deal with a mbox requires it to begin with "From " line and
also allows it to begin with "From: ", but a random piece of e-mail can
and often do begin with any valid RFC2822 header lines.

Instead of checking the first line, we extract all the lines up to the
first empty line, and make sure they look like e-mail headers.

A test is added to t4150 to demonstrate this feature.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Brandon Casey <drafnel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-ls-files.txt: clarify what "other files" mean for --other
Matthieu Moy [Thu, 6 Aug 2009 15:11:48 +0000 (17:11 +0200)] 
git-ls-files.txt: clarify what "other files" mean for --other

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-describe: Die early if there are no possible descriptions
Björn Steinbrink [Thu, 6 Aug 2009 12:15:14 +0000 (14:15 +0200)] 
git-describe: Die early if there are no possible descriptions

If we find no refs that may be used for git-describe with the current
options, then die early instead of pointlessly walking the whole
history.

In git.git with all the tags dropped, this makes "git describe" go down
from 0.244 to 0.003 seconds for me. This is especially noticeable with
"git submodule status" which calls describe with increasing levels of
allowed refs to be matched. For a submodule without tags, this means
that it walks the whole history in the submodule twice (first annotated,
then plain tags), just to find out that it can't describe the commit
anyway.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorebase: consistent error messages for staged and unstaged changes.
Matthieu Moy [Wed, 5 Aug 2009 14:56:25 +0000 (16:56 +0200)] 
rebase: consistent error messages for staged and unstaged changes.

Previous version expose the output of the plumbing update-index to the
user, which novice users have difficulty to understand.

We still need to run update-index to refresh the cache (if
diff.autorefreshindex is false, git diff won't do it).

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-tag(1): Refer to git-check-ref-format(1) for <name>
Jari Aalto [Wed, 5 Aug 2009 21:20:32 +0000 (00:20 +0300)] 
git-tag(1): Refer to git-check-ref-format(1) for <name>

Explain briefly what characters are prohibited in tag <name>
and point to git-check-ref-format(1) manual page for
further information.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-rev-list.txt: Clarify the use of multiple revision arguments
Junio C Hamano [Wed, 5 Aug 2009 16:42:33 +0000 (09:42 -0700)] 
git-rev-list.txt: Clarify the use of multiple revision arguments

If one thinks of a revision as the set of commits which can be reached
from the rev, and of ^rev as the complement, then multiple arguments to
git rev-list can be neither understood as the intersection nor the union
of the individual sets.

But set language is the natural as well as logical language in which to
phrase this. So, add a paragraph which explains multiple arguments using
set language.

Suggested-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit.el: Clarify documentation of git-commit-tree
David Kågedal [Fri, 31 Jul 2009 07:23:09 +0000 (09:23 +0200)] 
git.el: Clarify documentation of git-commit-tree

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodon't let the delta cache grow unbounded in 'git repack'
Nicolas Pitre [Wed, 5 Aug 2009 20:55:07 +0000 (16:55 -0400)] 
don't let the delta cache grow unbounded in 'git repack'

I have 4GB of RAM on my system which should, in theory, be quite enough
to repack a 600 MB repository.  However the unbounded delta cache size
always pushes it into swap, at which point everything virtually comes to
a halt.  So unbounded caches are never a good idea.

A default of 256MB should be a good compromize between memory usage and
speed where medium sized repositories are still likely to fit in the
cache with a reasonable memory usage, and larger repositories are going
to take quite some time to repack already anyway.

While at it, clarify the associated config variable documentation
entries a bit.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotransport: don't show push status if --quiet is given
Jeff King [Wed, 5 Aug 2009 20:23:26 +0000 (16:23 -0400)] 
transport: don't show push status if --quiet is given

When --quiet is given, the user generally only wants to see
errors. So let's suppress printing the ref status table
unless there is an error, in which case we print out the
whole table.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotransport: pass "quiet" flag to pack-objects
Jeff King [Wed, 5 Aug 2009 20:22:36 +0000 (16:22 -0400)] 
transport: pass "quiet" flag to pack-objects

When pushing over the git protocol, pack-objects gives
progress reports about the pack being sent. If "push" is
given the --quiet flag, it now passes "-q" to pack-objects,
suppressing this output.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agopush: add --quiet flag
Jeff King [Wed, 5 Aug 2009 20:22:19 +0000 (16:22 -0400)] 
push: add --quiet flag

Some transports produce output even without "--verbose"
turned on. This provides a way to tell them to be more
quiet (whereas simply redirecting might lose error
messages).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'sb/read-tree'
Junio C Hamano [Wed, 5 Aug 2009 19:40:07 +0000 (12:40 -0700)] 
Merge branch 'sb/read-tree'

* sb/read-tree:
  read-tree: migrate to parse-options
  read-tree: convert unhelpful usage()'s to helpful die()'s

14 years agoMerge branch 'jc/apply-epoch-patch'
Junio C Hamano [Wed, 5 Aug 2009 19:40:00 +0000 (12:40 -0700)] 
Merge branch 'jc/apply-epoch-patch'

* jc/apply-epoch-patch:
  apply: notice creation/removal patches produced by GNU diff

14 years agoMerge branch 'sb/parse-options'
Junio C Hamano [Wed, 5 Aug 2009 19:39:37 +0000 (12:39 -0700)] 
Merge branch 'sb/parse-options'

* sb/parse-options:
  prune-packed: migrate to parse-options
  verify-pack: migrate to parse-options
  verify-tag: migrate to parse-options
  write-tree: migrate to parse-options

14 years agoMerge branch 'ns/init-mkdir'
Junio C Hamano [Wed, 5 Aug 2009 19:39:33 +0000 (12:39 -0700)] 
Merge branch 'ns/init-mkdir'

* ns/init-mkdir:
  git init: optionally allow a directory argument

Conflicts:
builtin-init-db.c

14 years agoMerge branch 'mk/init-db-parse-options'
Junio C Hamano [Wed, 5 Aug 2009 19:39:06 +0000 (12:39 -0700)] 
Merge branch 'mk/init-db-parse-options'

* mk/init-db-parse-options:
  init-db: migrate to parse-options

14 years agoMerge branch 'jk/maint-show-tag'
Junio C Hamano [Wed, 5 Aug 2009 19:38:54 +0000 (12:38 -0700)] 
Merge branch 'jk/maint-show-tag'

* jk/maint-show-tag:
  show: add space between multiple items
  show: suppress extra newline when showing annotated tag

14 years agoMerge branch 'sb/maint-pull-rebase'
Junio C Hamano [Wed, 5 Aug 2009 19:38:39 +0000 (12:38 -0700)] 
Merge branch 'sb/maint-pull-rebase'

* sb/maint-pull-rebase:
  pull: support rebased upstream + fetch + pull --rebase
  t5520-pull: Test for rebased upstream + fetch + pull --rebase

14 years agoMerge branch 'ne/futz-upload-pack'
Junio C Hamano [Wed, 5 Aug 2009 19:38:29 +0000 (12:38 -0700)] 
Merge branch 'ne/futz-upload-pack'

* ne/futz-upload-pack:
  Shift object enumeration out of upload-pack

Conflicts:
upload-pack.c

14 years agoMerge branch 'maint'
Junio C Hamano [Wed, 5 Aug 2009 19:37:40 +0000 (12:37 -0700)] 
Merge branch 'maint'

* maint:
  gitweb/README: Document $base_url
  Documentation: git submodule: add missing options to synopsis
  Better usage string for reflog.
  hg-to-git: don't import the unused popen2 module
  send-email: remove debug trace
  config: Keep inner whitespace verbatim

14 years agoMerge branch 'maint-1.6.3' into maint
Junio C Hamano [Wed, 5 Aug 2009 19:37:24 +0000 (12:37 -0700)] 
Merge branch 'maint-1.6.3' into maint

* maint-1.6.3:
  Better usage string for reflog.
  hg-to-git: don't import the unused popen2 module
  send-email: remove debug trace
  config: Keep inner whitespace verbatim

14 years agogitweb: parse_commit_text encoding fix
Zoltán Füzesi [Sun, 2 Aug 2009 07:42:24 +0000 (09:42 +0200)] 
gitweb: parse_commit_text encoding fix

Call to_utf8 when parsing author and committer names, otherwise they will appear
with bad encoding if they written by using chop_and_escape_str.

Signed-off-by: Zoltán Füzesi <zfuzesi@eaglet.hu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb/README: Document $base_url
Jakub Narebski [Tue, 4 Aug 2009 15:54:32 +0000 (17:54 +0200)] 
gitweb/README: Document $base_url

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: git submodule: add missing options to synopsis
Jens Lehmann [Sat, 1 Aug 2009 18:49:47 +0000 (20:49 +0200)] 
Documentation: git submodule: add missing options to synopsis

The option --merge was missing for submodule update and --cached for
submodule summary.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-merge-base/git-show-branch --merge-base: Documentation and test
Michael J Gruber [Wed, 5 Aug 2009 07:59:20 +0000 (09:59 +0200)] 
git-merge-base/git-show-branch --merge-base: Documentation and test

Currently, the documentation suggests that 'git merge-base -a' and 'git
show-branch --merge-base' are equivalent (in fact it claims that the
former cannot handle more than two revs).

Alas, the handling of more than two revs is very different. Document
this by tests and correct the documentation to reflect this.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-merge-base/git-show-branch: Cleanup documentation and usage
Michael J Gruber [Wed, 5 Aug 2009 07:59:19 +0000 (09:59 +0200)] 
git-merge-base/git-show-branch: Cleanup documentation and usage

Make sure that usage strings and documentation coincide with each other
and with the actual code.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot6010-merge-base.sh: Depict the octopus test graph
Michael J Gruber [Wed, 5 Aug 2009 07:59:18 +0000 (09:59 +0200)] 
t6010-merge-base.sh: Depict the octopus test graph

...so that it is easier to reuse it for other tests.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoBetter usage string for reflog.
Matthieu Moy [Wed, 5 Aug 2009 15:36:28 +0000 (17:36 +0200)] 
Better usage string for reflog.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohg-to-git: don't import the unused popen2 module
Miklos Vajna [Mon, 3 Aug 2009 16:41:34 +0000 (18:41 +0200)] 
hg-to-git: don't import the unused popen2 module

Importing the popen2 module in Python-2.6 results in the
"DeprecationWarning: The popen2 module is deprecated.  Use the
subprocess module." message. The module itself isn't used in fact, so
just removing it solves the problem.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agosend-email: remove debug trace
Erik Faye-Lund [Tue, 4 Aug 2009 21:57:34 +0000 (21:57 +0000)] 
send-email: remove debug trace

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
14 years agorun-command.c: squelch a "use before assignment" warning
David Soria Parra [Tue, 4 Aug 2009 09:28:40 +0000 (11:28 +0200)] 
run-command.c: squelch a "use before assignment" warning

i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490) compiler
(and probably others) mistakenly thinks variable failed_errno is used
before assigned.  Work it around by giving it a fake initialization.

Signed-off-by: David Soria Parra <dsp@php.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb: fix 'Use of uninitialized value' error in href()
Giuseppe Bilotta [Fri, 31 Jul 2009 06:48:49 +0000 (08:48 +0200)] 
gitweb: fix 'Use of uninitialized value' error in href()

Equality between file_parent and file_name was being checked without a
preliminary check for existence of the parameters.

Fix by wrapping the equality check in appropriate if (defined ...),
rearranging the lines to prevent excessive length.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotechnical-docs: document tree-walking API
Stephen Boyd [Tue, 4 Aug 2009 04:13:21 +0000 (21:13 -0700)] 
technical-docs: document tree-walking API

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoFix typos on pt_BR/gittutorial.txt translation
André Goddard Rosa [Fri, 31 Jul 2009 16:50:50 +0000 (13:50 -0300)] 
Fix typos on pt_BR/gittutorial.txt translation

With extra fixes from Thadeu and Carlos as well.

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@holoscopio.com>
Signed-off-by: Carlos R. Mafra <crmafra2@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: git-send-email: correct statement about standard ports
Wesley J. Landaker [Fri, 31 Jul 2009 17:45:00 +0000 (11:45 -0600)] 
Documentation: git-send-email: correct statement about standard ports

The current documentation states that servers typically listen on port
465 and calls this "ssmtp". While it's true that many mail servers use
port 465 for SSL smtp, this is non-standard, and hails from the days
before smtp and submission TLS support, that arrived in RFC2487 and
RFC3207. Port 465 is actually assigned by IANA for unrelated purposes,
and is mostly still used by mail servers today only to support Outlook
Express.

In any case, this patch helps the documentation better reflect both
standards and reality, while still helpfully mentioning ports numbers
that a user may wish to specify.

Signed-off-by: Wesley J. Landaker <wjl@icecavern.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: git-send-email: fix submission port number
Wesley J. Landaker [Thu, 30 Jul 2009 23:08:53 +0000 (17:08 -0600)] 
Documentation: git-send-email: fix submission port number

The current documentation confuses non-standard SSL smtp port 465 with
submission port 587 (RFC 4406). This patch just changes the referenced
number.

Signed-off-by: Wesley J. Landaker <wjl@icecavern.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoconfig: Keep inner whitespace verbatim
Björn Steinbrink [Thu, 30 Jul 2009 11:41:57 +0000 (13:41 +0200)] 
config: Keep inner whitespace verbatim

Configuration values are expected to be quoted when they have leading or
trailing whitespace, but inner whitespace should be kept verbatim even if
the value is not quoted. This is already documented in git-config(1), but
the code caused inner whitespace to be collapsed to a single space,
breaking, for example, clones from a path that has two consecutive spaces
in it, as future fetches would only see a single space.

Reported-by: John te Bokkel <tanj.tanj@gmail.com>
Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit fast-export: add --no-data option
Geoffrey Irving [Tue, 28 Jul 2009 02:20:22 +0000 (22:20 -0400)] 
git fast-export: add --no-data option

When using git fast-export and git fast-import to rewrite the history
of a repository with large binary files, almost all of the time is
spent dealing with blobs.  This is extremely inefficient if all we want
to do is rewrite the commits and tree structure.  --no-data skips the
output of blobs and writes SHA-1s instead of marks, which provides a
massive speedup.

Signed-off-by: Geoffrey Irving <irving@naml.us>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoparse-opt: optionally show "--no-" option string
Johannes Schindelin [Mon, 27 Jul 2009 18:49:56 +0000 (20:49 +0200)] 
parse-opt: optionally show "--no-" option string

It is usually better to have positive options, to avoid confusing double
negations.  However, sometimes it is desirable to show the negative option
in the help.

Introduce the flag PARSE_OPT_NEGHELP to do that.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge-recursive: don't segfault while handling rename clashes
Junio C Hamano [Fri, 31 Jul 2009 00:38:15 +0000 (17:38 -0700)] 
merge-recursive: don't segfault while handling rename clashes

When a branch moves A to B while the other branch created B (or moved C to
B), the code tried to rename one of them to B~something to preserve both
versions, and failed to register temporary resolution for the original
path B at stage#0 during virtual ancestor computation.  This left the
index in unmerged state and caused a segfault.

A better solution is to merge these two versions of B's in place and use
the (potentially conflicting) result as the intermediate merge result in
the virtual ancestor.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-checkout: be careful about untracked symlinks
Linus Torvalds [Thu, 30 Jul 2009 03:22:25 +0000 (20:22 -0700)] 
git-checkout: be careful about untracked symlinks

This fixes the case where an untracked symlink that points at a directory
with tracked paths confuses the checkout logic, demostrated in t6035.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agolstat_cache: guard against full match of length of 'name' parameter
Kjetil Barvik [Sun, 14 Jun 2009 13:08:28 +0000 (15:08 +0200)] 
lstat_cache: guard against full match of length of 'name' parameter

longest_path_match() in symlinks.c does exactly what it's name says,
but in some cases that match can be too long, since the
has_*_leading_path() functions assumes that the match will newer be as
long as the name string given to the function.

fix this by adding an extra if test which checks if the match length
is equal to the 'len' parameter.

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