Code

git.git
12 years agoMerge branch 'jc/maint-1.7.3-checkout-describe' into maint
Junio C Hamano [Mon, 1 Aug 2011 21:43:18 +0000 (14:43 -0700)]
Merge branch 'jc/maint-1.7.3-checkout-describe' into maint

* jc/maint-1.7.3-checkout-describe:
  checkout -b <name>: correctly detect existing branch

12 years agoconnect: correctly number ipv6 network adapter
Erik Faye-Lund [Mon, 1 Aug 2011 11:16:09 +0000 (13:16 +0200)]
connect: correctly number ipv6 network adapter

In ba50532, the variable 'cnt' was added to both the IPv6 and the
IPv4 version of git_tcp_connect_sock, intended to identify which
network adapter the connection failed on. But in the IPv6 version,
the variable was never increased, leaving it constantly at zero.

This behaviour isn't very useful, so let's fix it by increasing
the variable at every loop-iteration.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoBreak down no-lstat() condition checks in verify_uptodate()
Nguyễn Thái Ngọc Duy [Sat, 30 Jul 2011 03:55:05 +0000 (10:55 +0700)]
Break down no-lstat() condition checks in verify_uptodate()

Make it easier to grok under what conditions we can skip lstat().

While at there, shorten ie_match_stat() line for the sake of my eyes.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot7400: fix bogus test failure with symlinked trash
Jeff King [Sat, 30 Jul 2011 15:05:54 +0000 (09:05 -0600)]
t7400: fix bogus test failure with symlinked trash

One of the tests in t7400 fails if the trash directory has a
symlink anywhere in its path. E.g.:

  $ mkdir /tmp/git-test
  $ mkdir /tmp/git-test/real
  $ ln -s real /tmp/git-test/link

  $ ./t7400-submodule-basic --root=/tmp/git-test/real
  ...
  # passed all 44 test(s)

  $ ./t7400-submodule-basic --root=/tmp/git-test/link
  ...
  not ok - 41 use superproject as upstream when path is relative and no url is set there

The failing test does:

  git submodule add ../repo relative &&
  ...
  git submodule sync relative &&
  test "$(git config submodule.relative.url)" = "$submodurl/repo"

where $submodurl comes from the $TRASH_DIRECTORY the user
gave us. However, git will resolve symlinks when converting
the relative path into an absolute one, leading them to be
textually different (even though they point to the same
directory).

Fix this by asking pwd to canonicalize the name of the trash
directory for us.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDocumentation: clarify the invalidated tree entry format
Carlos Martín Nieto [Tue, 26 Jul 2011 12:27:57 +0000 (14:27 +0200)]
Documentation: clarify the invalidated tree entry format

When the entry_count is -1, the tree is invalidated and therefore has
not associated hash (or object name). Explicitly state that the next
entry starts after the newline.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agotests: print failed test numbers at the end of the test run
Jens Lehmann [Sun, 24 Jul 2011 13:35:54 +0000 (15:35 +0200)]
tests: print failed test numbers at the end of the test run

On modern multi-core processors "make test" is often run in multiple jobs.
If one of them fails the test run does stop, but the concurrently running
tests finish their run. It is rather easy to find out which test failed by
doing a "ls -d t/trash*". But that only works when you don't use the "-i"
option to "make test" because you want to get an overview of all failing
tests. In that case all thrash directories are deleted end and the
information which tests failed is lost.

If one or more tests failed, print a list of them before the test summary:

failed test(s): t1000 t6500

fixed   0
success 7638
failed  3
broken  49
total   7723

This makes it possible to just run the test suite with -i and collect all
failed test scripts at the end for further examination.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodoc/fast-import: clarify notemodify command
Dmitry Ivankov [Wed, 13 Jul 2011 17:10:53 +0000 (23:10 +0600)]
doc/fast-import: clarify notemodify command

The "notemodify" fast-import command was introduced in commit a8dd2e7
(fast-import: Add support for importing commit notes, 2009-10-09)
The commit log has slightly different description than the added
documentation. The latter is somewhat confusing. "notemodify" is a
subcommand of "commit" command used to add a note for some commit.
Does this note annotate the commit produced by the "commit" command
or a commit given by it's committish parameter? Which notes tree
does it write notes to?

The exact meaning could be deduced with old description and some
notes machinery knowledge. But let's make it more obvious. This
command is used in a context like "commit refs/notes/test" to
add or rewrite an annotation for a committish parameter. So the
advised way to add notes in a fast-import stream is:
1) import some commits (optional)
2) prepare a "commit" to the notes tree:
2.1) choose notes ref, committer, log message, etc.
2.2) create annotations with "notemodify", where each can refer to
a commit being annotated via a branch name, import mark reference,
sha1 and other expressions specified in the Documentation.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDocumentation: minor grammatical fix in rev-list-options.txt
Jack Nagel [Fri, 22 Jul 2011 01:33:15 +0000 (20:33 -0500)]
Documentation: minor grammatical fix in rev-list-options.txt

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDocumentation: git-filter-branch honors replacement refs
Peter Collingbourne [Thu, 21 Jul 2011 15:10:52 +0000 (16:10 +0100)]
Documentation: git-filter-branch honors replacement refs

Make it clear that git-filter-branch will honor and make permanent
replacement refs as well as grafts.

Signed-off-by: Peter Collingbourne <peter@pcc.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoremote-curl: Add a format check to parsing of info/refs
Julian Phillips [Sat, 16 Jul 2011 18:23:51 +0000 (19:23 +0100)]
remote-curl: Add a format check to parsing of info/refs

