OSDN Git Service

git-core/git.git
12 years agoMerge branch 'mz/remote-rename' into maint-1.7.6
Junio C Hamano [Wed, 26 Oct 2011 23:12:19 +0000 (16:12 -0700)]
Merge branch 'mz/remote-rename' into maint-1.7.6

* mz/remote-rename:
  remote: only update remote-tracking branch if updating refspec
  remote rename: warn when refspec was not updated
  remote: "rename o foo" should not rename ref "origin/bar"
  remote: write correct fetch spec when renaming remote 'remote'

12 years agoMerge branch 'rj/maint-t9159-svn-rev-notation' into maint-1.7.6
Junio C Hamano [Wed, 26 Oct 2011 23:12:13 +0000 (16:12 -0700)]
Merge branch 'rj/maint-t9159-svn-rev-notation' into maint-1.7.6

* rj/maint-t9159-svn-rev-notation:
  t9159-*.sh: skip for mergeinfo test for svn <= 1.4

12 years agoMerge branch 'hl/iso8601-more-zone-formats' into maint-1.7.6
Junio C Hamano [Wed, 26 Oct 2011 23:11:28 +0000 (16:11 -0700)]
Merge branch 'hl/iso8601-more-zone-formats' into maint-1.7.6

* hl/iso8601-more-zone-formats:
  date.c: Support iso8601 timezone formats

12 years agoMerge branch 'tr/doc-note-rewrite' into maint-1.7.6
Junio C Hamano [Wed, 26 Oct 2011 23:09:04 +0000 (16:09 -0700)]
Merge branch 'tr/doc-note-rewrite' into maint-1.7.6

* tr/doc-note-rewrite:
  Documentation: basic configuration of notes.rewriteRef

12 years agoMerge branch 'nd/sparse-doc' into maint-1.7.6
Junio C Hamano [Wed, 26 Oct 2011 23:09:04 +0000 (16:09 -0700)]
Merge branch 'nd/sparse-doc' into maint-1.7.6

* nd/sparse-doc:
  git-read-tree.txt: update sparse checkout examples

12 years agoMerge branch 'mg/maint-doc-sparse-checkout' into maint-1.7.6
Junio C Hamano [Wed, 26 Oct 2011 23:09:03 +0000 (16:09 -0700)]
Merge branch 'mg/maint-doc-sparse-checkout' into maint-1.7.6

* mg/maint-doc-sparse-checkout:
  git-read-tree.txt: correct sparse-checkout and skip-worktree description
  git-read-tree.txt: language and typography fixes
  unpack-trees: print "Aborting" to stderr

12 years agoMerge branch 'maint-1.7.5' into maint-1.7.6
Junio C Hamano [Wed, 26 Oct 2011 23:08:19 +0000 (16:08 -0700)]
Merge branch 'maint-1.7.5' into maint-1.7.6

* maint-1.7.5:
  make the sample pre-commit hook script reject names with newlines, too
  Reindent closing bracket using tab instead of spaces
  Documentation/git-update-index: refer to 'ls-files'

12 years agoMerge branch 'maint-1.7.4' into maint-1.7.5
Junio C Hamano [Wed, 26 Oct 2011 23:08:14 +0000 (16:08 -0700)]
Merge branch 'maint-1.7.4' into maint-1.7.5

* maint-1.7.4:
  make the sample pre-commit hook script reject names with newlines, too
  Reindent closing bracket using tab instead of spaces
  Documentation/git-update-index: refer to 'ls-files'

12 years agoMerge branch 'maint-1.7.3' into maint-1.7.4
Junio C Hamano [Wed, 26 Oct 2011 23:08:08 +0000 (16:08 -0700)]
Merge branch 'maint-1.7.3' into maint-1.7.4

* maint-1.7.3:
  make the sample pre-commit hook script reject names with newlines, too
  Reindent closing bracket using tab instead of spaces
  Documentation/git-update-index: refer to 'ls-files'

12 years agoMerge branch 'sn/doc-update-index-assume-unchanged' into maint-1.7.3
Junio C Hamano [Wed, 26 Oct 2011 23:08:00 +0000 (16:08 -0700)]
Merge branch 'sn/doc-update-index-assume-unchanged' into maint-1.7.3

* sn/doc-update-index-assume-unchanged:
  Documentation/git-update-index: refer to 'ls-files'

12 years agomake the sample pre-commit hook script reject names with newlines, too
Jim Meyering [Sat, 22 Oct 2011 17:44:40 +0000 (19:44 +0200)]
make the sample pre-commit hook script reject names with newlines, too

The sample pre-commit hook script would fail to reject a file name like
"a\nb" because of the way newlines are handled in "$(...)".  Adjust the
test to count filtered bytes and require there be 0.  Also print all
diagnostics to standard error, not stdout, so they will actually be seen.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoReindent closing bracket using tab instead of spaces
Nguyễn Thái Ngọc Duy [Mon, 24 Oct 2011 04:24:51 +0000 (15:24 +1100)]
Reindent closing bracket using tab instead of spaces

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-read-tree.txt: update sparse checkout examples
Nguyễn Thái Ngọc Duy [Sun, 25 Sep 2011 23:09:15 +0000 (09:09 +1000)]
git-read-tree.txt: update sparse checkout examples

