Code

git.git
13 years agoMerge branch 'sg/rerere-gc-old-still-used' into maint
Junio C Hamano [Wed, 1 Sep 2010 20:57:23 +0000 (13:57 -0700)]
Merge branch 'sg/rerere-gc-old-still-used' into maint

* sg/rerere-gc-old-still-used:
  rerere: fix overeager gc
  mingw_utime(): handle NULL times parameter

13 years agoMerge branch 'np/maint-huge-delta-generation' into maint
Junio C Hamano [Wed, 1 Sep 2010 20:56:10 +0000 (13:56 -0700)]
Merge branch 'np/maint-huge-delta-generation' into maint

* np/maint-huge-delta-generation:
  fix >4GiB source delta assertion failure

13 years agoMerge branch 'dj/fetch-tagopt' into maint
Junio C Hamano [Wed, 1 Sep 2010 20:52:10 +0000 (13:52 -0700)]
Merge branch 'dj/fetch-tagopt' into maint

* dj/fetch-tagopt:
  fetch: allow command line --tags to override config

13 years agoMerge branch 'da/fix-submodule-sync-superproject-config' into maint
Junio C Hamano [Wed, 1 Sep 2010 20:50:46 +0000 (13:50 -0700)]
Merge branch 'da/fix-submodule-sync-superproject-config' into maint

* da/fix-submodule-sync-superproject-config:
  submodule sync: Update "submodule.<name>.url"

13 years agoMerge branch 'en/rebase-against-rebase-fix' into maint
Junio C Hamano [Wed, 1 Sep 2010 20:43:55 +0000 (13:43 -0700)]
Merge branch 'en/rebase-against-rebase-fix' into maint

* en/rebase-against-rebase-fix:
  pull --rebase: Avoid spurious conflicts and reapplying unnecessary patches
  t5520-pull: Add testcases showing spurious conflicts from git pull --rebase

13 years agoinstall-webdoc: filter timestamp-only changes correctly
Junio C Hamano [Wed, 1 Sep 2010 16:25:17 +0000 (09:25 -0700)]
install-webdoc: filter timestamp-only changes correctly

The timestamp that follows "Last updated " is formatted differently
depending on the version of AsciiDoc.  Looking at 4604fe56 on "html"
branch, you can see that AsciiDoc 7.0.2 used to give "02-Jul-2008 03:02:14
UTC" but AsciiDoc 8.2.5 gave "2008-09-19 06:33:25 UTC".  We haven't been
correctly filtering out phantom changes that result from only the build
date for some time now, it seems.

Just filter lines that begin with "Last updated ".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobuiltin.h: Move two functions definitions to help.h.
Thiago Farina [Wed, 1 Sep 2010 02:29:08 +0000 (23:29 -0300)]
builtin.h: Move two functions definitions to help.h.

The two functions defined here are implemented in help.c, so makes more sense
to put the definition of those in help.h instead of in builtin.h.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'np/maint-huge-delta-generation'
Junio C Hamano [Tue, 31 Aug 2010 23:34:16 +0000 (16:34 -0700)]
Merge branch 'np/maint-huge-delta-generation'

* np/maint-huge-delta-generation:
  fix >4GiB source delta assertion failure

13 years agoMerge branch 'da/fix-submodule-sync-superproject-config'
Junio C Hamano [Tue, 31 Aug 2010 23:25:29 +0000 (16:25 -0700)]
Merge branch 'da/fix-submodule-sync-superproject-config'

* da/fix-submodule-sync-superproject-config:
  submodule sync: Update "submodule.<name>.url"

13 years agoMerge branch 'jn/cherry-revert-message-clean-up'
Junio C Hamano [Tue, 31 Aug 2010 23:25:11 +0000 (16:25 -0700)]
Merge branch 'jn/cherry-revert-message-clean-up'

* jn/cherry-revert-message-clean-up:
  tests: fix syntax error in "Use advise() for hints" test
  cherry-pick/revert: Use advise() for hints
  cherry-pick/revert: Use error() for failure message
  Introduce advise() to print hints
  Eliminate “Finished cherry-pick/revert” message
  t3508: add check_head_differs_from() helper function and use it
  revert: improve success message by adding abbreviated commit sha1
  revert: don't print "Finished one cherry-pick." if commit failed
  revert: refactor commit code into a new run_git_commit() function
  revert: report success when using option --strategy

13 years agoMerge branch 'cb/binary-patch-id'
Junio C Hamano [Tue, 31 Aug 2010 23:24:48 +0000 (16:24 -0700)]
Merge branch 'cb/binary-patch-id'

* cb/binary-patch-id:
  hash binary sha1 into patch id

13 years agoMerge branch 'ab/maint-reset-mixed-w-pathspec-advice'
Junio C Hamano [Tue, 31 Aug 2010 23:24:36 +0000 (16:24 -0700)]
Merge branch 'ab/maint-reset-mixed-w-pathspec-advice'

* ab/maint-reset-mixed-w-pathspec-advice:
  reset: suggest what to do upon "git reset --mixed <paths>"

13 years agoMerge branch 'dj/fetch-tagopt'
Junio C Hamano [Tue, 31 Aug 2010 23:24:24 +0000 (16:24 -0700)]
Merge branch 'dj/fetch-tagopt'

* dj/fetch-tagopt:
  fetch: allow command line --tags to override config

13 years agoMerge branch 'en/d-f-conflict-fix'
Junio C Hamano [Tue, 31 Aug 2010 23:23:58 +0000 (16:23 -0700)]
Merge branch 'en/d-f-conflict-fix'

* en/d-f-conflict-fix:
  merge-recursive: Avoid excessive output for and reprocessing of renames
  merge-recursive: Fix multiple file rename across D/F conflict
  t6031: Add a testcase covering multiple renames across a D/F conflict
  merge-recursive: Fix typo
  Mark tests that use symlinks as needing SYMLINKS prerequisite
  t/t6035-merge-dir-to-symlink.sh: Remove TODO on passing test
  fast-import: Improve robustness when D->F changes provided in wrong order
  fast-export: Fix output order of D/F changes
  merge_recursive: Fix renames across paths below D/F conflicts
  merge-recursive: Fix D/F conflicts
  Add a rename + D/F conflict testcase
  Add additional testcases for D/F conflicts