When parsing info/refs, no checks were applied that the file was in
the requried format.  Since the file is read from a remote webserver,
this isn't guarenteed to be true.  Add a check that the file at least
only contains lines that consist of 40 characters followed by a tab
and then the ref name.

Signed-off-by: Julian Phillips <julian@quantumfyre.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-config: Remove extra whitespaces
Pavan Kumar Sunkara [Sat, 16 Jul 2011 21:55:52 +0000 (03:25 +0530)]
git-config: Remove extra whitespaces

Remove extra whitespaces introduced by commits
01ebb9dc and fc1905bb

Signed-off-by: Pavan Kumar Sunkara <pavan.sss1991@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodocs: document --textconv diff option
Jeff King [Wed, 6 Jul 2011 15:13:30 +0000 (11:13 -0400)]
docs: document --textconv diff option

This has been there since textconv existed, but was never
documented. There is some overlap with what's in
gitattributes(5), but it's important to warn in both places
that textconv diffs probably can't be applied.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge git://bogomips.org/git-svn into maint
Junio C Hamano [Wed, 29 Jun 2011 23:42:41 +0000 (16:42 -0700)]
Merge git://bogomips.org/git-svn into maint

* git://bogomips.org/git-svn:
  git-svn: Correctly handle root commits in mergeinfo ranges
  git-svn: Disambiguate rev-list arguments to improve error message
  git-svn: Demonstrate a bug with root commits in mergeinfo ranges

12 years agoMerge branch 'maint-1.7.5' into maint
Junio C Hamano [Wed, 29 Jun 2011 23:41:55 +0000 (16:41 -0700)]
Merge branch 'maint-1.7.5' into maint

* maint-1.7.5:
  test: skip clean-up when running under --immediate mode
  "branch -d" can remove more than one branches

12 years agotest: skip clean-up when running under --immediate mode
Junio C Hamano [Mon, 27 Jun 2011 18:02:22 +0000 (11:02 -0700)]
test: skip clean-up when running under --immediate mode

Some tests try to be too careful about cleaning themselves up and
do

    test_expect_success description '
        set-up some test refs and/or configuration &&
        test_when_finished "revert the above changes" &&
the real test
    '

Which is nice to make sure that a potential failure would not have
unexpected interaction with the next test. This however interferes when
"the real test" fails and we want to see what is going on, by running the
test with --immediate mode and descending into its trash directory after
the test stops. The precondition to run the real test and cause it to fail
is all gone after the clean-up procedure defined by test_when_finished is
done.

Update test_run_ which is the workhorse of running a test script
called from test_expect_success and test_expect_failure, so that we do not
run clean-up script defined with test_when_finished when a test that is
expected to succeed fails under the --immediate mode.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Jeff King <peff@peff.net>
12 years ago"branch -d" can remove more than one branches
Junio C Hamano [Mon, 27 Jun 2011 22:04:32 +0000 (15:04 -0700)]
"branch -d" can remove more than one branches

Since 03feddd (git-check-ref-format: reject funny ref names, 2005-10-13),
"git branch -d" can take more than one branch names to remove.

The documentation was correct, but the usage string was not.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-svn: Correctly handle root commits in mergeinfo ranges
Michael Haggerty [Sat, 18 Jun 2011 06:48:00 +0000 (08:48 +0200)]
git-svn: Correctly handle root commits in mergeinfo ranges

If the bottom of a mergeinfo range is a commit that maps to a git root
commit, then it doesn't have a parent.  In such a case, use git commit
range "$top_commit" rather than "$bottom_commit^..$top_commit".

[ew: line-wrap at 80 columns]

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
12 years agogit-svn: Disambiguate rev-list arguments to improve error message
Michael Haggerty [Sat, 18 Jun 2011 06:47:59 +0000 (08:47 +0200)]
git-svn: Disambiguate rev-list arguments to improve error message

Add "--" in the "git rev-list" command line so that if there is a bug
and the revisions cannot be found, the error message is a bit less
cryptic.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
12 years agogit-svn: Demonstrate a bug with root commits in mergeinfo ranges
Michael Haggerty [Sat, 18 Jun 2011 06:47:58 +0000 (08:47 +0200)]
git-svn: Demonstrate a bug with root commits in mergeinfo ranges

If a svn:mergeinfo range starts at a commit that was converted as a
git root commit (e.g., r1 or a branch that was created out of thin
air), then there is an error when git-svn tries to run

    git rev-list "$bottom_commit^..$top_commit"

because $bottom_commit (the git commit corresponding to r1) has no
parent.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Acked-by: Eric Wong <normalperson@yhbt.net>
12 years agoGit 1.7.6 v1.7.6
Junio C Hamano [Sun, 26 Jun 2011 19:41:16 +0000 (12:41 -0700)]
Git 1.7.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint'
Junio C Hamano [Sun, 26 Jun 2011 19:09:11 +0000 (12:09 -0700)]
Merge branch 'maint'

* maint:
  completion: replace core.abbrevguard to core.abbrev

12 years agoMerge branch 'maint-1.7.4' into maint
Junio C Hamano [Fri, 24 Jun 2011 16:40:02 +0000 (09:40 -0700)]
Merge branch 'maint-1.7.4' into maint

* maint-1.7.4:
  completion: replace core.abbrevguard to core.abbrev