The negation example uses '*' to match everything. This used to work
before 9037026 (unpack-trees: fix sparse checkout's "unable to match
directories") because back then, the list of paths is used to match
sparse patterns, so with the patterns

    *
    !subdir/

subdir/ always matches any path that start with subdir/ and "*" has no
chance to get tested. The result is subdir is excluded.

After the said commit, a tree structure is dynamically created and
sparse pattern matching now follows closely how read_directory()
applies .gitignore. This solves one problem, but reveals another one.

With this new strategy, "!subdir/" rule will be only tested once when
"subdir" directory is examined. Entries inside subdir, when examined,
will match "*" and are (correctly) re-added again because any rules
without a slash will match at every directory level. In the end, "*"
can revert every negation rules.

In order to correctly exclude subdir, we must use

    /*
    !subdir

to limit "match all" rule at top level only.

"*" rule has no actual use in sparse checkout and can be confusing to
users. While we can automatically turn "*" to "/*", this violates
.gitignore definition. Instead, discourage "*" in favor of "/*" (in
the second example).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.6.4 v1.7.6.4
Junio C Hamano [Fri, 23 Sep 2011 21:38:39 +0000 (14:38 -0700)]
Git 1.7.6.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'cb/maint-ls-files-error-report' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:30:49 +0000 (14:30 -0700)]
Merge branch 'cb/maint-ls-files-error-report' into maint

* cb/maint-ls-files-error-report:
  t3005: do not assume a particular order of stdout and stderr of git-ls-files
  ls-files: fix pathspec display on error

12 years agodescribe: Refresh the index when run with --dirty
Allan Caffee [Mon, 1 Aug 2011 01:52:41 +0000 (21:52 -0400)]
describe: Refresh the index when run with --dirty

When running git describe --dirty the index should be refreshed.  Previously
the cached index would cause describe to think that the index was dirty when,
in reality, it was just stale.

The issue was exposed by python setuptools which hardlinks files into another
directory when building a distribution.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/maint-clone-alternates' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:27:33 +0000 (14:27 -0700)]
Merge branch 'jc/maint-clone-alternates' into maint

* jc/maint-clone-alternates:
  clone: clone from a repository with relative alternates
  clone: allow more than one --reference

12 years agoMerge branch 'nd/maint-clone-gitdir' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:21:39 +0000 (14:21 -0700)]
Merge branch 'nd/maint-clone-gitdir' into maint

* nd/maint-clone-gitdir:
  clone: allow to clone from .git file
  read_gitfile_gently(): rename misnamed function to read_gitfile()

12 years agoMerge branch 'mh/check-ref-format-print-normalize' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:20:51 +0000 (14:20 -0700)]
Merge branch 'mh/check-ref-format-print-normalize' into maint

* mh/check-ref-format-print-normalize:
  Forbid DEL characters in reference names
  check-ref-format --print: Normalize refnames that start with slashes

12 years agoMerge branch 'mg/branch-set-upstream-previous' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:16:22 +0000 (14:16 -0700)]
Merge branch 'mg/branch-set-upstream-previous' into maint

* mg/branch-set-upstream-previous:
  branch.c: use the parsed branch name

12 years agoMerge branch 'gb/maint-am-patch-format-error-message' into maint
Junio C Hamano [Fri, 23 Sep 2011 21:11:18 +0000 (14:11 -0700)]
Merge branch 'gb/maint-am-patch-format-error-message' into maint

* gb/maint-am-patch-format-error-message:
  am: format is in $patch_format, not parse_patch

12 years agogit-read-tree.txt: correct sparse-checkout and skip-worktree description
Michael J Gruber [Wed, 21 Sep 2011 07:48:38 +0000 (09:48 +0200)]
git-read-tree.txt: correct sparse-checkout and skip-worktree description

The description of .git/info/sparse-checkout and
skip-worktree is exactly the opposite of what is true, which is:

If a file matches a pattern in sparse-checkout, then (it is to be
checked out and therefore) skip-worktree is unset for that file;
otherwise, it is set (so that it is not checked out).

Currently, the opposite is documented, and (consistently) read-tree's
behavior with respect to bit flips is descibed incorrectly.

Fix it.

In hindsight, it would have been much better to have a "sparse-ignore"
or "sparse-skip" file so that an empty file would mean a full checkout,
and the file logic would be analogous to that of .gitignore, excludes
and skip-worktree.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-read-tree.txt: language and typography fixes
Michael J Gruber [Wed, 21 Sep 2011 07:48:37 +0000 (09:48 +0200)]
git-read-tree.txt: language and typography fixes

Fix a few missing articles and such, and mark-up 'commands' and `files`
appropriately.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agounpack-trees: print "Aborting" to stderr
Michael J Gruber [Wed, 21 Sep 2011 07:48:36 +0000 (09:48 +0200)]
unpack-trees: print "Aborting" to stderr

display_error_msgs() prints all the errors to stderr already (if any),
followed by "Aborting" (if any) to stdout. Make the latter go to stderr
instead.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot9159-*.sh: skip for mergeinfo test for svn <= 1.4
Ramsay Jones [Sat, 10 Sep 2011 17:40:10 +0000 (18:40 +0100)]
t9159-*.sh: skip for mergeinfo test for svn <= 1.4

t9159 relies on the command-line syntax of svn >= 1.5.  Given the
declining install base of older svn versions, it is not worth our time to
support older svn syntax.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDocumentation/git-update-index: refer to 'ls-files'
Stefan Naewe [Wed, 21 Sep 2011 06:21:50 +0000 (08:21 +0200)]
Documentation/git-update-index: refer to 'ls-files'

'ls-files' refers to 'update-index' to show how the 'assume unchanged'
bit can be seen. This makes the connection 'bi-directional'.

Signed-off-by: Stefan Naewe <stefan.naewe@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-mergetool: check return value from read
Jay Soffian [Mon, 19 Sep 2011 23:40:52 +0000 (19:40 -0400)]
git-mergetool: check return value from read

Mostly fixed already by 6b44577 (mergetool: check return value
from read, 2011-07-01). Catch two uses it missed.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDocumentation: basic configuration of notes.rewriteRef
Thomas Rast [Tue, 13 Sep 2011 07:32:42 +0000 (09:32 +0200)]
Documentation: basic configuration of notes.rewriteRef

Users had problems finding a working setting for notes.rewriteRef.
Document how to enable rewriting for notes/commits, which should be a
safe setting.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodate.c: Support iso8601 timezone formats
Haitao Li [Fri, 9 Sep 2011 10:10:33 +0000 (18:10 +0800)]
date.c: Support iso8601 timezone formats

Timezone designators in the following formats are all valid according to
ISO8601:2004, section 4.3.2:

    [+-]hh, [+-]hhmm, [+-]hh:mm

but we have ignored the ones with colon so far.

Signed-off-by: Haitao Li <lihaitao@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.6.3 v1.7.6.3
Junio C Hamano [Mon, 12 Sep 2011 17:33:03 +0000 (10:33 -0700)]
Git 1.7.6.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jl/maint-fetch-submodule-check-fix' into maint
Junio C Hamano [Mon, 12 Sep 2011 17:19:57 +0000 (10:19 -0700)]
Merge branch 'jl/maint-fetch-submodule-check-fix' into maint

* jl/maint-fetch-submodule-check-fix:
  fetch: skip on-demand checking when no submodules are configured

12 years agoPrepare for 1.7.6.3 maintenance release
Junio C Hamano [Mon, 12 Sep 2011 05:08:56 +0000 (22:08 -0700)]
Prepare for 1.7.6.3 maintenance release

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'ms/reflog-show-is-default' into maint
Junio C Hamano [Mon, 12 Sep 2011 05:33:24 +0000 (22:33 -0700)]
Merge branch 'ms/reflog-show-is-default' into maint

* ms/reflog-show-is-default:
  reflog: actually default to subcommand 'show'

12 years agoMerge branch 'jk/reset-reflog-message-fix' into maint
Junio C Hamano [Mon, 12 Sep 2011 05:33:20 +0000 (22:33 -0700)]
Merge branch 'jk/reset-reflog-message-fix' into maint

* jk/reset-reflog-message-fix:
  reset: give better reflog messages

12 years agoMerge branch 'vi/make-test-vector-less-specific' into maint
Junio C Hamano [Mon, 12 Sep 2011 05:33:16 +0000 (22:33 -0700)]
Merge branch 'vi/make-test-vector-less-specific' into maint

* vi/make-test-vector-less-specific:
  tests: cleanup binary test vector files

12 years agoMerge branch 'jk/tag-contains-ab' (early part) into maint
Junio C Hamano [Mon, 12 Sep 2011 04:54:32 +0000 (21:54 -0700)]
Merge branch 'jk/tag-contains-ab' (early part) into maint

* 'jk/tag-contains-ab' (early part):
  tag: speed up --contains calculation

12 years agoMerge branch 'dz/connect-error-report' into maint
Junio C Hamano [Mon, 12 Sep 2011 04:53:47 +0000 (21:53 -0700)]
Merge branch 'dz/connect-error-report' into maint

* dz/connect-error-report:
  Do not log unless all connect() attempts fail

12 years agoMerge branch 'jc/maint-mergetool-read-fix' into maint
Junio C Hamano [Mon, 12 Sep 2011 04:53:39 +0000 (21:53 -0700)]
Merge branch 'jc/maint-mergetool-read-fix' into maint

* jc/maint-mergetool-read-fix:
  mergetool: check return value from read

12 years agoMerge branch 'jk/maint-config-param' into maint
Junio C Hamano [Mon, 12 Sep 2011 04:53:13 +0000 (21:53 -0700)]
Merge branch 'jk/maint-config-param' into maint

* jk/maint-config-param:
  config: use strbuf_split_str instead of a temporary strbuf
  strbuf: allow strbuf_split to work on non-strbufs
  config: avoid segfault when parsing command-line config
  config: die on error in command-line config
  fix "git -c" parsing of values with equals signs
  strbuf_split: add a max parameter

12 years agoMerge branch 'jn/doc-dashdash' into maint
Junio C Hamano [Mon, 12 Sep 2011 04:52:18 +0000 (21:52 -0700)]
Merge branch 'jn/doc-dashdash' into maint

* jn/doc-dashdash:
  Documentation/i18n: quote double-dash for AsciiDoc
  Documentation: quote double-dash for AsciiDoc

Conflicts:
Documentation/git-mergetool--lib.txt

12 years agoMerge branch 'jk/maint-1.7.2-status-ignored' into maint
Junio C Hamano [Mon, 12 Sep 2011 04:51:10 +0000 (21:51 -0700)]
Merge branch 'jk/maint-1.7.2-status-ignored' into maint

* jk/maint-1.7.2-status-ignored:
  git status --ignored: tests and docs
  status: fix bug with missing --ignore files

Conflicts:
Documentation/git-status.txt
t/t7508-status.sh

12 years agoremote: only update remote-tracking branch if updating refspec
Martin von Zweigbergk [Sat, 10 Sep 2011 19:39:23 +0000 (15:39 -0400)]
remote: only update remote-tracking branch if updating refspec

'git remote rename' will only update the remote's fetch refspec if it
looks like a default one. If the remote has no default fetch refspec,
as in

[remote "origin"]
    url = git://git.kernel.org/pub/scm/git/git.git
    fetch = +refs/heads/*:refs/remotes/upstream/*

we would not update the fetch refspec and even if there is a ref
called "refs/remotes/origin/master", we should not rename it, since it
was not created by fetching from the remote.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoremote rename: warn when refspec was not updated
Martin von Zweigbergk [Sat, 3 Sep 2011 15:26:59 +0000 (11:26 -0400)]
remote rename: warn when refspec was not updated

When renaming a remote, we also try to update the fetch refspec
accordingly, but only if it has the default format. For others, such
as refs/heads/master:refs/heads/origin, we are conservative and leave
it untouched. Let's give the user a warning about refspecs that are
not updated, so he can manually update the config if necessary.

Suggested-by: Jeff King <peff@peff.net>
Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoremote: "rename o foo" should not rename ref "origin/bar"
Martin von Zweigbergk [Fri, 2 Sep 2011 00:50:34 +0000 (20:50 -0400)]
remote: "rename o foo" should not rename ref "origin/bar"

When renaming a remote called 'o' using 'git remote rename o foo', git
should also rename any remote-tracking branches for the remote. This
does happen, but any remote-tracking branches starting with
'refs/remotes/o', such as 'refs/remotes/origin/bar', will also be
renamed (to 'refs/remotes/foorigin/bar' in this case).

Fix it by simply matching one more character, up to the slash
following the remote name.

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoremote: write correct fetch spec when renaming remote 'remote'
Martin von Zweigbergk [Fri, 2 Sep 2011 00:50:33 +0000 (20:50 -0400)]
remote: write correct fetch spec when renaming remote 'remote'

When renaming a remote whose name is contained in a configured fetch
refspec for that remote, we currently replace the first occurrence of
the remote name in the refspec. This is correct in most cases, but
breaks if the remote name occurs in the fetch refspec before the
expected place. For example, we currently change

[remote "remote"]
url = git://git.kernel.org/pub/scm/git/git.git
fetch = +refs/heads/*:refs/remotes/remote/*

into

[remote "origin"]
url = git://git.kernel.org/pub/scm/git/git.git
fetch = +refs/heads/*:refs/origins/remote/*

Reduce the risk of changing incorrect sections of the refspec by
matching the entire ":refs/remotes/<name>/" instead of just "<name>".

Signed-off-by: Martin von Zweigbergk <martin.von.zweigbergk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoSubmittingPathces: remove Cogito reference
Sverre Rabbelier [Sun, 11 Sep 2011 12:38:10 +0000 (14:38 +0200)]
SubmittingPathces: remove Cogito reference

Removing Cogito leaves just git and StGit, which is a rather
incomplete list of git diff tools available. Sidestep the problem
of deciding what tools to mention by not mentioning any.

Signed-off-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agofetch: skip on-demand checking when no submodules are configured
Jens Lehmann [Fri, 9 Sep 2011 18:22:03 +0000 (20:22 +0200)]
fetch: skip on-demand checking when no submodules are configured

It makes no sense to do the - possibly very expensive - call to "rev-list
<new-ref-sha1> --not --all" in check_for_new_submodule_commits() when
there aren't any submodules configured.

Leave check_for_new_submodule_commits() early when no name <-> path
mappings for submodules are found in the configuration. To make that work
reading the configuration had to be moved further up in cmd_fetch(), as
doing that after the actual fetch of the superproject was too late.

Reported-by: Martin Fick <mfick@codeaurora.org>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.6.2 v1.7.6.2
Junio C Hamano [Tue, 6 Sep 2011 18:41:02 +0000 (11:41 -0700)]
Git 1.7.6.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoRevert "Merge branch 'cb/maint-quiet-push' into maint"
Junio C Hamano [Tue, 6 Sep 2011 18:06:32 +0000 (11:06 -0700)]
Revert "Merge branch 'cb/maint-quiet-push' into maint"

This reverts commit ffa69e61d3c5730bd4b65a465efc130b0ef3c7df, reversing
changes made to 4a13c4d14841343d7caad6ed41a152fee550261d.

Adding a new command line option to receive-pack and feed it from
send-pack is not an acceptable way to add features, as there is no
guarantee that your updated send-pack will be talking to updated
receive-pack. New features need to be added via the capability mechanism
negotiated over the protocol.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDocumentation: clarify effects of -- <path> arguments
Thomas Rast [Tue, 30 Aug 2011 09:21:07 +0000 (11:21 +0200)]
Documentation: clarify effects of -- <path> arguments

'git log -- <path>' does not "show commits that affect the specified
paths" in a literal sense unless --full-history is given (for example,
a file that only existed on a side branch will turn up no commits at
all!).

Reword it to specify the actual intent of the filtering, and point to
the "History Simplification" section.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoam: format is in $patch_format, not parse_patch
Giuseppe Bilotta [Mon, 29 Aug 2011 15:22:06 +0000 (17:22 +0200)]
am: format is in $patch_format, not parse_patch

The error message given when the patch format was not recognized was
wrong, since the variable checked was $parse_patch rather than
$patch_format. Fix by checking the non-emptyness of the correct
variable.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot3005: do not assume a particular order of stdout and stderr of git-ls-files
Johannes Sixt [Sun, 28 Aug 2011 07:34:56 +0000 (09:34 +0200)]
t3005: do not assume a particular order of stdout and stderr of git-ls-files

There is no guarantee that stderr is flushed before stdout when both
channels are redirected to a file. Check the channels using independent
files.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoForbid DEL characters in reference names
Michael Haggerty [Sat, 27 Aug 2011 04:12:44 +0000 (06:12 +0200)]
Forbid DEL characters in reference names

DEL is an ASCII control character and therefore should not be
permitted in reference names.  Add tests for this and other unusual
characters.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agowhitespace: have SP on both sides of an assignment "="
Junio C Hamano [Thu, 25 Aug 2011 21:46:52 +0000 (14:46 -0700)]
whitespace: have SP on both sides of an assignment "="

I've deliberately excluded the borrowed code in compat/nedmalloc
directory.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoupdate-ref: whitespace fix
Pang Yan Han [Thu, 25 Aug 2011 15:40:50 +0000 (23:40 +0800)]
update-ref: whitespace fix

Signed-off-by: Pang Yan Han <pangyanhan@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocheck-ref-format --print: Normalize refnames that start with slashes
Michael Haggerty [Thu, 25 Aug 2011 19:19:24 +0000 (21:19 +0200)]
check-ref-format --print: Normalize refnames that start with slashes

When asked if "refs///heads/master" is valid, check-ref-format says "Yes,
it is well formed", and when asked to print canonical form, it shows
"refs/heads/master". This is so that it can be tucked after "$GIT_DIR/"
to form a valid pathname for a loose ref, and we normalize a pathname like
"$GIT_DIR/refs///heads/master" to de-dup the slashes in it.

Similarly, when asked if "/refs/heads/master" is valid, check-ref-format
says "Yes, it is Ok", but the leading slash is not removed when printing,
leading to "$GIT_DIR//refs/heads/master".

Fix it to make sure such leading slashes are removed.  Add tests that such
refnames are accepted and normalized correctly.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.6.1 v1.7.6.1
Junio C Hamano [Wed, 24 Aug 2011 19:16:58 +0000 (12:16 -0700)]
Git 1.7.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/maint-smart-http-race-upload-pack' into maint
Junio C Hamano [Wed, 24 Aug 2011 19:16:15 +0000 (12:16 -0700)]
Merge branch 'jc/maint-smart-http-race-upload-pack' into maint

* jc/maint-smart-http-race-upload-pack:
  get_indexed_object can return NULL if nothing is in that slot; check for it

12 years agoget_indexed_object can return NULL if nothing is in that slot; check for it
Brian Harring [Wed, 24 Aug 2011 05:47:17 +0000 (22:47 -0700)]
get_indexed_object can return NULL if nothing is in that slot; check for it

This fixes a segfault introduced by 051e400; via it, no longer able to
trigger the http/smartserv race.

Signed-off-by: Brian Harring <ferringb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoUpdate draft release notes for 1.7.6.1
Junio C Hamano [Tue, 23 Aug 2011 22:28:18 +0000 (15:28 -0700)]
Update draft release notes for 1.7.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/maint-combined-diff-work-tree' into maint
Junio C Hamano [Tue, 23 Aug 2011 22:27:30 +0000 (15:27 -0700)]
Merge branch 'jc/maint-combined-diff-work-tree' into maint

* jc/maint-combined-diff-work-tree:
  diff -c/--cc: do not mistake "resolved as deletion" as "use working tree"

Conflicts:
combine-diff.c

12 years agoMerge branch 'cb/maint-exec-error-report' into maint
Junio C Hamano [Tue, 23 Aug 2011 22:20:06 +0000 (15:20 -0700)]
Merge branch 'cb/maint-exec-error-report' into maint

* cb/maint-exec-error-report:
  notice error exit from pager
  error_routine: use parent's stderr if exec fails

12 years agoMerge branch 'cb/maint-quiet-push' into maint
Junio C Hamano [Tue, 23 Aug 2011 22:19:45 +0000 (15:19 -0700)]
Merge branch 'cb/maint-quiet-push' into maint

* cb/maint-quiet-push:
  receive-pack: do not overstep command line argument array
  propagate --quiet to send-pack/receive-pack

Conflicts:
Documentation/git-receive-pack.txt
Documentation/git-send-pack.txt

12 years agoMerge branch 'jc/maint-smart-http-race-upload-pack' into maint
Junio C Hamano [Tue, 23 Aug 2011 22:17:50 +0000 (15:17 -0700)]
Merge branch 'jc/maint-smart-http-race-upload-pack' into maint

* jc/maint-smart-http-race-upload-pack:
  helping smart-http/stateless-rpc fetch race

12 years agoMerge branch 'jc/no-gitweb-test-without-cgi-etc' into maint
Junio C Hamano [Tue, 23 Aug 2011 22:17:14 +0000 (15:17 -0700)]
Merge branch 'jc/no-gitweb-test-without-cgi-etc' into maint

* jc/no-gitweb-test-without-cgi-etc:
  t/gitweb-lib.sh: skip gitweb tests when perl dependencies are not met

12 years agoclone: clone from a repository with relative alternates
Junio C Hamano [Tue, 23 Aug 2011 01:05:16 +0000 (18:05 -0700)]
clone: clone from a repository with relative alternates

Cloning from a local repository blindly copies or hardlinks all the files
under objects/ hierarchy. This results in two issues:

 - If the repository cloned has an "objects/info/alternates" file, and the
   command line of clone specifies --reference, the ones specified on the
   command line get overwritten by the copy from the original repository.

 - An entry in a "objects/info/alternates" file can specify the object
   stores it borrows objects from as a path relative to the "objects/"
   directory. When cloning a repository with such an alternates file, if
   the new repository is not sitting next to the original repository, such
   relative paths needs to be adjusted so that they can be used in the new
   repository.

This updates add_to_alternates_file() to take the path to the alternate
object store, including the "/objects" part at the end (earlier, it was
taking the path to $GIT_DIR and was adding "/objects" itself), as it is
technically possible to specify in objects/info/alternates file the path
of a directory whose name does not end with "/objects".

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoclone: allow more than one --reference
Junio C Hamano [Tue, 23 Aug 2011 01:05:15 +0000 (18:05 -0700)]
clone: allow more than one --reference

Also add a test to expose a long-standing bug that is triggered when
cloning with --reference option from a local repository that has its own
alternates. The alternate object stores specified on the command line
are lost, and only alternates copied from the source repository remain.
The bug will be fixed in the next patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoadd technical documentation about ref iteration
Heiko Voigt [Mon, 22 Aug 2011 20:36:45 +0000 (22:36 +0200)]
add technical documentation about ref iteration

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoclone: allow to clone from .git file
Nguyễn Thái Ngọc Duy [Sun, 21 Aug 2011 11:58:09 +0000 (18:58 +0700)]
clone: allow to clone from .git file

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoread_gitfile_gently(): rename misnamed function to read_gitfile()
Junio C Hamano [Mon, 22 Aug 2011 21:04:56 +0000 (14:04 -0700)]
read_gitfile_gently(): rename misnamed function to read_gitfile()

The function was not gentle at all to the callers and died without giving
them a chance to deal with possible errors. Rename it to read_gitfile(),
and update all the callers.

As no existing caller needs a true "gently" variant, we do not bother
adding one at this point.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDo not use C++-style comments
Michael Haggerty [Mon, 22 Aug 2011 10:33:52 +0000 (12:33 +0200)]
Do not use C++-style comments

Detected by "gcc -std=iso9899:1990 ...".  This patch applies against
"maint".

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agobranch.c: use the parsed branch name
Michael J Gruber [Fri, 19 Aug 2011 11:45:43 +0000 (13:45 +0200)]
branch.c: use the parsed branch name

When setting up tracking info, branch.c uses the given branch specifier
("name"). Use the parsed name ("ref.buf") instead so that

git branch --set-upstream @{-1} foo

sets up tracking info for the previous branch rather than for a branch
named "@{-1}".

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agofetch-pack: check for valid commit from server
Nguyễn Thái Ngọc Duy [Thu, 18 Aug 2011 13:36:03 +0000 (20:36 +0700)]
fetch-pack: check for valid commit from server

A malicious server can return ACK with non-existent SHA-1 or not a
commit. lookup_commit() in this case may return NULL. Do not let
fetch-pack crash by accessing NULL address in this case.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocheckout-index: remove obsolete comment
Nguyễn Thái Ngọc Duy [Wed, 17 Aug 2011 12:22:13 +0000 (19:22 +0700)]
checkout-index: remove obsolete comment

The first paragraph about flag order is no longer true and is
mentioned in git-checkout-index.txt. The rest is also mentioned in
git-checkout-index.txt.

Remove it and keep uptodate document in one place.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoPrepare for 1.7.6.1
Junio C Hamano [Tue, 16 Aug 2011 19:13:38 +0000 (12:13 -0700)]
Prepare for 1.7.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jk/tag-list-multiple-patterns' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:14 +0000 (12:41 -0700)]
Merge branch 'jk/tag-list-multiple-patterns' into maint

* jk/tag-list-multiple-patterns:
  tag: accept multiple patterns for --list

12 years agoMerge branch 'jl/submodule-update-quiet' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:14 +0000 (12:41 -0700)]
Merge branch 'jl/submodule-update-quiet' into maint

* jl/submodule-update-quiet:
  submodule: update and add must honor --quiet flag

12 years agoMerge branch 'jl/submodule-add-relurl-wo-upstream' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:13 +0000 (12:41 -0700)]
Merge branch 'jl/submodule-add-relurl-wo-upstream' into maint

* jl/submodule-add-relurl-wo-upstream:
  submodule add: clean up duplicated code
  submodule add: allow relative repository path even when no url is set
  submodule add: test failure when url is not configured in superproject

Conflicts:
git-submodule.sh

12 years agoMerge branch 'oa/pull-reflog' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:13 +0000 (12:41 -0700)]
Merge branch 'oa/pull-reflog' into maint

* oa/pull-reflog:
  pull: remove extra space from reflog message

12 years agoMerge branch 'js/ls-tree-error' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:12 +0000 (12:41 -0700)]
Merge branch 'js/ls-tree-error' into maint

* js/ls-tree-error:
  Ensure git ls-tree exits with a non-zero exit code if read_tree_recursive fails.
  Add a test to check that git ls-tree sets non-zero exit code on error.

12 years agoMerge branch 'jk/fast-export-quote-path' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:12 +0000 (12:41 -0700)]
Merge branch 'jk/fast-export-quote-path' into maint

* jk/fast-export-quote-path:
  fast-export: quote paths in output

12 years agoMerge branch 'jc/checkout-reflog-fix' into maint
Junio C Hamano [Tue, 16 Aug 2011 19:41:12 +0000 (12:41 -0700)]
Merge branch 'jc/checkout-reflog-fix' into maint

* jc/checkout-reflog-fix:
  checkout: do not write bogus reflog entry out

12 years agoMerge branch 'jc/maint-reset-unmerged-path' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:28 +0000 (11:41 -0700)]
Merge branch 'jc/maint-reset-unmerged-path' into maint

* jc/maint-reset-unmerged-path:
  reset [<commit>] paths...: do not mishandle unmerged paths

12 years agoMerge branch 'mz/doc-rebase-abort' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:28 +0000 (11:41 -0700)]
Merge branch 'mz/doc-rebase-abort' into maint

* mz/doc-rebase-abort:
  rebase: clarify "restore the original branch"

12 years agoMerge branch 'bw/log-all-ref-updates-doc' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:28 +0000 (11:41 -0700)]
Merge branch 'bw/log-all-ref-updates-doc' into maint

* bw/log-all-ref-updates-doc:
  Documentation: clearly specify what refs are honored by core.logAllRefUpdates

12 years agoMerge branch 'js/maint-add-path-stat-pwd' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:27 +0000 (11:41 -0700)]
Merge branch 'js/maint-add-path-stat-pwd' into maint

* js/maint-add-path-stat-pwd:
  get_pwd_cwd(): Do not trust st_dev/st_ino blindly

12 years agoMerge branch 'ms/help-unknown' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:27 +0000 (11:41 -0700)]
Merge branch 'ms/help-unknown' into maint

* ms/help-unknown:
  help_unknown_cmd: do not propose an "unknown" cmd

12 years agoMerge branch 'mz/doc-synopsis-verse' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:26 +0000 (11:41 -0700)]
Merge branch 'mz/doc-synopsis-verse' into maint

* mz/doc-synopsis-verse:
  Documentation: use [verse] for SYNOPSIS sections

12 years agoMerge branch 'jn/mime-type-with-params' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:26 +0000 (11:41 -0700)]
Merge branch 'jn/mime-type-with-params' into maint

* jn/mime-type-with-params:
  gitweb: Serve */*+xml 'blob_plain' as text/plain with $prevent_xss
  gitweb: Serve text/* 'blob_plain' as text/plain with $prevent_xss

12 years agoMerge branch 'jc/submodule-sync-no-auto-vivify' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:41:26 +0000 (11:41 -0700)]
Merge branch 'jc/submodule-sync-no-auto-vivify' into maint

* jc/submodule-sync-no-auto-vivify:
  submodule add: always initialize .git/config entry
  submodule sync: do not auto-vivify uninteresting submodule

12 years agoMerge branch 'jc/zlib-wrap' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:26 +0000 (11:23 -0700)]
Merge branch 'jc/zlib-wrap' into maint

* jc/zlib-wrap:
  zlib: allow feeding more than 4GB in one go
  zlib: zlib can only process 4GB at a time
  zlib: wrap deflateBound() too
  zlib: wrap deflate side of the API
  zlib: wrap inflateInit2 used to accept only for gzip format
  zlib: wrap remaining calls to direct inflate/inflateEnd
  zlib wrapper: refactor error message formatter

12 years agoMerge branch 'fk/relink-upon-ldflags-update' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:26 +0000 (11:23 -0700)]
Merge branch 'fk/relink-upon-ldflags-update' into maint

* fk/relink-upon-ldflags-update:
  Makefile: Track changes to LDFLAGS and relink when necessary

12 years agoMerge branch 'bc/submodule-foreach-stdin-fix-1.7.4' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:26 +0000 (11:23 -0700)]
Merge branch 'bc/submodule-foreach-stdin-fix-1.7.4' into maint

* bc/submodule-foreach-stdin-fix-1.7.4:
  git-submodule.sh: preserve stdin for the command spawned by foreach
  t/t7407: demonstrate that the command called by 'submodule foreach' loses stdin

12 years agoMerge branch 'aw/rebase-i-p' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:25 +0000 (11:23 -0700)]
Merge branch 'aw/rebase-i-p' into maint

* aw/rebase-i-p:
  rebase -i -p: include non-first-parent commits in todo list

12 years agoMerge branch 'jc/diff-index-quick-exit-early' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:25 +0000 (11:23 -0700)]
Merge branch 'jc/diff-index-quick-exit-early' into maint

* jc/diff-index-quick-exit-early:
  diff-index --quiet: learn the "stop feeding the backend early" logic

Conflicts:
unpack-trees.h

12 years agoMerge branch 'jk/combine-diff-binary-etc' into maint
Junio C Hamano [Tue, 16 Aug 2011 18:23:24 +0000 (11:23 -0700)]
Merge branch 'jk/combine-diff-binary-etc' into maint

* jk/combine-diff-binary-etc:
  combine-diff: respect textconv attributes
  refactor get_textconv to not require diff_filespec
  combine-diff: handle binary files as binary
  combine-diff: calculate mode_differs earlier
  combine-diff: split header printing into its own function

12 years agoam: refresh the index at start and --resolved
Jeff King [Tue, 16 Aug 2011 00:13:07 +0000 (17:13 -0700)]
am: refresh the index at start and --resolved

If a file is unchanged but stat-dirty, we may erroneously
fail to apply patches, thinking that they conflict with a
dirty working tree.

This patch adds a call to "update-index --refresh". It comes
as late as possible, so that we don't bother with it for
thinks like "git rebase --abort", or when mbox-splitting
fails. However, it does come before we actually start
applying patches, meaning we will only call it once when we
start applying patches (or any time we return to "am" after
having resolved conflicts), and not once per patch.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agols-files: fix pathspec display on error
Clemens Buchacher [Mon, 1 Aug 2011 21:19:58 +0000 (23:19 +0200)]
ls-files: fix pathspec display on error

The following sequence of commands reveals an issue with error
reporting of relative paths:

 $ mkdir sub
 $ cd sub
 $ git ls-files --error-unmatch ../bbbbb
 error: pathspec 'b' did not match any file(s) known to git.
 $ git commit --error-unmatch ../bbbbb
 error: pathspec 'b' did not match any file(s) known to git.

This bug is visible only if the normalized path (i.e., the relative
path from the repository root) is longer than the prefix.
Otherwise, the code skips over the normalized path and reads from
an unused memory location which still contains a leftover of the
original command line argument.

So instead, use the existing facilities to deal with relative paths
correctly.

Also fix inconsistency between "checkout" and "commit", e.g.

    $ cd Documentation
    $ git checkout nosuch.txt
    error: pathspec 'Documentation/nosuch.txt' did not match...
    $ git commit nosuch.txt
    error: pathspec 'nosuch.txt' did not match...

by propagating the prefix down the codepath that reports the error.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agohelping smart-http/stateless-rpc fetch race
Junio C Hamano [Fri, 5 Aug 2011 20:54:06 +0000 (13:54 -0700)]
helping smart-http/stateless-rpc fetch race

A request to fetch from a client over smart HTTP protocol is served in
multiple steps. In the first round, the server side shows the set of refs
it has and their values, and the client picks from them and sends "I want
to fetch the history leading to these commits".

When the server tries to respond to this second request, its refs may have
progressed by a push from elsewhere. By design, we do not allow fetching
objects that are not at the tip of an advertised ref, and the server
rejects such a request. The client needs to try again, which is not ideal
especially for a busy server.

Teach upload-pack (which is the workhorse driven by git-daemon and smart
http server interface) that it is OK for a smart-http client to ask for
commits that are not at the tip of any advertised ref, as long as they are
reachable from advertised refs.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoreceive-pack: do not overstep command line argument array
Junio C Hamano [Mon, 8 Aug 2011 19:31:01 +0000 (12:31 -0700)]
receive-pack: do not overstep command line argument array

Previous commit added one element to the command line, without
making sure the result fits there.

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