Conflicts:
merge-recursive.c

13 years agoMerge branch 'jn/svn-fe'
Junio C Hamano [Tue, 31 Aug 2010 23:23:38 +0000 (16:23 -0700)]
Merge branch 'jn/svn-fe'

* jn/svn-fe:
  t/t9010-svn-fe.sh: add an +x bit to this test
  t9010 (svn-fe): avoid symlinks in test
  t9010 (svn-fe): use Unix-style path in URI
  vcs-svn: Avoid %z in format string
  vcs-svn: Rename dirent pool to build on Windows
  compat: add strtok_r()
  treap: style fix
  vcs-svn: remove build artifacts on "make clean"
  svn-fe manual: Clarify warning about deltas in dump files
  Update svn-fe manual
  SVN dump parser
  Infrastructure to write revisions in fast-export format
  Add stream helper library
  Add string-specific memory pool
  Add treap implementation
  Add memory pool library
  Introduce vcs-svn lib

13 years agoMerge branch 'tr/maint-no-unquote-plus'
Junio C Hamano [Tue, 31 Aug 2010 23:23:35 +0000 (16:23 -0700)]
Merge branch 'tr/maint-no-unquote-plus'

* tr/maint-no-unquote-plus:
  Do not unquote + into ' ' in URLs

13 years agoMerge branch 'jn/paginate-fix'
Junio C Hamano [Tue, 31 Aug 2010 23:23:31 +0000 (16:23 -0700)]
Merge branch 'jn/paginate-fix'

* jn/paginate-fix:
  t7006 (pager): add missing TTY prerequisites
  merge-file: run setup_git_directory_gently() sooner
  var: run setup_git_directory_gently() sooner
  ls-remote: run setup_git_directory_gently() sooner
  index-pack: run setup_git_directory_gently() sooner
  config: run setup_git_directory_gently() sooner
  bundle: run setup_git_directory_gently() sooner
  apply: run setup_git_directory_gently() sooner
  grep: run setup_git_directory_gently() sooner
  shortlog: run setup_git_directory_gently() sooner
  git wrapper: allow setup_git_directory_gently() be called earlier
  setup: remember whether repository was found
  git wrapper: introduce startup_info struct

Conflicts:
builtin/index-pack.c

13 years agoMerge branch 'jn/maint-setup-fix'
Junio C Hamano [Tue, 31 Aug 2010 23:23:19 +0000 (16:23 -0700)]
Merge branch 'jn/maint-setup-fix'

* jn/maint-setup-fix:
  setup: split off a function to handle ordinary .git directories
  Revert "rehabilitate 'git index-pack' inside the object store"
  setup: do not forget working dir from subdir of gitdir
  t4111 (apply): refresh index before applying patches to it
  setup: split off get_device_or_die helper
  setup: split off a function to handle hitting ceiling in repo search
  setup: split off code to handle stumbling upon a repository
  setup: split off a function to checks working dir for .git file
  setup: split off $GIT_DIR-set case from setup_git_directory_gently
  tests: try git apply from subdir of toplevel
  t1501 (rev-parse): clarify

Conflicts:
builtin/index-pack.c

13 years agoMerge branch 'en/fast-export-fix'
Junio C Hamano [Tue, 31 Aug 2010 23:15:20 +0000 (16:15 -0700)]
Merge branch 'en/fast-export-fix'

* en/fast-export-fix:
  fast-export: Add a --full-tree option
  fast-export: Fix dropping of files with --import-marks and path limiting

13 years agoMerge branch 'hv/autosquash-config'
Junio C Hamano [Tue, 31 Aug 2010 23:15:03 +0000 (16:15 -0700)]
Merge branch 'hv/autosquash-config'

* hv/autosquash-config:
  add configuration variable for --autosquash option of interactive rebase

13 years agoMerge branch 'sg/rerere-gc-old-still-used'
Junio C Hamano [Tue, 31 Aug 2010 23:14:27 +0000 (16:14 -0700)]
Merge branch 'sg/rerere-gc-old-still-used'

* sg/rerere-gc-old-still-used:
  rerere: fix overeager gc
  mingw_utime(): handle NULL times parameter

13 years agotests: factor HOME=$(pwd) in test-lib.sh
Matthieu Moy [Mon, 30 Aug 2010 09:50:42 +0000 (11:50 +0200)]
tests: factor HOME=$(pwd) in test-lib.sh

The same pattern is used in many tests, and makes it easy for new ones to
rely on $HOME being a trashable, clean, directory.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest-lib: use subshell instead of cd $new && .. && cd $old
Ævar Arnfjörð Bjarmason [Mon, 30 Aug 2010 12:00:42 +0000 (12:00 +0000)]
test-lib: use subshell instead of cd $new && .. && cd $old

Change the test_create_repo code added in v1.2.2~6 to use a subshell
instead of keeping track of the old working directory and cd-ing back
when it's done.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: simplify "missing PREREQ" message
Jonathan Nieder [Tue, 24 Aug 2010 07:34:10 +0000 (02:34 -0500)]
tests: simplify "missing PREREQ" message

When a test has no prerequisites satisfied (the usual case), instead
of "missing THING of THING", just say "missing THING".  This does not
affect the output when a test is skipped due to a missing
prerequisites if another prerequisite is satisfied.

For example: instead of

 ok 8 # skip notes work (missing EXPENSIVE of EXPENSIVE)
 ok 9 # skip notes timing with /usr/bin/time (missing EXPENSIVE of USR_BIN_TIME,EXPENSIVE)

write

 ok 8 # skip notes work (missing EXPENSIVE)
 ok 9 # skip notes timing with /usr/bin/time (missing EXPENSIVE of USR_BIN_TIME,EXPENSIVE)

Cc: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot/t0000-basic.sh: Run the passing TODO test inside its own test-lib
Ævar Arnfjörð Bjarmason [Thu, 19 Aug 2010 16:08:12 +0000 (16:08 +0000)]
t/t0000-basic.sh: Run the passing TODO test inside its own test-lib

Change the passing TODO test in t0000-basic.sh to run inside its own
test-lib.sh. The motivation is to have nothing out of the ordinary on
a normal test run for test smoking purposes.

If every normal test run has a passing TODO you're more likely to turn
a blind eye to it and not to investigate cases where things really are
passing unexpectedly.