12 years agocompletion: replace core.abbrevguard to core.abbrev
Namhyung Kim [Fri, 24 Jun 2011 06:17:42 +0000 (15:17 +0900)]
completion: replace core.abbrevguard to core.abbrev

The core.abbrevguard config variable had removed and
now core.abbrev has been used instead. Teach it.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.6-rc3 v1.7.6-rc3
Junio C Hamano [Wed, 22 Jun 2011 23:13:16 +0000 (16:13 -0700)]
Git 1.7.6-rc3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint'
Junio C Hamano [Wed, 22 Jun 2011 21:01:18 +0000 (14:01 -0700)]
Merge branch 'maint'

* maint:
  Documentation: git diff --check respects core.whitespace

12 years agoDocumentation: git diff --check respects core.whitespace
Christof Krüger [Wed, 22 Jun 2011 15:33:02 +0000 (17:33 +0200)]
Documentation: git diff --check respects core.whitespace

Fix documentation on "git diff --check" by adopting the description from
"git apply --whitespace".

Signed-off-by: Christof Krüger <git@christof-krueger.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint'
Junio C Hamano [Tue, 21 Jun 2011 21:56:59 +0000 (14:56 -0700)]
Merge branch 'maint'

* maint:
  gitweb: 'pickaxe' and 'grep' features requires 'search' to be enabled

12 years agogitweb: 'pickaxe' and 'grep' features requires 'search' to be enabled
Jakub Narebski [Tue, 21 Jun 2011 06:41:16 +0000 (08:41 +0200)]
gitweb: 'pickaxe' and 'grep' features requires 'search' to be enabled

Both 'pickaxe' (searching changes) and 'grep' (searching files)
require basic 'search' feature to be enabled to work.  Enabling
e.g. only 'pickaxe' won't work.

Add a comment about this.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'mk/grep-pcre'
Junio C Hamano [Mon, 20 Jun 2011 21:49:44 +0000 (14:49 -0700)]
Merge branch 'mk/grep-pcre'

* mk/grep-pcre:
  t7810: avoid unportable use of "echo"

12 years agot7810: avoid unportable use of "echo"
Junio C Hamano [Mon, 20 Jun 2011 21:49:34 +0000 (14:49 -0700)]
t7810: avoid unportable use of "echo"

Michael J Gruber noticed that under /bin/dash this test failed
(as is expected -- \n in the string can be interpreted by the
command), while it passed with bash.  We probably could work it
around by using backquote in front of it, but it is safer and
more readable to avoid "echo" altogether in a case like this.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoplug a few coverity-spotted leaks
Jim Meyering [Mon, 20 Jun 2011 07:40:06 +0000 (09:40 +0200)]
plug a few coverity-spotted leaks

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'di/no-no-existant'
Junio C Hamano [Sun, 19 Jun 2011 23:01:54 +0000 (16:01 -0700)]
Merge branch 'di/no-no-existant'

* di/no-no-existant:
  Fix typo: existant->existent

12 years agoMerge branch 'maint'
Junio C Hamano [Sun, 19 Jun 2011 23:01:51 +0000 (16:01 -0700)]
Merge branch 'maint'

* maint:
  builtin/gc.c: add missing newline in message

12 years agobuiltin/gc.c: add missing newline in message
Andreas Schwab [Sun, 19 Jun 2011 08:03:26 +0000 (10:03 +0200)]
builtin/gc.c: add missing newline in message

Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agotests: link shell libraries into valgrind directory
Jeff King [Fri, 17 Jun 2011 20:36:32 +0000 (16:36 -0400)]
tests: link shell libraries into valgrind directory

When we run tests under valgrind, we symlink anything
executable that starts with git-* or test-* into a special
valgrind bin directory, and then make that our
GIT_EXEC_PATH.

However, shell libraries like git-sh-setup do not have the
executable bit marked, and did not get symlinked.  This
means that any test looking for shell libraries in our
exec-path would fail to find them, even though that is a
fine thing to do when testing against a regular git build
(or in a git install, for that matter).

t2300 demonstrated this problem. The fix is to symlink these
shell libraries directly into the valgrind directory.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot/Makefile: pass test opts to valgrind target properly
Jeff King [Fri, 17 Jun 2011 08:29:57 +0000 (04:29 -0400)]
t/Makefile: pass test opts to valgrind target properly

The valgrind target just reinvokes make with GIT_TEST_OPTS
set to "--valgrind". However, it does this using an
environment variable, which means GIT_TEST_OPTS in your
config.mak would override it, and "make valgrind" would
simply run the test suite without valgrind on.

Instead, we should pass GIT_TEST_OPTS on the command-line,
overriding what's in config.mak, and take care to append to
whatever the user has there already.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'ab/i18n-scripts-basic'
Junio C Hamano [Fri, 17 Jun 2011 18:40:32 +0000 (11:40 -0700)]
Merge branch 'ab/i18n-scripts-basic'

* ab/i18n-scripts-basic:
  sh-i18n--envsubst.c: do not #include getopt.h

12 years agosh-i18n--envsubst.c: do not #include getopt.h
Brandon Casey [Fri, 17 Jun 2011 18:19:26 +0000 (11:19 -0700)]
sh-i18n--envsubst.c: do not #include getopt.h

The getopt.h header file is not used.  It's inclusion is left over from the
original version of this source.  Additionally, getopt.h does not exist on
all platforms (SunOS 5.7) and will cause a compilation failure.  So, let's
remove it.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoFix typo: existant->existent
Dmitry Ivankov [Thu, 16 Jun 2011 13:42:48 +0000 (19:42 +0600)]
Fix typo: existant->existent