It also makes the prove(1) output less noisy. Before:

    All tests successful.

    Test Summary Report
    -------------------
    ./t0000-basic.sh                                   (Wstat: 0 Tests: 46 Failed: 0)
      TODO passed:   5
    Files=484, Tests=6229, 143 wallclock secs ( 4.00 usr  4.15 sys + 104.77 cusr 351.57 csys = 464.49 CPU)
    Result: PASS

And after:

    All tests successful.
    Files=484, Tests=6228, 139 wallclock secs ( 4.07 usr  4.25 sys + 104.54 cusr 350.85 csys = 463.71 CPU)
    Result: PASS

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest-lib: Allow overriding of TEST_DIRECTORY
Ævar Arnfjörð Bjarmason [Thu, 19 Aug 2010 16:08:11 +0000 (16:08 +0000)]
test-lib: Allow overriding of TEST_DIRECTORY

Tests that test the test-lib.sh itself need to be executed in the
dynamically created trash directory, so we can't assume
$TEST_DIRECTORY is ../ for those.

As a side benefit this change also makes it easy for us to move the
t/*.sh tests into subdirectories if we ever want to do that.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest-lib: Use "$GIT_BUILD_DIR" instead of "$TEST_DIRECTORY"/../
Ævar Arnfjörð Bjarmason [Thu, 19 Aug 2010 16:08:10 +0000 (16:08 +0000)]
test-lib: Use "$GIT_BUILD_DIR" instead of "$TEST_DIRECTORY"/../

Change code that used $TEST_DIRECTORY/.. to use $GIT_BUILD_DIR
instead, the two are equivalent, but the latter is easier to read.

This required moving the assignment od GIT_BUILD_DIR to earlier in the
test-lib.sh file.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest-lib: Use $TEST_DIRECTORY or $GIT_BUILD_DIR instead of $(pwd) and ../
Ævar Arnfjörð Bjarmason [Thu, 19 Aug 2010 16:08:09 +0000 (16:08 +0000)]
test-lib: Use $TEST_DIRECTORY or $GIT_BUILD_DIR instead of $(pwd) and ../

Change the redundant calls to $(pwd) to use $TEST_DIRECTORY
instead. None of these were being executed after we cd'd somewhere
else so they weren't actually needed.

This also makes it easier to add support for overriding the test
library location and run tests in a different directory than t/.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest: Introduce $GIT_BUILD_DIR
Thomas Rast [Sun, 25 Jul 2010 14:55:46 +0000 (16:55 +0200)]
test: Introduce $GIT_BUILD_DIR

Introduce a new variable $GIT_BUILD_DIR which can be used to locate
data that resides under the build directory, and use that instead.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: make test_might_fail fail on missing commands
Jonathan Nieder [Tue, 31 Aug 2010 17:26:57 +0000 (12:26 -0500)]
tests: make test_might_fail fail on missing commands

Detect and report hard-to-notice spelling mistakes like

 test_might_fail "git config --unset whatever"

(the extra quotes prevent the shell from running git as intended;
instead, the shell looks for a "git config --unset whatever" file).

Cc: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: make test_might_fail more verbose
Jonathan Nieder [Tue, 31 Aug 2010 17:10:55 +0000 (12:10 -0500)]
tests: make test_might_fail more verbose

Let test_might_fail say something about its failures for consistency
with test_must_fail.

Cc: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agonotes: Don't create (empty) commit when removing non-existing notes
Johan Herland [Tue, 31 Aug 2010 15:56:50 +0000 (17:56 +0200)]
notes: Don't create (empty) commit when removing non-existing notes

Extend remove_note() in the notes API to return whether or not a note was
actually removed. Use this in 'git notes remove' to skip the creation of
a notes commit when no notes were actually removed.

Also add a test illustrating the change in behavior.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoExtend documentation of core.askpass and GIT_ASKPASS.
Knut Franke [Mon, 30 Aug 2010 13:40:29 +0000 (15:40 +0200)]
Extend documentation of core.askpass and GIT_ASKPASS.

Signed-off-by: Knut Franke <k.franke@science-computing.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAllow core.askpass to override SSH_ASKPASS.
Knut Franke [Mon, 30 Aug 2010 13:39:38 +0000 (15:39 +0200)]
Allow core.askpass to override SSH_ASKPASS.

Modify handling of the 'core.askpass' option so that it has the same effect as
GIT_ASKPASS also if SSH_ASKPASS is set.

Signed-off-by: Knut Franke <k.franke@science-computing.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoAdd a new option 'core.askpass'.
Anselm Kruis [Mon, 30 Aug 2010 13:38:38 +0000 (15:38 +0200)]
Add a new option 'core.askpass'.

Setting this option has the same effect as setting the environment variable
'GIT_ASKPASS'.

Signed-off-by: Knut Franke <k.franke@science-computing.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: make test_must_fail fail on missing commands
Jeff King [Tue, 31 Aug 2010 15:56:53 +0000 (11:56 -0400)]
tests: make test_must_fail fail on missing commands

The point of it is to run a command that produces failure. A
missing command is more likely an error in the test script
(e.g., using 'test_must_fail "command with arguments"', or
relying on a missing command).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: make test_must_fail more verbose
Jeff King [Tue, 31 Aug 2010 15:56:36 +0000 (11:56 -0400)]
tests: make test_must_fail more verbose

Because test_must_fail fails when a command succeeds, the
command frequently does not produce any output (since, after
all, it thought it was succeeding). So let's have
test_must_fail itself report that a problem occurred.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogitweb: Don't die_error in git_tag after already printing headers
Anders Kaseorg [Fri, 27 Aug 2010 17:38:16 +0000 (13:38 -0400)]
gitweb: Don't die_error in git_tag after already printing headers

This fixes an XML error when visiting a nonexistent tag
(i.e. "../gitweb.cgi?p=git.git;a=tag;h=refs/tags/BADNAME").

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3903: fix broken test_must_fail calls
Jon Seymour [Tue, 31 Aug 2010 14:49:20 +0000 (00:49 +1000)]
t3903: fix broken test_must_fail calls

Some tests in detached-stash are calling test_must_fail
in such a way that the arguments to test_must_fail do, indeed, fail
but not in the manner expected by the test.

This patch removes the unnecessary and unhelpful double quotes.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot1503: fix broken test_must_fail calls
Jon Seymour [Tue, 31 Aug 2010 14:49:19 +0000 (00:49 +1000)]
t1503: fix broken test_must_fail calls

Some tests in maint-reflog-beyond-horizon are calling test_must_fail
in such a way that the arguments to test_must_fail do, indeed, fail
but not in the manner expected by the test.

This patch removes the unnecessary and unhelpful double quotes.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocheckout: Use submodule.*.ignore settings from .git/config and .gitmodules
Jens Lehmann [Sat, 28 Aug 2010 14:50:07 +0000 (16:50 +0200)]
checkout: Use submodule.*.ignore settings from .git/config and .gitmodules

For "git status" and the diff family the submodule.*.ignore settings from
.git/config and .gitmodules can be used to override the default set via
diff.ignoreSubmodules on a per-submodule basis. Let's do this consistently
and teach checkout to use these settings too.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocheckout: Add test for diff.ignoreSubmodules
Jens Lehmann [Sat, 28 Aug 2010 14:49:25 +0000 (16:49 +0200)]
checkout: Add test for diff.ignoreSubmodules

While at it, document that checkout uses this flag too in the Documentation.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Mon, 30 Aug 2010 06:37:02 +0000 (23:37 -0700)]
Merge branch 'maint'

* maint:
  t0003: add missing && at end of lines

13 years agoMerge branch 'maint-1.7.1' into maint
Junio C Hamano [Mon, 30 Aug 2010 06:36:57 +0000 (23:36 -0700)]
Merge branch 'maint-1.7.1' into maint

* maint-1.7.1:
  t0003: add missing && at end of lines

13 years agoobject.h: Add OBJECT_ARRAY_INIT macro and make use of it.
Thiago Farina [Sun, 29 Aug 2010 02:04:17 +0000 (23:04 -0300)]
object.h: Add OBJECT_ARRAY_INIT macro and make use of it.

Signed-off-by: Thiago Farina <tfransosi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot0003: add missing && at end of lines
Matthieu Moy [Sat, 28 Aug 2010 18:18:36 +0000 (20:18 +0200)]
t0003: add missing && at end of lines

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofilter-branch: retire --remap-to-ancestor
Csaba Henk [Fri, 27 Aug 2010 20:44:56 +0000 (20:44 +0000)]
filter-branch: retire --remap-to-ancestor

We can be clever and know by ourselves when we need the behavior
implied by "--remap-to-ancestor". No need to encumber users by having
them exposed to it as a tunable. (Option kept for backward compatibility,
but it's now a no-op.)

Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobundle: detect if bundle file cannot be created
Csaba Henk [Fri, 27 Aug 2010 20:31:47 +0000 (20:31 +0000)]
bundle: detect if bundle file cannot be created

bundle command silently died with no sign of failure if it
could not create the bundle file. (Eg.: its path resovles to a directory,
or the parent dir is sticky while file already exists and is owned
by someone else.)

Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Thu, 26 Aug 2010 23:42:59 +0000 (16:42 -0700)]
Merge branch 'maint'

* maint:
  for-each-ref: fix objectname:short bug
  tree-walk: Correct bitrotted comment about tree_entry()
  Fix 'git log' early pager startup error case

13 years agofor-each-ref: fix objectname:short bug
Jay Soffian [Thu, 26 Aug 2010 21:34:29 +0000 (17:34 -0400)]
for-each-ref: fix objectname:short bug

When objectname:short was introduced, it forgot to copy the result of
find_unique_abbrev. Because the result of find_unique_abbrev is a
pointer to static buffer, this resulted in the same value being
substituted in for each ref.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoFix compat/regex ANSIfication on MinGW
Johannes Sixt [Thu, 26 Aug 2010 07:58:26 +0000 (09:58 +0200)]
Fix compat/regex ANSIfication on MinGW

compat/regexec.c had a weird combination of function declaration in ANSI
style and function definition in K&R style, for example:

 static unsigned
 re_copy_regs (struct re_registers *regs, regmatch_t *pmatch,
      int nregs, int regs_allocated) internal_function;

 static unsigned
 re_copy_regs (regs, pmatch, nregs, regs_allocated)
     struct re_registers *regs;
     regmatch_t *pmatch;
     int nregs, regs_allocated;
 { ... }

with this #define:

 #ifndef _LIBC
 # ifdef __i386__
 #  define internal_function   __attribute ((regparm (3), stdcall))
 # else
 #  define internal_function
 # endif
 #endif

The original version as shown above was fine, but with the ANSIfied
function definition and in the case where internal_function is not empty,
gcc identifies the declaration and definition as different and bails out.

Adding internal_function to the definition doesn't help (it results in
a syntax error); hence, remove it from the subset of declarations that gcc
flags as erroneous.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotree-walk: Correct bitrotted comment about tree_entry()
Elijah Newren [Wed, 25 Aug 2010 02:53:11 +0000 (20:53 -0600)]
tree-walk: Correct bitrotted comment about tree_entry()

There was a code comment that referred to the "above two functions" but
over time the functions immediately preceding the comment have changed.
Just mention the relevant functions by name.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agobuiltin/fetch.c: ignore merge config when not fetching from branch's remote
Brandon Casey [Wed, 25 Aug 2010 17:52:56 +0000 (12:52 -0500)]
builtin/fetch.c: ignore merge config when not fetching from branch's remote

When 'git fetch' is supplied a single argument, it tries to match it
against a configured remote and then fetch the refs specified by the
named remote's fetchspec.  Additionally, or alternatively, if the current
branch has a merge ref configured, and if the name of the remote supplied
to fetch matches the one in the branch's configuration, then git also adds
the merge ref to the list of refs to update.

If the argument to fetch does not specify a named remote, or if the name
supplied does not match the remote configured for the current branch, then
the current branch's merge configuration should not be considered.

git currently mishandles the case when the argument to fetch specifies a
GIT URL(i.e. not a named remote) and the current branch has a configured
merge ref.  In this case, fetch should ignore the branch's merge ref and
attempt to fetch from the remote repository's HEAD branch.  But, since
fetch only checks _whether_ the current branch has a merge ref configured,
and does _not_ check whether the branch's configured remote matches the
command line argument (until later), it will mistakenly enter the wrong
branch of an 'if' statement and will not fall back to fetch the HEAD branch.
The fetch ends up doing nothing and returns with a successful zero status.

Fix this by comparing the remote repository's name to the branch's remote
name, in addition to whether it has a configured merge ref, sooner, so that
fetch can correctly decide whether the branch's configuration is interesting
or not, and fall back to fetching from the remote's HEAD branch when
appropriate.

This fixes the test in t5510.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot/t5510: demonstrate failure to fetch when current branch has merge ref
Brandon Casey [Wed, 25 Aug 2010 17:52:55 +0000 (12:52 -0500)]
t/t5510: demonstrate failure to fetch when current branch has merge ref

When 'git fetch' is supplied just a repository URL (not a remote name),
and without a fetch refspec, it should fetch from the remote HEAD branch
and update FETCH_HEAD with the fetched ref.  Currently, when 'git fetch'
is called like this, it fails to retrieve anything, and does not update
FETCH_HEAD, if the current checked-out branch has a configured merge ref.

i.e. this fetch fails to retrieve anything nor update FETCH_HEAD:

   git checkout master
   git config branch.master.merge refs/heads/master
   git fetch git://git.kernel.org/pub/scm/git/git.git

but this one does:

   git config --unset branch.master.merge
   git fetch git://git.kernel.org/pub/scm/git/git.git

Add a test to demonstrate this flaw.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocheckout: respect diff.ignoreSubmodules setting
Johannes Schindelin [Wed, 25 Aug 2010 10:34:57 +0000 (12:34 +0200)]
checkout: respect diff.ignoreSubmodules setting

When 'git checkout' reports uncommitted changes, it also does so for
submodules.

The default mode is now to look really hard into submodules, not only
for different commits, but also for modified files. Since this can be
pretty expensive when there are a lot (and large) submodules, there is
the diff.ignoreSubmodules option.

Let's respect that setting when 'git checkout' reports the uncommitted
changes, since it does nothing else than a 'git diff --name-status'.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoFix 'git log' early pager startup error case
Linus Torvalds [Tue, 24 Aug 2010 17:33:59 +0000 (10:33 -0700)]
Fix 'git log' early pager startup error case

We start the pager too early for several git commands, which results in
the errors sometimes going to the pager rather than show up as errors.

This is often hidden by the fact that we pass in '-X' to less by default,
which causes 'less' to exit for small output, but if you do

  export LESS=-S

you can then clearly see the problem by doing

  git log --prretty

which shows the error message ("fatal: unrecognized argument: --prretty")
being sent to the pager.

This happens for pretty much all git commands that use USE_PAGER, and then
check arguments separately. But "git diff" does it too early too (even
though it does an explicit setup_pager() call)

This only fixes it for the trivial "git log" family case.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Tue, 24 Aug 2010 18:02:04 +0000 (11:02 -0700)]
Merge branch 'maint'

* maint:
  parse-options: clarify PARSE_OPT_NOARG description
  t3302 (notes): Port to Solaris

13 years agorev-parse: tests git rev-parse --verify master@{n}, for various n
Jon Seymour [Tue, 24 Aug 2010 04:52:44 +0000 (14:52 +1000)]
rev-parse: tests git rev-parse --verify master@{n}, for various n

This commit introduces tests that verify that rev-parse
parses master@{n} correctly for various values of n less
than, equal to and greater than the number of revisions
in the reference log.

In particular, these tests check that rev-parse exits with a
non-zero status code and prints a message of the
following form to stderr.

    fatal: Log for [^ ]* only has [0-9][0-9]* entries.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosha1_name.c: use warning in preference to fprintf(stderr
Jon Seymour [Tue, 24 Aug 2010 04:52:43 +0000 (14:52 +1000)]
sha1_name.c: use warning in preference to fprintf(stderr

This commit changes sha1_name.c to use warning instead of
fprintf(stderr).

Trailing newlines from message formats have been removed
since warning adds one itself.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorev-parse: exit with non-zero status if ref@{n} is not valid.
Jon Seymour [Tue, 24 Aug 2010 04:52:42 +0000 (14:52 +1000)]
rev-parse: exit with non-zero status if ref@{n} is not valid.

"The current behaviour of ref@{...} syntax parser is suboptimal:

    $ git rev-parse --verify jch@{99999} && echo true
    warning: Log for 'jch' only has 1368 entries.
    cfb88e9a8d4926b0011ae2dd67e1f57a98f4b768
    true

It even knows that it is running off the cut-off point; it should just
cause the caller to notice that fact.  I don't think changing it to error
out should cause any harm to existing callers."

With this change:

   $ git rev-parse --verify jch@{99999} || echo false
   fatal: Log for 'jch' only has 1368 entries.
   false

   $ git rev-parse jch@{99999} || echo false
   fatal: Log for 'jch' only has 1368 entries.
   false

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoparse-options: clarify PARSE_OPT_NOARG description
Jonathan Nieder [Sun, 22 Aug 2010 16:26:38 +0000 (21:56 +0530)]
parse-options: clarify PARSE_OPT_NOARG description

Here "takes no argument" means "does not take an argument".  The
latter phrasing might make it clearer that PARSE_OPT_NOARG does not
make an option with an argument that can optionally be left off.

Noticed-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3302 (notes): Port to Solaris
Jonathan Nieder [Tue, 24 Aug 2010 07:14:53 +0000 (02:14 -0500)]
t3302 (notes): Port to Solaris

The time_notes script, which uses POSIX shell features, is
currently sometimes run with a non-POSIX /bin/sh.

Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot7606: Avoid using head as a file name
Brian Gernhardt [Mon, 23 Aug 2010 20:15:47 +0000 (16:15 -0400)]
t7606: Avoid using head as a file name

A file named 'head' gets confused with the HEAD ref on
case-insensitive file systems.  Replace '>head' with '>head.new' to
match the '>head.old' files they are compared to.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodo not pass "git -c foo=bar" params to transport helpers
Jonathan Nieder [Tue, 24 Aug 2010 06:41:14 +0000 (01:41 -0500)]
do not pass "git -c foo=bar" params to transport helpers

Like $GIT_CONFIG, $GIT_CONFIG_PARAMETERS needs to be suppressed by
"git push" and its cousins when running local transport helpers to
imitate remote transport well.

Noticed-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agopass "git -c foo=bar" params through environment
Jeff King [Mon, 23 Aug 2010 19:16:00 +0000 (15:16 -0400)]
pass "git -c foo=bar" params through environment

Git uses the "-c foo=bar" parameters to set a config
variable for a single git invocation. We currently do this
by making a list in the current process and consulting that
list in git_config.

This works fine for built-ins, but the config changes are
silently ignored by subprocesses, including dashed externals
and invocations to "git config" from shell scripts.

This patch instead puts them in an environment variable
which we consult when looking at config (both internally and
via calls "git config").

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoWork around em-dash handling in newer AsciiDoc
Junio C Hamano [Mon, 23 Aug 2010 21:20:25 +0000 (14:20 -0700)]
Work around em-dash handling in newer AsciiDoc

Older versions of AsciiDoc used to literally pass double dashes when we
used them in our linkgit macros and manpage titles, but newer ones (the
issue was first reported with AsciiDoc 8.5.2) turn them into em dashes.

Define litdd (literal double-dash) custom attribute in asciidoc.conf to
work this around.  While we are at it, fix a few double-dashes (e.g. the
description of "project--devo--version" convention used by tla, among
other things) that used to be incorrectly written as em dashes in the body
text to also use this attribute.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot7610: cd inside subshell instead of around
Brian Gernhardt [Tue, 24 Aug 2010 02:37:24 +0000 (22:37 -0400)]
t7610: cd inside subshell instead of around

Instead of using `cd dir && (...) && cd..` use `(cd dir && ...)`

This ensures that the test doesn't get caught in the subdirectory if
there is an error in the subshell.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoclone: warn users --depth is ignored in local clones
Nguyễn Thái Ngọc Duy [Mon, 23 Aug 2010 12:08:22 +0000 (22:08 +1000)]
clone: warn users --depth is ignored in local clones

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-bundle.txt: Clarify rev-list-args restrictions
Michael J Gruber [Mon, 23 Aug 2010 09:02:39 +0000 (11:02 +0200)]
git-bundle.txt: Clarify rev-list-args restrictions

Currently, one could think that 'git bundle create' groks
any 'git rev-list' expression. But in fact it requires a named reference
to be present. Try and make this clearer.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-bundle.txt: whitespace cleanup
Michael J Gruber [Mon, 23 Aug 2010 09:02:38 +0000 (11:02 +0200)]
git-bundle.txt: whitespace cleanup

Use tabs, not 7 spaces.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-bundle.txt: Cleanup
Michael J Gruber [Mon, 23 Aug 2010 09:02:37 +0000 (11:02 +0200)]
git-bundle.txt: Cleanup

Cleanup various spellings of the same argument, as well as the code
for the tilde: Since neither '~' nor '\~' work consistently, use
'{tilde}'.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Acked-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Mon, 23 Aug 2010 03:18:37 +0000 (20:18 -0700)]
Merge branch 'maint'

* maint:
  Typos in code comments, an error message, documentation

13 years agoTypos in code comments, an error message, documentation
Ralf Wildenhues [Sun, 22 Aug 2010 11:12:12 +0000 (13:12 +0200)]
Typos in code comments, an error message, documentation

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoTypos in code comments, an error message, documentation
Ralf Wildenhues [Sun, 22 Aug 2010 11:12:12 +0000 (13:12 +0200)]
Typos in code comments, an error message, documentation

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoautoconf: regex library detection typofix
Junio C Hamano [Sun, 22 Aug 2010 16:44:45 +0000 (09:44 -0700)]
autoconf: regex library detection typofix

13 years agofix >4GiB source delta assertion failure
Nicolas Pitre [Sat, 21 Aug 2010 05:00:13 +0000 (01:00 -0400)]
fix >4GiB source delta assertion failure

When people try insane things such as delta-compressing 4GiB files, they
get this assertion:

diff-delta.c:285: create_delta_index: Assertion `packed_entry - (struct index_entry *)mem == entries' failed.

This happens because:

1) the 'entries' variable is an unsigned int

2) it is assigned with entries = (bufsize - 1) / RABIN_WINDOW
   (that itself is not a problem unless bufsize > 4G * RABIN_WINDOW)

3) the buffer is indexed from top to bottom starting at
   "data = buffer + entries * RABIN_WINDOW" and the multiplication
   here does indeed overflows, making the resulting top of the buffer
   much lower than expected.

This makes the number of actually produced index entries smaller than
what was computed initially, hence the assertion.

Furthermore, the current delta encoding format cannot represent offsets
into a reference buffer with more than 32 bits anyway.  So let's just
limit the number of entries to what the delta format can encode.

Reported-by: Ilari Liusvaara <ilari.liusvaara@elisanet.fi>
Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodetached-stash: update Documentation
Jon Seymour [Sat, 21 Aug 2010 04:09:04 +0000 (14:09 +1000)]
detached-stash: update Documentation

Update the documentation to indicate that git stash branch only attempts
to drop the specified stash if it looks like stash reference.

Also changed the synopsis to more clearly indicate which commands require
a stash entry reference as opposed to merely a stash-like commit.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodetached-stash: tests of git stash with stash-like arguments
Jon Seymour [Sat, 21 Aug 2010 04:09:03 +0000 (14:09 +1000)]
detached-stash: tests of git stash with stash-like arguments

Adds new tests which check that:
* git stash branch handles a stash-like argument when there is a stash stack
* git stash branch handles a stash-like argument when there is not a stash stack
* git stash show handles a stash-like argument when there is a stash stack
* git stash show handles a stash-like argument when there is not a stash stack
* git stash drop fails early if the specified argument is not a stash reference
* git stash pop fails early if the specified argument is not a stash reference
* git stash * fails early if the reference supplied is bogus
* git stash fails early with stash@{n} where n >= length of stash log

Helped-by: Johannes Sixt
Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodetached-stash: simplify git stash show
Jon Seymour [Sat, 21 Aug 2010 04:09:02 +0000 (14:09 +1000)]
detached-stash: simplify git stash show

This commit refactors git stash show to make use of the assert_stash_like function.

git show now dies if the presented argument is non-stash-like.

Previous behaviour was to tolerate commits that were not even stash-like.

Previously, git stash show would accept stash-like arguments, but
only if there was a stash on the stack.

Now, git stash accepts stash-like arguments always and only fails
if no stash-like argument is specified and there is no stash stack.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodetached-stash: simplify git stash branch
Jon Seymour [Sat, 21 Aug 2010 04:09:01 +0000 (14:09 +1000)]
detached-stash: simplify git stash branch

This patch teaches git stash branch to tolerate stash-like arguments.

In particular, a stash is only required if an argument isn't specified
and the stash is only dropped if a stash entry reference was
specified or implied.

The implementation has been simplified by taking advantage of
assert_stash_like() and the variables established by
parse_flags_and_rev().

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodetached-stash: refactor git stash pop implementation
Jon Seymour [Sat, 21 Aug 2010 04:09:00 +0000 (14:09 +1000)]
detached-stash: refactor git stash pop implementation

git stash pop is abstracted into its own implementation function - pop_stash.

The behaviour is changed so that git stash pop fails early if the
the specified stash reference does not exist or does not refer to
an extant entry in the reflog of the reference stash.

This fixes the case where the apply succeeds, but the drop fails.
Previously this caused caused git stash pop to exit with a non-zero exit code
and a dirty tree.

Now, git stash pop fails with a non-zero exit code, but the working
tree is not modified.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodetached-stash: simplify stash_drop
Jon Seymour [Sat, 21 Aug 2010 04:08:59 +0000 (14:08 +1000)]
detached-stash: simplify stash_drop

Previously, git stash drop would fail noisily while executing git reflog
delete if the specified revision was not a stash reference.

Now, git stash drop fails with an error message which more precisely
indicates the reason for failure.

Furthermore, git stash drop will now fail with a non-zero status code
if stash@{n} specifies a stash log entry that does not actually exist.

This change in behaviour is achieved by delegating argument parsing
to the common parse_flags_and_rev() function (via a call to
assert_stash_ref).

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodetached-stash: simplify stash_apply
Jon Seymour [Sat, 21 Aug 2010 04:08:58 +0000 (14:08 +1000)]
detached-stash: simplify stash_apply

The implementation of stash_apply() is simplified to take
advantage of the common parsing function parse_flags_and_rev().

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodetached-stash: work around git rev-parse failure to detect bad log refs
Jon Seymour [Sat, 21 Aug 2010 04:48:05 +0000 (14:48 +1000)]
detached-stash: work around git rev-parse failure to detect bad log refs

This commit is required because git rev-parse in 1.7.2 does not correctly
indicate invalid log references using a non-zero status code.

We use a proxy for the condition (non-empty error output) as
a substitute. This commit can be reverted when, and if, rev-parse
is fixed to indicate invalid log references with a status code.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodetached-stash: introduce parse_flags_and_revs function
Jon Seymour [Sat, 21 Aug 2010 04:46:22 +0000 (14:46 +1000)]
detached-stash: introduce parse_flags_and_revs function

Introduce parse_flags_and_revs. This function requires that
there is at most one stash-like revision parameter and
zero or more flags.

It knows how to parse -q,--quiet and --index flags, but leaves
other flags parsed.

Specified revisions are checked to see that they are at
least stash-like (meaning: they look like something created
by git stash save or git stash create).

If this is so, then IS_STASH_LIKE is initialized to a non-empty value.

If the specified revision also looks like a stash log entry reference,
then IS_STASH_REF is initialized to a non-empty value.

References of the form ref@{spec} are required to precisely identify
an individual commit.

If no reference is specified, stash@{0} is assumed.

Once the specified reference is validated to be at least stash_like
an ensemble of derived variables, (w_commit, w_tree, b_commit, etc)
is initialized with a single call to git rev-parse.

Repeated calls to parse_flags_and_rev() avoid repeated calls
to git rev-parse if the specified arguments have already been
parsed.

Subsequent patches in the series modify the existing
git stash subcommands to make use of these functions
as appropriate.

An ensemble of supporting functions that make use of the state
established by parse_flags_and_rev(). These are described below:

The ancillary functions are:

is_stash_like(): which can be used to test
whether a specified commit looks like a commit created with
git stash save or git stash create.

assert_stash_like(): which can be used by
commands that misbehave unless their arguments stash-like.

is_stash_ref(): which checks whether an argument
is valid stash reference(e.g. is of the form
['refs/']stash['@{'something'}])

assert_stash_ref(): which can be used by commands
that misbehave unless their arguments are both stash-like and
refer to valid stash entries.

Signed-off-by: Jon Seymour <jon.seymour@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'mm/rebase-i-exec'
Junio C Hamano [Sun, 22 Aug 2010 06:29:11 +0000 (23:29 -0700)]
Merge branch 'mm/rebase-i-exec'

* mm/rebase-i-exec:
  git-rebase--interactive.sh: use printf instead of echo to print commit message
  git-rebase--interactive.sh: rework skip_unnecessary_picks
  test-lib: user-friendly alternatives to test [-d|-f|-e]
  rebase -i: add exec command to launch a shell command

Conflicts:
git-rebase--interactive.sh
t/t3404-rebase-interactive.sh

13 years agoMerge branch 'gb/split-cmdline-errmsg'
Junio C Hamano [Sun, 22 Aug 2010 06:28:55 +0000 (23:28 -0700)]
Merge branch 'gb/split-cmdline-errmsg'

* gb/split-cmdline-errmsg:
  split_cmdline: Allow caller to access error string

13 years agoMerge branch 'so/http-user-agent'
Junio C Hamano [Sun, 22 Aug 2010 06:28:38 +0000 (23:28 -0700)]
Merge branch 'so/http-user-agent'

* so/http-user-agent:
  Allow HTTP user agent string to be modified.

13 years agoMerge branch 'mm/shortopt-detached'
Junio C Hamano [Sun, 22 Aug 2010 06:28:31 +0000 (23:28 -0700)]
Merge branch 'mm/shortopt-detached'

* mm/shortopt-detached:
  log: parse separate option for --glob
  log: parse separate options like git log --grep foo
  diff: parse separate options --stat-width n, --stat-name-width n
  diff: split off a function for --stat-* option parsing
  diff: parse separate options like -S foo

Conflicts:
revision.c

13 years agoMerge branch 'sr/local-config'
Junio C Hamano [Sun, 22 Aug 2010 06:28:09 +0000 (23:28 -0700)]
Merge branch 'sr/local-config'

* sr/local-config:
  config: add --local option

13 years agoMerge branch 'nd/fix-sparse-checkout'
Junio C Hamano [Sun, 22 Aug 2010 06:28:05 +0000 (23:28 -0700)]
Merge branch 'nd/fix-sparse-checkout'

* nd/fix-sparse-checkout:
  unpack-trees: mark new entries skip-worktree appropriately
  unpack-trees: do not check for conflict entries too early
  unpack-trees: let read-tree -u remove index entries outside sparse area
  unpack-trees: only clear CE_UPDATE|CE_REMOVE when skip-worktree is always set
  t1011 (sparse checkout): style nitpicks

13 years agoMerge branch 'hv/submodule-find-ff-merge'
Junio C Hamano [Sun, 22 Aug 2010 06:27:59 +0000 (23:27 -0700)]
Merge branch 'hv/submodule-find-ff-merge'

* hv/submodule-find-ff-merge:
  Implement automatic fast-forward merge for submodules
  setup_revisions(): Allow walking history in a submodule
  Teach ref iteration module about submodules

Conflicts:
submodule.c

13 years agoMerge branch 'en/rebase-against-rebase-fix'
Junio C Hamano [Sun, 22 Aug 2010 06:27:29 +0000 (23:27 -0700)]
Merge branch 'en/rebase-against-rebase-fix'

* en/rebase-against-rebase-fix:
  pull --rebase: Avoid spurious conflicts and reapplying unnecessary patches
  t5520-pull: Add testcases showing spurious conflicts from git pull --rebase

13 years agoMerge branch 'dg/local-mod-error-messages'
Junio C Hamano [Sun, 22 Aug 2010 06:26:46 +0000 (23:26 -0700)]
Merge branch 'dg/local-mod-error-messages'

* dg/local-mod-error-messages:
  t7609: test merge and checkout error messages
  unpack_trees: group error messages by type
  merge-recursive: distinguish "removed" and "overwritten" messages
  merge-recursive: porcelain messages for checkout
  Turn unpack_trees_options.msgs into an array + enum

Conflicts:
t/t3400-rebase.sh

13 years agoMerge branch 'po/userdiff-csharp'
Junio C Hamano [Sun, 22 Aug 2010 06:20:51 +0000 (23:20 -0700)]
Merge branch 'po/userdiff-csharp'

* po/userdiff-csharp:
  Userdiff patterns for C#

13 years agoMerge branch 'ab/perl-install'
Junio C Hamano [Sun, 22 Aug 2010 06:20:31 +0000 (23:20 -0700)]
Merge branch 'ab/perl-install'

* ab/perl-install:
  perl/Makefile: Unset INSTALL_BASE when making perl.mak

13 years agoreset: suggest what to do upon "git reset --mixed <paths>"
Ævar Arnfjörð Bjarmason [Sun, 15 Aug 2010 08:43:20 +0000 (08:43 +0000)]
reset: suggest what to do upon "git reset --mixed <paths>"

When you call "git reset --mixed <paths>" git will warn that using mixed
with paths is deprecated:

    warning: --mixed option is deprecated with paths.

That doesn't tell the user what he should use instead. Expand on the
warning and tell the user to just omit --mixed:

    warning: --mixed with paths is deprecated; use 'git reset -- <paths>' instead

The exact wording of the warning was suggested by Jonathan Nieder.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint'
Junio C Hamano [Sun, 22 Aug 2010 06:16:32 +0000 (23:16 -0700)]
Merge branch 'maint'

* maint:
  t7403: add missing &&'s
  Tell ignore file about generate files in /gitweb/static

13 years agoapply: handle traditional patches with space in filename
Jonathan Nieder [Thu, 19 Aug 2010 01:50:14 +0000 (20:50 -0500)]
apply: handle traditional patches with space in filename

To discover filenames from the --- and +++ lines in a traditional
unified diff, currently "git apply" scans forward for a whitespace
character on each line and stops there.  It can't use the whole line
because "diff -u" likes to include timestamps, like so:

 --- foo 2000-07-12 16:56:50.020000414 -0500
 +++ bar 2010-07-12 16:56:50.020000414 -0500

The whitespace-seeking heuristic works great, even when the tab
has been converted to spaces by some email + copy-and-paste
related corruption.

Except for one problem: if the filename itself contains whitespace,
the inferred filename will be too short.

When Giuseppe ran into this problem, it was for a file creation
patch (for debian/licenses/LICENSE.global BSD-style Chromium).
So one can't use the list of files present in the index to deduce an
appropriate filename (not to mention that way lies madness; see
v0.99~402, 2005-05-31).

Instead, look for a timestamp and use that if present to mark the end
of the filename.  If no timestamp is present, the old heuristic is
used, with one exception: the space character \040 is not considered
terminating whitespace any more unless it is followed by a timestamp.

Reported-by: Giuseppe Iuculano <iuculano@debian.org>
Acked-by: Guido Günther <agx@sigxcpu.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotests: exercise "git apply" with weird filenames
Jonathan Nieder [Thu, 19 Aug 2010 01:48:03 +0000 (20:48 -0500)]
tests: exercise "git apply" with weird filenames

Check that "git apply" can cope with strange filenames, particularly
filenames with spaces.

Not all platforms have a sane enough diff -u and expand to
reliably create the such patches and maybe future versions of GNU
diff will handle funny characters differently, so this uses
pre-generated patches.  The script used to generate them is in
t/t4135/make-patches.

Filenames with tabs are not usable on NTFS; use something like the
FUNNYNAMES prerequisite from v1.3.0-rc1~67 (2006-03-03) to skip the
relevant tests when appropriate.  The detection is not shared in
test-lib.sh to avoid wasting time while running other test scripts.

Backslash is the path separator on Windows, so do not used it in
file names there (v1.6.3-rc0~93^2~6, 2009-03-13).

Finally, filenames starting with a quotation mark do not behave well
in msys (see v1.7.0-rc0~94^2, t4030, t4031: work around bogus MSYS
bash path conversion, 2010-01-01), so skip those tests on Windows,
too.

Helped-by: Andreas Schwab <schwab@linux-m68k.org>
Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>