refs.c had a error message "Trying to write ref with nonexistant object".
And no tests relied on the wrong spelling.
Also typo was present in some test scripts internals, these tests still pass.

Signed-off-by: Dmitry Ivankov <divanorama@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.6-rc2 v1.7.6-rc2
Junio C Hamano [Thu, 16 Jun 2011 16:21:36 +0000 (09:21 -0700)]
Git 1.7.6-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: do not misparse nonnumeric content tag files that contain a digit
Jonathan Nieder [Thu, 9 Jun 2011 07:08:57 +0000 (02:08 -0500)]
gitweb: do not misparse nonnumeric content tag files that contain a digit

v1.7.6-rc0~27^2~4 (gitweb: Change the way "content tags" ('ctags') are
handled, 2011-04-29) tried to make gitweb's tag cloud feature more
intuitive for webmasters by checking whether the ctags/<label> under
a project's .git dir contains a number (representing the strength of
association to <label>) before treating it as one.

With that change, after putting '$feature{'ctags'}{'default'} = [1];'
in your $GITWEB_CONFIG, you could do

echo Linux >.git/ctags/linux

and gitweb would treat that as a request to tag the current repository
with the Linux tag, instead of the previous behavior of writing an
error page embedded in the projects list that triggers error messages
from Chromium and Firefox about malformed XML.

Unfortunately the pattern (\d+) used to match numbers is too loose,
and the "XML declaration allowed only at the start of the document"
error can still be experienced if you write "Linux-2.6" in place of
"Linux" in the example above.  Fix it by tightening the pattern to
^\d+$.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.6-rc1 v1.7.6-rc1
Junio C Hamano [Thu, 9 Jun 2011 01:29:48 +0000 (18:29 -0700)]
Git 1.7.6-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint'
Junio C Hamano [Thu, 9 Jun 2011 01:13:39 +0000 (18:13 -0700)]
Merge branch 'maint'

* maint:
  fetch: do not leak a refspec

12 years agofetch: do not leak a refspec
Jim Meyering [Wed, 8 Jun 2011 20:06:33 +0000 (22:06 +0200)]
fetch: do not leak a refspec

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/magic-pathspec'
Junio C Hamano [Tue, 7 Jun 2011 15:32:42 +0000 (08:32 -0700)]
Merge branch 'jc/magic-pathspec'

* jc/magic-pathspec:
  t3703: skip more tests using colons in file names on Windows

12 years agot3703: skip more tests using colons in file names on Windows
Alex Riesen [Tue, 7 Jun 2011 09:49:44 +0000 (11:49 +0200)]
t3703: skip more tests using colons in file names on Windows

Use the same test and prerequisite as introduced in similar
fix in 650af7ae8bdf92bd92df2.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jn/mime-type-with-params'
Junio C Hamano [Mon, 6 Jun 2011 18:40:22 +0000 (11:40 -0700)]
Merge branch 'jn/mime-type-with-params'

* jn/mime-type-with-params:
  gitweb: Fix usability of $prevent_xss

12 years agoMerge branch 'jn/gitweb-docs'
Junio C Hamano [Mon, 6 Jun 2011 18:40:18 +0000 (11:40 -0700)]
Merge branch 'jn/gitweb-docs'

* jn/gitweb-docs:
  gitweb: Move "Requirements" up in gitweb/INSTALL
  gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL
  gitweb: Move information about installation from README to INSTALL

12 years agoMerge branch 'jk/diff-not-so-quick'
Junio C Hamano [Mon, 6 Jun 2011 18:40:14 +0000 (11:40 -0700)]
Merge branch 'jk/diff-not-so-quick'

* jk/diff-not-so-quick:
  diff: futureproof "stop feeding the backend early" logic
  diff_tree: disable QUICK optimization with diff filter

Conflicts:
diff.c

12 years agoMerge branch 'bc/maint-status-z-to-use-porcelain'
Junio C Hamano [Mon, 6 Jun 2011 18:40:08 +0000 (11:40 -0700)]
Merge branch 'bc/maint-status-z-to-use-porcelain'

* bc/maint-status-z-to-use-porcelain:
  builtin/commit.c: set status_format _after_ option parsing
  t7508: demonstrate status's failure to use --porcelain format with -z

Conflicts:
builtin/commit.c

12 years agocheckout -b <name>: correctly detect existing branch
Junio C Hamano [Mon, 6 Jun 2011 05:17:04 +0000 (22:17 -0700)]
checkout -b <name>: correctly detect existing branch

When create a new branch, we fed "refs/heads/<proposed name>" as a string
to get_sha1() and expected it to fail when a branch already exists.

The right way to check if a ref exists is to check with resolve_ref().

A naïve solution that might appear attractive but does not work is to
forbid slashes in get_describe_name() but that will not work. A describe
name is is in the form of "ANYTHING-g<short sha1>", and that ANYTHING part
comes from a original tag name used in the repository the user ran the
describe command. A sick user could have a confusing hierarchical tag
whose name is "refs/heads/foobar" (stored as refs/tags/refs/heads/foobar")
to generate a describe name "refs/heads/foobar-6-g02ac983", and we should
be able to use that name to refer to the object whose name is 02ac983.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: Fix usability of $prevent_xss
Jakub Narebski [Sat, 4 Jun 2011 08:43:35 +0000 (10:43 +0200)]
gitweb: Fix usability of $prevent_xss

With XSS prevention on (enabled using $prevent_xss), blobs
('blob_plain') of all types except a few known safe ones are served
with "Content-Disposition: attachment".  However the check was too
strict; it didn't take into account optional parameter attributes,

  media-type     = type "/" subtype *( ";" parameter )

as described in RFC 2616

  http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.17
  http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.7

This fixes that, and it for example treats following as safe MIME
media type:

  text/plain; charset=utf-8

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: Move "Requirements" up in gitweb/INSTALL
Jakub Narebski [Fri, 3 Jun 2011 16:31:48 +0000 (18:31 +0200)]
gitweb: Move "Requirements" up in gitweb/INSTALL

This way you can examine prerequisites at first glance, before
detailed instructions on installing gitweb.  Straightforward
text movement.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL
Jakub Narebski [Thu, 2 Jun 2011 14:55:53 +0000 (16:55 +0200)]
gitweb: Describe CSSMIN and JSMIN in gitweb/INSTALL

The build-time configuration variables JSMIN and CSSMIN were mentioned
only in Makefile; add their description to gitweb/INSTALL.

This required moving description of GITWEB_JS up, near GITWEB_CSS and
just introduced CSMIN and JSMIN.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogitweb: Move information about installation from README to INSTALL
Jakub Narebski [Thu, 2 Jun 2011 14:55:52 +0000 (16:55 +0200)]
gitweb: Move information about installation from README to INSTALL

Almost straightformard moving of "How to configure gitweb for your
local system" section from gitweb/README to gitweb/INSTALL, as it is
about build time configuration.  Updated references to it.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoSync with 1.7.5.4 v1.7.6-rc0
Junio C Hamano [Wed, 1 Jun 2011 21:11:17 +0000 (14:11 -0700)]
Sync with 1.7.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.5.4 v1.7.5.4
Junio C Hamano [Wed, 1 Jun 2011 21:08:26 +0000 (14:08 -0700)]
Git 1.7.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jk/maint-config-alias-fix' into maint
Junio C Hamano [Wed, 1 Jun 2011 21:05:22 +0000 (14:05 -0700)]
Merge branch 'jk/maint-config-alias-fix' into maint

* jk/maint-config-alias-fix:
  handle_options(): do not miscount how many arguments were used
  config: always parse GIT_CONFIG_PARAMETERS during git_config
  git_config: don't peek at global config_parameters
  config: make environment parsing routines static

12 years agoMerge branch 'jc/fmt-req-fix' into maint
Junio C Hamano [Wed, 1 Jun 2011 21:03:07 +0000 (14:03 -0700)]
Merge branch 'jc/fmt-req-fix' into maint

* jc/fmt-req-fix:
  userformat_find_requirements(): find requirement for the correct format

12 years agoMerge branch 'jk/maint-docs' into maint
Junio C Hamano [Wed, 1 Jun 2011 21:02:52 +0000 (14:02 -0700)]
Merge branch 'jk/maint-docs' into maint

* jk/maint-docs:
  docs: fix some antique example output
  docs: make sure literal "->" isn't converted to arrow
  docs: update status --porcelain format
  docs: minor grammar fixes to git-status

12 years agoMerge branch 'jn/doc-remote-helpers' into maint
Junio C Hamano [Wed, 1 Jun 2011 21:02:45 +0000 (14:02 -0700)]
Merge branch 'jn/doc-remote-helpers' into maint

* jn/doc-remote-helpers:
  Documentation: do not misinterpret refspecs as bold text

12 years agoMerge branch 'kk/maint-prefix-in-config-mak' into maint
Junio C Hamano [Wed, 1 Jun 2011 21:02:39 +0000 (14:02 -0700)]
Merge branch 'kk/maint-prefix-in-config-mak' into maint

* kk/maint-prefix-in-config-mak:
  config.mak.in: allow "configure --sysconfdir=/else/where"

12 years agodiffcore-rename.c: avoid set-but-not-used warning
Jim Meyering [Fri, 29 Apr 2011 09:42:41 +0000 (11:42 +0200)]
diffcore-rename.c: avoid set-but-not-used warning

Since 9d8a5a5 (diffcore-rename: refactor "too many candidates" logic,
2011-01-06), diffcore_rename() initializes num_src but does not use it
anymore.  "-Wunused-but-set-variable" in gcc-4.6 complains about this.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoUpdate draft release notes to 1.7.6
Junio C Hamano [Tue, 31 May 2011 19:22:50 +0000 (12:22 -0700)]
Update draft release notes to 1.7.6

I think we are almost there for the feature freeze.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jk/format-patch-am'
Junio C Hamano [Tue, 31 May 2011 19:19:11 +0000 (12:19 -0700)]
Merge branch 'jk/format-patch-am'

* jk/format-patch-am:
  format-patch: preserve subject newlines with -k
  clean up calling conventions for pretty.c functions
  pretty: add pp_commit_easy function for simple callers
  mailinfo: always clean up rfc822 header folding
  t: test subject handling in format-patch / am pipeline

Conflicts:
builtin/branch.c
builtin/log.c
commit.h

12 years agoMerge branch 'jn/doc-remote-helpers'
Junio C Hamano [Tue, 31 May 2011 19:09:35 +0000 (12:09 -0700)]
Merge branch 'jn/doc-remote-helpers'

* jn/doc-remote-helpers:
  Documentation: do not misinterpret refspecs as bold text

12 years agoMerge branch 'jk/format-patch-empty-prefix'
Junio C Hamano [Tue, 31 May 2011 19:09:27 +0000 (12:09 -0700)]
Merge branch 'jk/format-patch-empty-prefix'

* jk/format-patch-empty-prefix:
  format-patch: make zero-length subject prefixes prettier

12 years agoMerge branch 'ab/i18n-envsubst-doc-fix'
Junio C Hamano [Tue, 31 May 2011 19:09:21 +0000 (12:09 -0700)]
Merge branch 'ab/i18n-envsubst-doc-fix'

* ab/i18n-envsubst-doc-fix:
  git-sh-i18n--envsubst: add SYNOPSIS section to the documentation

12 years agoMerge branch 'jc/log-quiet-fix'
Junio C Hamano [Tue, 31 May 2011 19:09:18 +0000 (12:09 -0700)]
Merge branch 'jc/log-quiet-fix'

* jc/log-quiet-fix:
  log: --quiet should serve as synonym to -s

12 years agoMerge branch 'kk/maint-prefix-in-config-mak'
Junio C Hamano [Tue, 31 May 2011 19:09:12 +0000 (12:09 -0700)]
Merge branch 'kk/maint-prefix-in-config-mak'

* kk/maint-prefix-in-config-mak:
  config.mak.in: allow "configure --sysconfdir=/else/where"

12 years agoMerge branch 'jk/rebase-head-reflog'
Junio C Hamano [Tue, 31 May 2011 19:09:08 +0000 (12:09 -0700)]
Merge branch 'jk/rebase-head-reflog'

* jk/rebase-head-reflog:
  rebase: write a reflog entry when finishing
  rebase: create HEAD reflog entry when aborting

12 years agoMerge branch 'jk/maint-docs'
Junio C Hamano [Tue, 31 May 2011 19:09:00 +0000 (12:09 -0700)]
Merge branch 'jk/maint-docs'

* jk/maint-docs:
  docs: fix some antique example output
  docs: make sure literal "->" isn't converted to arrow
  docs: update status --porcelain format
  docs: minor grammar fixes to git-status

12 years agoMerge branch 'jk/read-in-full-stops-on-error'
Junio C Hamano [Tue, 31 May 2011 19:08:55 +0000 (12:08 -0700)]
Merge branch 'jk/read-in-full-stops-on-error'

* jk/read-in-full-stops-on-error:
  read_in_full: always report errors

12 years agoMerge branch 'jk/maint-remote-mirror-safer'
Junio C Hamano [Tue, 31 May 2011 19:08:52 +0000 (12:08 -0700)]
Merge branch 'jk/maint-remote-mirror-safer'

* jk/maint-remote-mirror-safer:
  remote: allow "-t" with fetch mirrors

12 years agoMerge branch 'jl/read-tree-m-dry-run'
Junio C Hamano [Tue, 31 May 2011 19:08:48 +0000 (12:08 -0700)]
Merge branch 'jl/read-tree-m-dry-run'

* jl/read-tree-m-dry-run:
  Teach read-tree the -n|--dry-run option
  unpack-trees: add the dry_run flag to unpack_trees_options

12 years agoSync with maint
Junio C Hamano [Tue, 31 May 2011 19:07:14 +0000 (12:07 -0700)]
Sync with maint

12 years agoStart 1.7.5.4 draft release notes
Junio C Hamano [Tue, 31 May 2011 19:06:40 +0000 (12:06 -0700)]
Start 1.7.5.4 draft release notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'tr/add-i-no-escape' into maint
Junio C Hamano [Tue, 31 May 2011 19:02:04 +0000 (12:02 -0700)]
Merge branch 'tr/add-i-no-escape' into maint

* tr/add-i-no-escape:
  add -i: ignore terminal escape sequences

12 years agoMerge branch 'vh/config-interactive-singlekey-doc' into maint
Junio C Hamano [Tue, 31 May 2011 19:01:06 +0000 (12:01 -0700)]
Merge branch 'vh/config-interactive-singlekey-doc' into maint

* vh/config-interactive-singlekey-doc:
  git-reset.txt: better docs for '--patch'
  git-checkout.txt: better docs for '--patch'
  git-stash.txt: better docs for '--patch'
  git-add.txt: document 'interactive.singlekey'
  config.txt: 'interactive.singlekey; is used by...

12 years agoMerge branch 'ml/test-readme' into maint
Junio C Hamano [Tue, 31 May 2011 19:00:43 +0000 (12:00 -0700)]
Merge branch 'ml/test-readme' into maint

* ml/test-readme:
  t/README: unify documentation of test function args

12 years agoMerge branch 'ab/i18n-fixup' into maint
Junio C Hamano [Tue, 31 May 2011 19:00:27 +0000 (12:00 -0700)]
Merge branch 'ab/i18n-fixup' into maint

* ab/i18n-fixup: (24 commits)
  i18n: use test_i18n{cmp,grep} in t7600, t7607, t7611 and t7811
  i18n: use test_i18n{grep,cmp} in t7508
  i18n: use test_i18ngrep in t7506
  i18n: use test_i18ngrep and test_i18ncmp in t7502
  i18n: use test_i18ngrep in t7501
  i18n: use test_i18ncmp in t7500
  i18n: use test_i18ngrep in t7201
  i18n: use test_i18ncmp and test_i18ngrep in t7102 and t7110
  i18n: use test_i18ncmp and test_i18ngrep in t5541, t6040, t6120, t7004, t7012 and t7060
  i18n: use test_i18ncmp and test_i18ngrep in t3700, t4001 and t4014
  i18n: use test_i18ncmp and test_i18ngrep in t3203, t3501 and t3507
  i18n: use test_i18ngrep in t2020, t2204, t3030, and t3200
  i18n: use test_i18ngrep in lib-httpd and t2019
  i18n: do not overuse C_LOCALE_OUTPUT (grep)
  i18n: use test_i18ncmp in t1200 and t2200
  i18n: .git file is not a human readable message (t5601)
  i18n: do not overuse C_LOCALE_OUTPUT
  i18n: mark init-db messages for translation
  i18n: mark checkout plural warning for translation
  i18n: mark checkout --detach messages for translation
  ...

12 years agoMerge branch 'jc/rename-degrade-cc-to-c' into maint
Junio C Hamano [Tue, 31 May 2011 19:00:02 +0000 (12:00 -0700)]
Merge branch 'jc/rename-degrade-cc-to-c' into maint

* jc/rename-degrade-cc-to-c:
  diffcore-rename: fall back to -C when -C -C busts the rename limit
  diffcore-rename: record filepair for rename src
  diffcore-rename: refactor "too many candidates" logic
  builtin/diff.c: remove duplicated call to diff_result_code()

12 years agoMerge branch 'rr/doc-content-type' into maint
Junio C Hamano [Tue, 31 May 2011 18:59:39 +0000 (11:59 -0700)]
Merge branch 'rr/doc-content-type' into maint

* rr/doc-content-type:
  Documentation: Allow custom diff tools to be specified in 'diff.tool'
  Documentation: Add diff.<driver>.* to config
  Documentation: Move diff.<driver>.* from config.txt to diff-config.txt
  Documentation: Add filter.<driver>.* to config

12 years agoconfig.c: Remove unused git_config_global() function
Ramsay Jones [Tue, 31 May 2011 17:23:42 +0000 (18:23 +0100)]
config.c: Remove unused git_config_global() function

Commit 8f323c00 (drop support for GIT_CONFIG_NOGLOBAL, 15-03-2011)
removed the git_config_global() function, among other things, since
it is no longer required. Unfortunately, this function has since
been unintentionally restored by a faulty conflict resolution.

Remove it.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodiff: futureproof "stop feeding the backend early" logic
Junio C Hamano [Tue, 31 May 2011 16:14:17 +0000 (09:14 -0700)]
diff: futureproof "stop feeding the backend early" logic

Refactor the "do not stop feeding the backend early" logic into a small
helper function and use it in both run_diff_files() and diff_tree() that
has the stop-early optimization. We may later add other types of diffcore
transformation that require to look at the whole result like diff-filter
does, and having the logic in a single place is essential for longer term
maintainability.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodiff_tree: disable QUICK optimization with diff filter
Jeff King [Tue, 31 May 2011 15:33:56 +0000 (11:33 -0400)]
diff_tree: disable QUICK optimization with diff filter

We stop looking for changes early with QUICK, so our diff
queue contains only a subset of the changes. However, we
don't apply diff filters until later; it will appear at that
point as though there are no changes matching our filter,
when in reality we simply didn't keep looking for changes
long enough.

Commit 2cfe8a6 (diff --quiet: disable optimization when
--diff-filter=X is used, 2011-03-16) fixes this in some
cases by disabling the optimization when a filter is
present. However, it only tweaked run_diff_files, missing
the similar case in diff_tree. Thus the fix worked only for
diffing the working tree and index, but not between trees.

Noticed by Yasushi SHOJI.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/fmt-req-fix'
Junio C Hamano [Tue, 31 May 2011 03:19:21 +0000 (20:19 -0700)]
Merge branch 'jc/fmt-req-fix'

* jc/fmt-req-fix:
  userformat_find_requirements(): find requirement for the correct format

12 years agoMerge branch 'jk/maint-config-alias-fix'
Junio C Hamano [Tue, 31 May 2011 03:19:14 +0000 (20:19 -0700)]
Merge branch 'jk/maint-config-alias-fix'

* jk/maint-config-alias-fix:
  handle_options(): do not miscount how many arguments were used
  config: always parse GIT_CONFIG_PARAMETERS during git_config
  git_config: don't peek at global config_parameters
  config: make environment parsing routines static

Conflicts:
config.c

12 years agoDocumentation: do not misinterpret refspecs as bold text
Jonathan Nieder [Mon, 30 May 2011 15:52:56 +0000 (10:52 -0500)]
Documentation: do not misinterpret refspecs as bold text

In v1.7.3.3~2 (Documentation: do not misinterpret pull refspec as bold
text, 2010-12-03) many uses of asterisks in expressions like
"refs/heads/*:refs/svn/origin/branches/*" were escaped as {asterisk}
to avoid being treated as delimiters for bold text, but these two were
missed.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoformat-patch: make zero-length subject prefixes prettier
Jeff King [Mon, 30 May 2011 14:19:05 +0000 (10:19 -0400)]
format-patch: make zero-length subject prefixes prettier

If you give a zero-length subject prefix to format-patch
(e.g., "format-patch --subject-prefix="), we will print the
ugly:

  Subject: [ 1/2] your subject here

because we always insert a space between the prefix and
numbering. Requiring the user to provide the space in their
prefix would be more flexible, but would break existing
usage. This patch provides a DWIM and suppresses the space
for zero-length prefixes, under the assumption that nobody
actually wants "[ 1/2]".

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-sh-i18n--envsubst: add SYNOPSIS section to the documentation
Ævar Arnfjörð Bjarmason [Sun, 29 May 2011 11:00:35 +0000 (11:00 +0000)]
git-sh-i18n--envsubst: add SYNOPSIS section to the documentation

Change the documentation for the git-sh-i18n--envsubst program to
include a SYNOPSIS section. Include the invocation of the program from
git-sh-i18n.sh.

Not having a SYNOPSIS section caused the "doc" target to fail on
Centos 5.5 with asciidoc 8.2.5, while building with 8.6.4 on Debian
works just fine.

The relevant error was:

    ERROR: git-sh-i18n--envsubst.txt: line 9: second section must be named SYNOPSIS

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint'
Junio C Hamano [Mon, 30 May 2011 07:09:55 +0000 (00:09 -0700)]
Merge branch 'maint'

* maint:
  git-submodule.sh: separate parens by a space to avoid confusing some shells
  Documentation/technical/api-diff.txt: correct name of diff_unmerge()
  read_gitfile_gently: use ssize_t to hold read result
  remove tests of always-false condition
  rerere.c: diagnose a corrupt MERGE_RR when hitting EOF between TAB and '\0'

12 years agoMerge branch 'jm/maint-misc-fix' into maint
Junio C Hamano [Mon, 30 May 2011 07:09:41 +0000 (00:09 -0700)]
Merge branch 'jm/maint-misc-fix' into maint

* jm/maint-misc-fix:
  read_gitfile_gently: use ssize_t to hold read result
  remove tests of always-false condition
  rerere.c: diagnose a corrupt MERGE_RR when hitting EOF between TAB and '\0'

12 years agoMerge branch 'bc/maint-submodule-fix-parked' into maint
Junio C Hamano [Mon, 30 May 2011 07:09:36 +0000 (00:09 -0700)]
Merge branch 'bc/maint-submodule-fix-parked' into maint

* bc/maint-submodule-fix-parked:
  git-submodule.sh: separate parens by a space to avoid confusing some shells

12 years agoMerge branch 'bc/maint-api-doc-parked' into maint
Junio C Hamano [Mon, 30 May 2011 07:03:52 +0000 (00:03 -0700)]
Merge branch 'bc/maint-api-doc-parked' into maint

* bc/maint-api-doc-parked:
  Documentation/technical/api-diff.txt: correct name of diff_unmerge()

12 years agoMerge branch 'mk/grep-pcre'
Junio C Hamano [Mon, 30 May 2011 07:00:07 +0000 (00:00 -0700)]
Merge branch 'mk/grep-pcre'

* mk/grep-pcre:
  git-grep: Fix problems with recently added tests
  git-grep: Update tests (mainly for -P)
  Makefile: Pass USE_LIBPCRE down in GIT-BUILD-OPTIONS
  git-grep: update tests now regexp type is "last one wins"
  git-grep: do not die upon -F/-P when grep.extendedRegexp is set.
  git-grep: Bail out when -P is used with -F or -E
  grep: Add basic tests
  configure: Check for libpcre
  git-grep: Learn PCRE
  grep: Extract compile_regexp_failed() from compile_regexp()
  grep: Fix a typo in a comment
  grep: Put calls to fixmatch() and regmatch() into patmatch()
  contrib/completion: --line-number to git grep
  Documentation: Add --line-number to git-grep synopsis

12 years agogit-grep: Fix problems with recently added tests
Michał Kiedrowicz [Thu, 26 May 2011 22:43:59 +0000 (00:43 +0200)]
git-grep: Fix problems with recently added tests

Brian Gernhardt reported that test 'git grep -E -F -G a\\+b' fails on
OS X 10.6.7. This is because I assumed \+ is part of BRE, which isn't
true on all platforms.

The easiest way to make this test pass is to just update expected
output, but that would make the test pointless. Its real purpose is to
check whether 'git grep -E -F -G' is different from 'git grep -E -G -F'.
To check that, let's change pattern to "a+b*c". This should return
different match for -G, -F and -E.

I also made two small tweaks to the tests. First, I added path "ab" to
all calls to future-proof tests. Second, I updated last two tests to
better show that 'git grep -P -E' is different from 'git grep -E -P'.

Signed-off-by: Michał Kiedrowicz <michal.kiedrowicz@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/notes-batch-removal'
Junio C Hamano [Mon, 30 May 2011 06:51:26 +0000 (23:51 -0700)]
Merge branch 'jc/notes-batch-removal'

* jc/notes-batch-removal:
  show: --ignore-missing
  notes remove: --stdin reads from the standard input
  notes remove: --ignore-missing
  notes remove: allow removing more than one

12 years agoMerge branch 'jk/haves-from-alternate-odb'
Junio C Hamano [Mon, 30 May 2011 06:51:22 +0000 (23:51 -0700)]
Merge branch 'jk/haves-from-alternate-odb'

* jk/haves-from-alternate-odb:
  receive-pack: eliminate duplicate .have refs
  bisect: refactor sha1_array into a generic sha1 list
  refactor refs_from_alternate_cb to allow passing extra data

12 years agoMerge branch 'jn/run-command-error-failure' into maint
Junio C Hamano [Mon, 30 May 2011 02:08:51 +0000 (19:08 -0700)]
Merge branch 'jn/run-command-error-failure' into maint

* jn/run-command-error-failure:
  run-command: handle short writes and EINTR in die_child
  tests: check error message from run_command