Code

git.git
12 years agoGit 1.7.9.1 v1.7.9.1
Junio C Hamano [Tue, 14 Feb 2012 17:53:38 +0000 (09:53 -0800)]
Git 1.7.9.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jk/maint-tag-show-fixes' into maint
Junio C Hamano [Tue, 14 Feb 2012 07:31:27 +0000 (23:31 -0800)]
Merge branch 'jk/maint-tag-show-fixes' into maint

* jk/maint-tag-show-fixes:
  tag: do not show non-tag contents with "-n"
  tag: die when listing missing or corrupt objects
  tag: fix output of "tag -n" when errors occur

Conflicts:
t/t7004-tag.sh

12 years agoMerge branch 'bw/inet-pton-ntop-compat' into maint
Junio C Hamano [Tue, 14 Feb 2012 07:26:31 +0000 (23:26 -0800)]
Merge branch 'bw/inet-pton-ntop-compat' into maint

* bw/inet-pton-ntop-compat:
  Drop system includes from inet_pton/inet_ntop compatibility wrappers

12 years agoMerge branch 'mp/make-cleanse-x-for-exe' into maint
Junio C Hamano [Tue, 14 Feb 2012 07:26:25 +0000 (23:26 -0800)]
Merge branch 'mp/make-cleanse-x-for-exe' into maint

* mp/make-cleanse-x-for-exe:
  Explicitly set X to avoid potential build breakage

12 years agoMerge branch 'jn/merge-no-edit-fix' into maint
Junio C Hamano [Tue, 14 Feb 2012 07:24:02 +0000 (23:24 -0800)]
Merge branch 'jn/merge-no-edit-fix' into maint

* jn/merge-no-edit-fix:
  merge: do not launch an editor on "--no-edit $tag"

12 years agoUpdate draft release notes to 1.7.9.1
Junio C Hamano [Mon, 13 Feb 2012 19:46:47 +0000 (11:46 -0800)]
Update draft release notes to 1.7.9.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'js/add-e-submodule-fix' into maint
Junio C Hamano [Mon, 13 Feb 2012 19:42:18 +0000 (11:42 -0800)]
Merge branch 'js/add-e-submodule-fix' into maint

* js/add-e-submodule-fix:
  add -e: do not show difference in a submodule that is merely dirty

12 years agoMerge branch 'jc/parse-date-raw' into maint
Junio C Hamano [Mon, 13 Feb 2012 19:42:15 +0000 (11:42 -0800)]
Merge branch 'jc/parse-date-raw' into maint

* jc/parse-date-raw:
  parse_date(): '@' prefix forces git-timestamp
  parse_date(): allow ancient git-timestamp

12 years agoMerge branch 'jc/merge-ff-only-stronger-than-signed-merge' into maint
Junio C Hamano [Mon, 13 Feb 2012 19:42:11 +0000 (11:42 -0800)]
Merge branch 'jc/merge-ff-only-stronger-than-signed-merge' into maint

* jc/merge-ff-only-stronger-than-signed-merge:
  merge: do not create a signed tag merge under --ff-only option

12 years agoMerge branch 'jc/branch-desc-typoavoidance' into maint
Junio C Hamano [Mon, 13 Feb 2012 19:42:07 +0000 (11:42 -0800)]
Merge branch 'jc/branch-desc-typoavoidance' into maint

* jc/branch-desc-typoavoidance:
  branch --edit-description: protect against mistyped branch name
  tests: add write_script helper function

12 years agoMerge branch 'jn/rpm-spec' into maint
Junio C Hamano [Mon, 13 Feb 2012 19:42:04 +0000 (11:42 -0800)]
Merge branch 'jn/rpm-spec' into maint

* jn/rpm-spec:
  git.spec: Workaround localized messages not put in any RPM

12 years agot: use sane_unset instead of unset
Ævar Arnfjörð Bjarmason [Sun, 12 Feb 2012 01:05:12 +0000 (01:05 +0000)]
t: use sane_unset instead of unset

Change several tests to use the sane_unset function introduced in
v1.7.3.1-35-g00648ba instead of the built-in unset function.

This fixes a failure I was having on t9130-git-svn-authors-file.sh on
Solaris, and prevents several other issues from occurring.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoRemove Git's support for smoke testing
Ævar Arnfjörð Bjarmason [Fri, 23 Dec 2011 17:08:18 +0000 (17:08 +0000)]
Remove Git's support for smoke testing

I'm no longer running the Git smoke testing service at
smoke.git.nix.is due to Smolder being a fragile piece of software not
having time to follow through on making it easy for third parties to
run and submit their own smoke tests.

So remove the support in Git for sending smoke tests to
smoke.git.nix.is, it's still easy to modify the test suite to submit
smokes somewhere else.

This reverts the following commits:

    Revert "t/README: Add SMOKE_{COMMENT,TAGS}= to smoke_report target" -- e38efac87d
    Revert "t/README: Document the Smoke testing" -- d15e9ebc5c
    Revert "t/Makefile: Create test-results dir for smoke target" -- 617344d77b
    Revert "tests: Infrastructure for Git smoke testing" -- b6b84d1b74

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMakefile: Change the default compiler from "gcc" to "cc"
Ævar Arnfjörð Bjarmason [Tue, 20 Dec 2011 23:40:47 +0000 (23:40 +0000)]
Makefile: Change the default compiler from "gcc" to "cc"

Ever since the very first commit to git.git we've been setting CC to
"gcc". Presumably this is behavior that Linus copied from the Linux
Makefile.

However unlike Linux Git is written in ANSI C and supports a multitude
of compilers, including Clang, Sun Studio, xlc etc. On my Linux box
"cc" is a symlink to clang, and on a Solaris box I have access to "cc"
is Sun Studio's CC.

Both of these are perfectly capable of compiling Git, and it's
annoying to have to specify CC=cc on the command-line when compiling
Git when that's the default behavior of most other portable programs.

So change the default to "cc". Users who want to compile with GCC can
still add "CC=gcc" to the make(1) command-line, but those users who
don't have GCC as their "cc" will see expected behavior, and as a
bonus we'll be more likely to smoke out new compilation warnings from
our distributors since they'll me using a more varied set of compilers
by default.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoUpdate draft release notes to 1.7.9.1
Junio C Hamano [Fri, 10 Feb 2012 22:04:20 +0000 (14:04 -0800)]
Update draft release notes to 1.7.9.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/maint-request-pull-for-tag' into maint
Junio C Hamano [Fri, 10 Feb 2012 21:59:02 +0000 (13:59 -0800)]
Merge branch 'jc/maint-request-pull-for-tag' into maint

* jc/maint-request-pull-for-tag:
  request-pull: explicitly ask tags/$name to be pulled

12 years agoMerge branch 'tr/grep-l-with-decoration' into maint
Junio C Hamano [Fri, 10 Feb 2012 21:59:02 +0000 (13:59 -0800)]
Merge branch 'tr/grep-l-with-decoration' into maint

* tr/grep-l-with-decoration:
  grep: fix -l/-L interaction with decoration lines

12 years agoMerge branch 'jl/submodule-re-add' into maint
Junio C Hamano [Fri, 10 Feb 2012 21:59:01 +0000 (13:59 -0800)]
Merge branch 'jl/submodule-re-add' into maint

* jl/submodule-re-add:
  submodule add: fix breakage when re-adding a deep submodule

12 years agoMerge branch 'da/maint-mergetool-twoway' into maint
Junio C Hamano [Fri, 10 Feb 2012 21:59:01 +0000 (13:59 -0800)]
Merge branch 'da/maint-mergetool-twoway' into maint

* da/maint-mergetool-twoway:
  mergetool: Provide an empty file when needed

12 years agoExplicitly set X to avoid potential build breakage
Michael Palimaka [Wed, 8 Feb 2012 10:59:04 +0000 (21:59 +1100)]
Explicitly set X to avoid potential build breakage

$X is appended to binary names for Windows builds (ie. git.exe).
Pollution from the environment can inadvertently trigger this behaviour,
resulting in 'git' turning into 'gitwhatever' without warning.

Signed-off-by: Michael Palimaka <kensington@astralcloak.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agomerge: do not launch an editor on "--no-edit $tag"
Junio C Hamano [Thu, 9 Feb 2012 21:30:52 +0000 (13:30 -0800)]
merge: do not launch an editor on "--no-edit $tag"

When the user explicitly asked us not to, don't launch an editor.

But do everything else the same way as the "edit" case, i.e. leave the
comment with verification result in the log template and record the
mergesig in the resulting merge commit for later inspection.

Based on initiail analysis by Jonathan Nieder.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agotag: do not show non-tag contents with "-n"
Junio C Hamano [Mon, 6 Feb 2012 18:13:27 +0000 (10:13 -0800)]
tag: do not show non-tag contents with "-n"

"git tag -n" did not check the type of the object it is reading the top n
lines from. At least, avoid showing the beginning of trees and blobs when
dealing with lightweight tags that point at them.

As the payload of a tag and a commit look similar in that they both start
with a header block, which is skipped for the purpose of "-n" output,
followed by human readable text, allow the message of commit objects to be
shown just like the contents of tag objects. This avoids regression for
people who have been using "tag -n" to show the log messages of commits
that are pointed at by lightweight tags.

Test script is from Jeff King.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoadd -e: do not show difference in a submodule that is merely dirty
Johannes Schindelin [Tue, 7 Feb 2012 04:05:48 +0000 (05:05 +0100)]
add -e: do not show difference in a submodule that is merely dirty

When the HEAD of the submodule matches what is recorded in the index of
the superproject, and it has local changes or untracked files, the patch
offered by "git add -e" for editing shows a diff like this:

    diff --git a/submodule b/submodule
    <header>
    -deadbeef...
    +deadbeef...-dirty

Because applying such a patch has no effect to the index, this is a
useless noise.  Generate the patch with IGNORE_DIRTY_SUBMODULES flag to
prevent such a change from getting reported.

This patch also loses the "-dirty" suffix from the output when the HEAD of
the submodule is different from what is in the index of the superproject.
As such dirtiness expressed by the suffix does not affect the result of
the patch application at all, there is no information lost if we remove
it. The user could still run "git status" before "git add -e" if s/he
cares about the dirtiness.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agotag: die when listing missing or corrupt objects
Jeff King [Mon, 6 Feb 2012 08:13:42 +0000 (03:13 -0500)]
tag: die when listing missing or corrupt objects

We don't usually bother looking at tagged objects at all
when listing. However, if "-n" is specified, we open the
objects to read the annotations of the tags.  If we fail to
read an object, or if the object has zero length, we simply
silently return.

The first case is an indication of a broken or corrupt repo,
and we should notify the user of the error.

The second case is OK to silently ignore; however, the
existing code leaked the buffer returned by read_sha1_file.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agotag: fix output of "tag -n" when errors occur
Jeff King [Mon, 6 Feb 2012 08:13:12 +0000 (03:13 -0500)]
tag: fix output of "tag -n" when errors occur

When "git tag" is instructed to print lines from annotated
tags via "-n", it first prints the tag name, then attempts
to parse and print the lines of the tag object, and then
finally adds a trailing newline.

If an error occurs, we return early from the function and
never print the newline, screwing up the output for the next
tag. Let's factor the line-printing into its own function so
we can manage the early returns better, and make sure that
we always terminate the line.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoPrepare for 1.7.9.1
Junio C Hamano [Mon, 6 Feb 2012 08:03:18 +0000 (00:03 -0800)]
Prepare for 1.7.9.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agocompletion: --edit and --no-edit for git-merge
Adrian Weimann [Mon, 30 Jan 2012 19:29:33 +0000 (20:29 +0100)]
completion: --edit and --no-edit for git-merge

Signed-off-by: Adrian Weimann <adrian.weimann@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'sp/smart-http-failure-to-push' into maint
Junio C Hamano [Mon, 6 Feb 2012 07:58:43 +0000 (23:58 -0800)]
Merge branch 'sp/smart-http-failure-to-push' into maint

* sp/smart-http-failure-to-push:
  remote-curl: Fix push status report when all branches fail

12 years agoMerge branch 'jc/maint-log-first-parent-pathspec' into maint
Junio C Hamano [Mon, 6 Feb 2012 07:58:42 +0000 (23:58 -0800)]
Merge branch 'jc/maint-log-first-parent-pathspec' into maint

* jc/maint-log-first-parent-pathspec:
  Making pathspec limited log play nicer with --first-parent

12 years agoMerge branch 'cb/push-quiet' into maint
Junio C Hamano [Mon, 6 Feb 2012 07:58:42 +0000 (23:58 -0800)]
Merge branch 'cb/push-quiet' into maint

* cb/push-quiet:
  t5541: avoid TAP test miscounting
  fix push --quiet: add 'quiet' capability to receive-pack
  server_supports(): parse feature list more carefully

12 years agoMerge branch 'cb/maint-kill-subprocess-upon-signal' into maint
Junio C Hamano [Mon, 6 Feb 2012 07:58:42 +0000 (23:58 -0800)]
Merge branch 'cb/maint-kill-subprocess-upon-signal' into maint

* cb/maint-kill-subprocess-upon-signal:
  dashed externals: kill children on exit
  run-command: optionally kill children on exit

12 years agoSync with 1.7.6.6
Junio C Hamano [Mon, 6 Feb 2012 07:53:21 +0000 (23:53 -0800)]
Sync with 1.7.6.6

* maint-1.7.8:
  Git 1.7.6.6
  imap-send: remove dead code

12 years agoSync with 1.7.6.6
Junio C Hamano [Mon, 6 Feb 2012 07:52:53 +0000 (23:52 -0800)]
Sync with 1.7.6.6

* maint-1.7.7:
  Git 1.7.6.6
  imap-send: remove dead code

12 years agoSync with 1.7.6.6
Junio C Hamano [Mon, 6 Feb 2012 07:52:25 +0000 (23:52 -0800)]
Sync with 1.7.6.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.6.6 v1.7.6.6
Junio C Hamano [Mon, 6 Feb 2012 07:46:44 +0000 (23:46 -0800)]
Git 1.7.6.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoimap-send: remove dead code
Jeff King [Mon, 6 Feb 2012 06:29:37 +0000 (01:29 -0500)]
imap-send: remove dead code

The imap-send code was adapted from another project, and
still contains many unused bits of code. One of these bits
contains a type "struct string_list" which bears no
resemblence to the "struct string_list" we use elsewhere in
git. This causes the compiler to complain if git's
string_list ever becomes part of cache.h.

Let's just drop the dead code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agobranch --edit-description: protect against mistyped branch name
Junio C Hamano [Mon, 6 Feb 2012 01:13:36 +0000 (17:13 -0800)]
branch --edit-description: protect against mistyped branch name

It is very easy to mistype the branch name when editing its description,
e.g.

$ git checkout -b my-topic master
: work work work
: now we are at a good point to switch working something else
$ git checkout master
: ah, let's write it down before we forget what we were doing
$ git branch --edit-description my-tpoic

The command does not notice that branch 'my-tpoic' does not exist.  It is
not lost (it becomes description of an unborn my-tpoic branch), but is not
very useful.  So detect such a case and error out to reduce the grief
factor from this common mistake.

This incidentally also errors out --edit-description when the HEAD points
at an unborn branch (immediately after "init", or "checkout --orphan"),
because at that point, you do not even have any commit that is part of
your history and there is no point in describing how this particular
branch is different from the branch it forked off of, which is the useful
bit of information the branch description is designed to capture.

We may want to special case the unborn case later, but that is outside the
scope of this patch to prevent more common mistakes before 1.7.9 series
gains too much widespread use.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDrop system includes from inet_pton/inet_ntop compatibility wrappers
Ben Walton [Sun, 5 Feb 2012 22:32:21 +0000 (17:32 -0500)]
Drop system includes from inet_pton/inet_ntop compatibility wrappers

As both of these compatibility wrappers include git-compat-utils.h,
all of the system includes were redundant.

Dropping these system includes also makes git-compat-utils.h the first
include which avoids a compiler warning on Solaris due to the
redefinition of _FILE_OFFSET_BITS.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agomerge: do not create a signed tag merge under --ff-only option
Junio C Hamano [Mon, 6 Feb 2012 00:22:12 +0000 (16:22 -0800)]
merge: do not create a signed tag merge under --ff-only option

Starting at release v1.7.9, if you ask to merge a signed tag, "git merge"
always creates a merge commit, even when the tag points at a commit that
happens to be a descendant of your current commit.

Unfortunately, this interacts rather badly for people who use --ff-only to
make sure that their branch is free of local developments. It used to be
possible to say:

$ git checkout -b frotz v1.7.9~30
        $ git merge --ff-only v1.7.9

and expect that the resulting tip of frotz branch matches v1.7.9^0 (aka
the commit tagged as v1.7.9), but this fails with the updated Git with:

fatal: Not possible to fast-forward, aborting.

because a merge that merges v1.7.9 tag to v1.7.9~30 cannot be created by
fast forwarding.

We could teach users that now they have to do

$ git merge --ff-only v1.7.9^0

but it is far more pleasant for users if we DWIMmed this ourselves.

When an integrator pulls in a topic from a lieutenant via a signed tag,
even when the work done by the lieutenant happens to fast-forward, the
integrator wants to have a merge record, so the integrator will not be
asking for --ff-only when running "git pull" in such a case. Therefore,
this change should not regress the support for the use case v1.7.9 wanted
to add.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoparse_date(): '@' prefix forces git-timestamp
Junio C Hamano [Thu, 2 Feb 2012 21:41:43 +0000 (13:41 -0800)]
parse_date(): '@' prefix forces git-timestamp

The only place that the issue this series addresses was observed
where we read "cat-file commit" output and put it in GIT_AUTHOR_DATE
in order to replay a commit with an ancient timestamp.

With the previous patch alone, "git commit --date='20100917 +0900'"
can be misinterpreted to mean an ancient timestamp, not September in
year 2010.  Guard this codepath by requring an extra '@' in front of
the raw git timestamp on the parsing side. This of course needs to
be compensated by updating get_author_ident_from_commit and the code
for "git commit --amend" to prepend '@' to the string read from the
existing commit in the GIT_AUTHOR_DATE environment variable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoparse_date(): allow ancient git-timestamp
Junio C Hamano [Thu, 2 Feb 2012 21:41:42 +0000 (13:41 -0800)]
parse_date(): allow ancient git-timestamp

The date-time parser parses out a human-readble datestring piece by
piece, so that it could even parse a string in a rather strange
notation like 'noon november 11, 2005', but restricts itself from
parsing strings in "<seconds since epoch> <timezone>" format only
for reasonably new timestamps (like 1974 or newer) with 10 or more
digits. This is to prevent a string like "20100917" from getting
interpreted as seconds since epoch (we want to treat it as September
17, 2010 instead) while doing so.

The same codepath is used to read back the timestamp that we have
already recorded in the headers of commit and tag objects; because
of this, such a commit with timestamp "0 +0000" cannot be rebased or
amended very easily.

Teach parse_date() codepath to special case a string of the form
"<digits> +<4-digits>" to work this issue around, but require that
there is no other cruft around the string when parsing a timestamp
of this format for safety.

Note that this has a slight backward incompatibility implications.

If somebody writes "git commit --date='20100917 +0900'" and wants it
to mean a timestamp in September 2010 in Japan, this change will
break such a use case.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit.spec: Workaround localized messages not put in any RPM
Jakub Narebski [Fri, 3 Feb 2012 21:49:07 +0000 (22:49 +0100)]
git.spec: Workaround localized messages not put in any RPM

Currently building git RPM from tarball results in the following
error:

  RPM build errors:
     Installed (but unpackaged) file(s) found:
     /usr/share/locale/is/LC_MESSAGES/git.mo

This is caused by the fact that localized messages do not have their
place in some RPM package.  Let's postpone decision where they should
be put (be it git-i18n-Icelandic, or git-i18n, or git package itself)
for later by removing locale files at the end of install phase.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agotests: add write_script helper function
Junio C Hamano [Sat, 4 Feb 2012 06:29:01 +0000 (01:29 -0500)]
tests: add write_script helper function

Many of the scripts in the test suite write small helper
shell scripts to disk. It's best if these shell scripts
start with "#!$SHELL_PATH" rather than "#!/bin/sh", because
/bin/sh on some platforms is too buggy to be used.

However, it can be cumbersome to expand $SHELL_PATH, because
the usual recipe for writing a script is:

cat >foo.sh <<-\EOF
#!/bin/sh
echo my arguments are "$@"
EOF

To expand $SHELL_PATH, you have to either interpolate the
here-doc (which would require quoting "\$@"), or split the
creation into two commands (interpolating the $SHELL_PATH
line, but not the rest of the script). Let's provide a
helper function that makes that less syntactically painful.

While we're at it, this helper can also take care of the
"chmod +x" that typically comes after the creation of such a
script, saving the caller a line.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agorequest-pull: explicitly ask tags/$name to be pulled
Junio C Hamano [Wed, 1 Feb 2012 05:06:06 +0000 (21:06 -0800)]
request-pull: explicitly ask tags/$name to be pulled

When asking for a tag to be pulled, disambiguate by leaving tags/ prefix
in front of the name of the tag. E.g.

    ... in the git repository at:

      git://example.com/git/git.git/ tags/v1.2.3

    for you to fetch changes up to 123456...

This way, older versions of "git pull" can be used to respond to such a
request more easily, as "git pull $URL v1.2.3" did not DWIM to fetch
v1.2.3 tag in older versions. Also this makes it clearer for humans that
the pull request is made for a tag and he should anticipate a signed one.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.9 v1.7.9
Junio C Hamano [Fri, 27 Jan 2012 19:31:02 +0000 (11:31 -0800)]
Git 1.7.9

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoINSTALL: warn about recent Fedora breakage
Junio C Hamano [Fri, 27 Jan 2012 05:48:33 +0000 (21:48 -0800)]
INSTALL: warn about recent Fedora breakage

Recent releases of Redhat/Fedora are reported to ship Perl binary package
with some core modules stripped away (see http://lwn.net/Articles/477234/)
against the upstream Perl5 people's wishes. The Time::HiRes module used by
gitweb one of them.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-completion: workaround zsh COMPREPLY bug
Felipe Contreras [Wed, 25 Jan 2012 01:37:02 +0000 (03:37 +0200)]
git-completion: workaround zsh COMPREPLY bug

zsh adds a backslash (foo\ ) for each item in the COMPREPLY array if IFS
doesn't contain spaces. This issue has been reported[1], but there is no
solution yet.

This wasn't a problem due to another bug[2], which was fixed in zsh
version 4.3.12. After this change, 'git checkout ma<tab>' would resolve
to 'git checkout master\ '.

Aditionally, the introduction of __gitcomp_nl in commit a31e626
(completion: optimize refs completion) in git also made the problem
apparent, as Matthieu Moy reported.

The simplest and most generic solution is to hide all the changes we do
to IFS, so that "foo \nbar " is recognized by zsh as "foo bar". This
works on versions of git before and after the introduction of
__gitcomp_nl (a31e626), and versions of zsh before and after 4.3.12.

Once zsh is fixed, we should conditionally disable this workaround to
have the same benefits as bash users.

[1] http://www.zsh.org/mla/workers/2012/msg00053.html
[2] http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=commitdiff;h=2e25dfb8fd38dbef0a306282ffab1d343ce3ad8d

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodocs: minor grammar fixes for v1.7.9 release notes
Jeff King [Wed, 25 Jan 2012 22:20:03 +0000 (17:20 -0500)]
docs: minor grammar fixes for v1.7.9 release notes

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agosubmodule add: fix breakage when re-adding a deep submodule
Jens Lehmann [Tue, 24 Jan 2012 21:49:56 +0000 (22:49 +0100)]
submodule add: fix breakage when re-adding a deep submodule

Since recently a submodule with name <name> has its git directory in the
.git/modules/<name> directory of the superproject while the work tree
contains a gitfile pointing there.

When the same submodule is added on a branch where it wasn't present so
far (it is not found in the .gitmodules file), the name is not initialized
from the path as it should. This leads to a wrong path entered in the
gitfile when the .git/modules/<name> directory is found, as this happily
uses the - now empty - name. It then always points only a single directory
up, even if we have a path deeper in the directory hierarchy.

Fix that by initializing the name of the submodule early in module_clone()
if module_name() returned an empty name and add a test to catch that bug.

Reported-by: Jehan Bing <jehan@orb.com>
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agomergetool: Provide an empty file when needed
David Aguilar [Fri, 20 Jan 2012 07:47:35 +0000 (23:47 -0800)]
mergetool: Provide an empty file when needed

Some merge tools cannot cope when $LOCAL, $BASE, or $REMOTE are missing.
$BASE can be missing when two branches independently add the same
filename.

Provide an empty file to make these tools happy.

When a delete/modify conflict occurs, $LOCAL and $REMOTE can also be
missing. We have special case code to handle such case so this change
may not affect that codepath, but try to be consistent and create an
empty file for them anyway.

Reported-by: Jason Wenger <jcwenger@gmail.com>
Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogrep: fix -l/-L interaction with decoration lines
Albert Yale [Mon, 23 Jan 2012 17:52:44 +0000 (18:52 +0100)]
grep: fix -l/-L interaction with decoration lines

In threaded mode, git-grep emits file breaks (enabled with context, -W
and --break) into the accumulation buffers even if they are not
required.  The output collection thread then uses skip_first_line to
skip the first such line in the output, which would otherwise be at
the very top.

This is wrong when the user also specified -l/-L/-c, in which case
every line is relevant.  While arguably giving these options together
doesn't make any sense, git-grep has always quietly accepted it.  So
do not skip anything in these cases.

Signed-off-by: Albert Yale <surfingalbert@gmail.com>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoFix typo in 1.7.9 release notes
Michael Haggerty [Mon, 23 Jan 2012 12:09:58 +0000 (13:09 +0100)]
Fix typo in 1.7.9 release notes

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoremote-curl: Fix push status report when all branches fail
Shawn O. Pearce [Fri, 20 Jan 2012 03:12:09 +0000 (19:12 -0800)]
remote-curl: Fix push status report when all branches fail

The protocol between transport-helper.c and remote-curl requires
remote-curl to always print a blank line after the push command
has run. If the blank line is ommitted, transport-helper kills its
container process (the git push the user started) with exit(128)
and no message indicating a problem, assuming the helper already
printed reasonable error text to the console.

However if the remote rejects all branches with "ng" commands in the
report-status reply, send-pack terminates with non-zero status, and
in turn remote-curl exited with non-zero status before outputting
the blank line after the helper status printed by send-pack. No
error messages reach the user.

This caused users to see the following from git push over HTTP
when the remote side's update hook rejected the branch:

  $ git push http://... master
  Counting objects: 4, done.
  Delta compression using up to 6 threads.
  Compressing objects: 100% (2/2), done.
  Writing objects: 100% (3/3), 301 bytes, done.
  Total 3 (delta 0), reused 0 (delta 0)
  $

Always print a blank line after the send-pack process terminates,
ensuring the helper status report (if it was output) will be
correctly parsed by the calling transport-helper.c. This ensures
the helper doesn't abort before the status report can be shown to
the user.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMaking pathspec limited log play nicer with --first-parent
Junio C Hamano [Thu, 19 Jan 2012 19:58:45 +0000 (11:58 -0800)]
Making pathspec limited log play nicer with --first-parent

In a topic branch workflow, you often want to find the latest commit that
merged a side branch that touched a particular area of the system, so that
a new topic branch to work on that area can be forked from that commit.
For example, I wanted to find an appropriate fork-point to queue Luke's
changes related to git-p4 in contrib/fast-import/.

"git log --first-parent" traverses the first-parent chain, and "-m --stat"
shows the list of paths touched by commits including merge commits.  We
could ask the question this way:

    # What is the latest commit that touched that path?
    $ git log --first-parent --oneline -m --stat master |
      sed -e '/^ contrib\/fast-import\/git-p4 /q' | tail

The above finds that 8cbfc11 (Merge branch 'pw/p4-view-updates',
2012-01-06) was such a commit.

But a more natural way to spell this question is this:

    $ git log --first-parent --oneline -m --stat -1 master -- \
      contrib/fast-import/git-p4

Unfortunately, this does not work. It finds ecb7cf9 (git-p4: rewrite view
handling, 2012-01-02). This commit is a part of the merged topic branch
and is _not_ on the first-parent path from the 'master':

    $ git show-branch 8cbfc11 ecb7cf9
    ! [8cbfc11] Merge branch 'pw/p4-view-updates'
     ! [ecb7cf9] git-p4: rewrite view handling
    --
    -  [8cbfc11] Merge branch 'pw/p4-view-updates'
    +  [8cbfc11^2] git-p4: view spec documentation
    ++ [ecb7cf9] git-p4: rewrite view handling

The problem is caused by the merge simplification logic when it inspects
the merge commit 8cbfc11. In this case, the history leading to the tip of
'master' did not touch git-p4 since 'pw/p4-view-updates' topic forked, and
the result of the merge is simply a copy from the tip of the topic branch
in the view limited by the given pathspec.  The merge simplification logic
discards the history on the mainline side of the merge, and pretends as if
the sole parent of the merge is its second parent, i.e. the tip of the
topic. While this simplification is correct in the general case, it is at
least surprising if not outright wrong when the user explicitly asked to
show the first-parent history.

Here is an attempt to fix this issue, by not allowing us to compare the
merge result with anything but the first parent when --first-parent is in
effect, to avoid the history traversal veering off to the side branch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.9-rc2 v1.7.9-rc2
Junio C Hamano [Wed, 18 Jan 2012 23:53:35 +0000 (15:53 -0800)]
Git 1.7.9-rc2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint'
Junio C Hamano [Wed, 18 Jan 2012 23:52:08 +0000 (15:52 -0800)]
Merge branch 'maint'

* maint:
  Git 1.7.8.4
  Git 1.7.7.6
  diff-index: enable recursive pathspec matching in unpack_trees

Conflicts:
GIT-VERSION-GEN

12 years agoGit 1.7.8.4 v1.7.8.4
Junio C Hamano [Wed, 18 Jan 2012 23:51:00 +0000 (15:51 -0800)]
Git 1.7.8.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint-1.7.7' into maint
Junio C Hamano [Wed, 18 Jan 2012 23:48:46 +0000 (15:48 -0800)]
Merge branch 'maint-1.7.7' into maint

* maint-1.7.7:
  Git 1.7.7.6
  diff-index: enable recursive pathspec matching in unpack_trees

Conflicts:
GIT-VERSION-GEN

12 years agoGit 1.7.7.6 v1.7.7.6
Junio C Hamano [Wed, 18 Jan 2012 23:46:31 +0000 (15:46 -0800)]
Git 1.7.7.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agodiff-index: enable recursive pathspec matching in unpack_trees
Nguyen Thai Ngoc Duy [Sun, 15 Jan 2012 10:03:27 +0000 (17:03 +0700)]
diff-index: enable recursive pathspec matching in unpack_trees

The pathspec structure has a few bits of data to drive various operation
modes after we unified the pathspec matching logic in various codepaths.
For example, max_depth field is there so that "git grep" can limit the
output for files found in limited depth of tree traversal. Also in order
to show just the surface level differences in "git diff-tree", recursive
field stops us from descending into deeper level of the tree structure
when it is set to false, and this also affects pathspec matching when
we have wildcards in the pathspec.

The diff-index has always wanted the recursive behaviour, and wanted to
match pathspecs without any depth limit. But we forgot to do so when we
updated tree_entry_interesting() logic to unify the pathspec matching
logic.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/pull-signed-tag-doc'
Junio C Hamano [Wed, 18 Jan 2012 23:18:02 +0000 (15:18 -0800)]
Merge branch 'jc/pull-signed-tag-doc'

* jc/pull-signed-tag-doc:
  pulling signed tag: add howto document

12 years agopulling signed tag: add howto document
Junio C Hamano [Tue, 17 Jan 2012 22:52:24 +0000 (14:52 -0800)]
pulling signed tag: add howto document

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jk/credentials'
Junio C Hamano [Wed, 18 Jan 2012 23:16:53 +0000 (15:16 -0800)]
Merge branch 'jk/credentials'

* jk/credentials:
  credential-cache: ignore "connection refused" errors
  unix-socket: do not let close() or chdir() clobber errno during cleanup
  credential-cache: report more daemon connection errors
  unix-socket: handle long socket pathnames

12 years agoMerge branch 'nd/pathspec-recursion-cleanup'
Junio C Hamano [Wed, 18 Jan 2012 23:16:43 +0000 (15:16 -0800)]
Merge branch 'nd/pathspec-recursion-cleanup'

* nd/pathspec-recursion-cleanup:
  diff-index: enable recursive pathspec matching in unpack_trees
  Document limited recursion pathspec matching with wildcards

12 years agoMerge branch 'mh/maint-show-ref-doc'
Junio C Hamano [Wed, 18 Jan 2012 23:16:23 +0000 (15:16 -0800)]
Merge branch 'mh/maint-show-ref-doc'

* mh/maint-show-ref-doc:
  git-show-ref doc: typeset regexp in fixed width font
  git-show-ref: fix escaping in asciidoc source

12 years agoMerge branch 'tr/maint-word-diff-incomplete-line'
Junio C Hamano [Wed, 18 Jan 2012 23:16:19 +0000 (15:16 -0800)]
Merge branch 'tr/maint-word-diff-incomplete-line'

* tr/maint-word-diff-incomplete-line:
  word-diff: ignore '\ No newline at eof' marker

12 years agocredential-cache: ignore "connection refused" errors
Jeff King [Tue, 17 Jan 2012 06:02:32 +0000 (01:02 -0500)]
credential-cache: ignore "connection refused" errors

The credential-cache helper will try to connect to its
daemon over a unix socket. Originally, a failure to do so
was silently ignored, and we would either give up (if
performing a "get" or "erase" operation), or spawn a new
daemon (for a "store" operation).

But since 8ec6c8d, we try to report more errors. We detect a
missing daemon by checking for ENOENT on our connection
attempt.  If the daemon is missing, we continue as before
(giving up or spawning a new daemon). For any other error,
we die and report the problem.

However, checking for ENOENT is not sufficient for a missing
daemon. We might also get ECONNREFUSED if a dead daemon
process left a stale socket. This generally shouldn't
happen, as the daemon cleans up after itself, but the daemon
may not always be given a chance to do so (e.g., power loss,
"kill -9").

The resulting state is annoying not just because the helper
outputs an extra useless message, but because it actually
blocks the helper from spawning a new daemon to replace the
stale socket.

Fix it by checking for ECONNREFUSED.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jn/maint-gitweb-grep-fix'
Junio C Hamano [Tue, 17 Jan 2012 00:45:56 +0000 (16:45 -0800)]
Merge branch 'jn/maint-gitweb-grep-fix'

* jn/maint-gitweb-grep-fix:
  gitweb: Harden "grep" search against filenames with ':'
  gitweb: Fix file links in "grep" search

12 years agodiff-index: enable recursive pathspec matching in unpack_trees
Nguyen Thai Ngoc Duy [Sun, 15 Jan 2012 10:03:27 +0000 (17:03 +0700)]
diff-index: enable recursive pathspec matching in unpack_trees

The pathspec structure has a few bits of data to drive various operation
modes after we unified the pathspec matching logic in various codepaths.
For example, max_depth field is there so that "git grep" can limit the
output for files found in limited depth of tree traversal. Also in order
to show just the surface level differences in "git diff-tree", recursive
field stops us from descending into deeper level of the tree structure
when it is set to false, and this also affects pathspec matching when
we have wildcards in the pathspec.

The diff-index has always wanted the recursive behaviour, and wanted to
match pathspecs without any depth limit. But we forgot to do so when we
updated tree_entry_interesting() logic to unify the pathspec matching
logic.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoDocument limited recursion pathspec matching with wildcards
Nguyễn Thái Ngọc Duy [Sat, 14 Jan 2012 09:23:22 +0000 (16:23 +0700)]
Document limited recursion pathspec matching with wildcards

It's actually unlimited recursion if wildcards are active regardless
--max-depth

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-show-ref doc: typeset regexp in fixed width font
Michael Haggerty [Fri, 13 Jan 2012 16:39:16 +0000 (17:39 +0100)]
git-show-ref doc: typeset regexp in fixed width font

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-show-ref: fix escaping in asciidoc source
Michael Haggerty [Fri, 13 Jan 2012 16:39:15 +0000 (17:39 +0100)]
git-show-ref: fix escaping in asciidoc source

Two "^" characters were incorrectly being interpreted as markup for
superscripting.  Fix them by writing them as attribute references
"{caret}".

Although a single "^" character in a paragraph cannot be
misinterpreted in this way, also write other "^" characters as
"{caret}" in the interest of good hygiene (unless they are in literal
paragraphs, of course, in which context attribute references are not
recognized).

Spell "{}" consistently, namely *not* quoted as "\{\}".  Since the
braces are empty, they cannot be interpreted as an attribute
reference, and either spelling is OK.  So arbitrarily choose one
variation and use it consistently.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoGit 1.7.9-rc1 v1.7.9-rc1
Junio C Hamano [Fri, 13 Jan 2012 07:43:28 +0000 (23:43 -0800)]
Git 1.7.9-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'jc/request-pull-show-head-4'
Junio C Hamano [Fri, 13 Jan 2012 07:34:30 +0000 (23:34 -0800)]
Merge branch 'jc/request-pull-show-head-4'

* jc/request-pull-show-head-4:
  request-pull: use the real fork point when preparing the message

12 years agoMerge branch 'tr/maint-mailinfo'
Junio C Hamano [Fri, 13 Jan 2012 07:34:26 +0000 (23:34 -0800)]
Merge branch 'tr/maint-mailinfo'

* tr/maint-mailinfo:
  mailinfo documentation: accurately describe non -k case

12 years agoMerge branch 'ss/maint-msys-cvsexportcommit'
Junio C Hamano [Fri, 13 Jan 2012 07:34:21 +0000 (23:34 -0800)]
Merge branch 'ss/maint-msys-cvsexportcommit'

* ss/maint-msys-cvsexportcommit:
  git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS
  t9200: On MSYS, do not pass Windows-style paths to CVS

12 years agoMerge branch 'jk/maint-upload-archive'
Junio C Hamano [Fri, 13 Jan 2012 07:34:17 +0000 (23:34 -0800)]
Merge branch 'jk/maint-upload-archive'

* jk/maint-upload-archive:
  archive: re-allow HEAD:Documentation on a remote invocation

12 years agoMerge branch 'maint'
Junio C Hamano [Fri, 13 Jan 2012 07:33:39 +0000 (23:33 -0800)]
Merge branch 'maint'

* maint:
  Update draft release notes to 1.7.8.4
  Update draft release notes to 1.7.7.6
  Update draft release notes to 1.7.6.6
  thin-pack: try harder to use preferred base objects as base

12 years agoUpdate draft release notes to 1.7.8.4
Junio C Hamano [Fri, 13 Jan 2012 07:33:29 +0000 (23:33 -0800)]
Update draft release notes to 1.7.8.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint-1.7.7' into maint
Junio C Hamano [Fri, 13 Jan 2012 07:31:46 +0000 (23:31 -0800)]
Merge branch 'maint-1.7.7' into maint

* maint-1.7.7:
  Update draft release notes to 1.7.7.6
  Update draft release notes to 1.7.6.6
  thin-pack: try harder to use preferred base objects as base

12 years agoUpdate draft release notes to 1.7.7.6
Junio C Hamano [Fri, 13 Jan 2012 07:31:41 +0000 (23:31 -0800)]
Update draft release notes to 1.7.7.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint-1.7.6' into maint-1.7.7
Junio C Hamano [Fri, 13 Jan 2012 07:31:05 +0000 (23:31 -0800)]
Merge branch 'maint-1.7.6' into maint-1.7.7

* maint-1.7.6:
  Update draft release notes to 1.7.6.6
  thin-pack: try harder to use preferred base objects as base

12 years agoUpdate draft release notes to 1.7.6.6
Junio C Hamano [Fri, 13 Jan 2012 07:30:53 +0000 (23:30 -0800)]
Update draft release notes to 1.7.6.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agothin-pack: try harder to use preferred base objects as base
Jeff King [Thu, 12 Jan 2012 22:32:34 +0000 (17:32 -0500)]
thin-pack: try harder to use preferred base objects as base

When creating a pack using objects that reside in existing packs, we try
to avoid recomputing futile delta between an object (trg) and a candidate
for its base object (src) if they are stored in the same packfile, and trg
is not recorded as a delta already. This heuristics makes sense because it
is likely that we tried to express trg as a delta based on src but it did
not produce a good delta when we created the existing pack.

As the pack heuristics prefer producing delta to remove data, and Linus's
law dictates that the size of a file grows over time, we tend to record
the newest version of the file as inflated, and older ones as delta
against it.

When creating a thin-pack to transfer recent history, it is likely that we
will try to send an object that is recorded in full, as it is newer.  But
the heuristics to avoid recomputing futile delta effectively forbids us
from attempting to express such an object as a delta based on another
object. Sending an object in full is often more expensive than sending a
suboptimal delta based on other objects, and it is even more so if we
could use an object we know the receiving end already has (i.e. preferred
base object) as the delta base.

Tweak the recomputation avoidance logic, so that we do not punt on
computing delta against a preferred base object.

The effect of this change can be seen on two simulated upload-pack
workloads. The first is based on 44 reflog entries from my git.git
origin/master reflog, and represents the packs that kernel.org sent me git
updates for the past month or two. The second workload represents much
larger fetches, going from git's v1.0.0 tag to v1.1.0, then v1.1.0 to
v1.2.0, and so on.

The table below shows the average generated pack size and the average CPU
time consumed for each dataset, both before and after the patch:

                  dataset
            | reflog | tags
---------------------------------
     before | 53358  | 2750977
size  after | 32398  | 2668479
     change |   -39% |      -3%
---------------------------------
     before |  0.18  | 1.12
CPU   after |  0.18  | 1.15
     change |    +0% |      +3%

This patch makes a much bigger difference for packs with a shorter slice
of history (since its effect is seen at the boundaries of the pack) though
it has some benefit even for larger packs.

Signed-off-by: Jeff King <peff@peff.net>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoword-diff: ignore '\ No newline at eof' marker
Thomas Rast [Thu, 12 Jan 2012 11:15:33 +0000 (12:15 +0100)]
word-diff: ignore '\ No newline at eof' marker

The word-diff logic accumulates + and - lines until another line type
appears (normally [ @\]), at which point it generates the word diff.
This is usually correct, but it breaks when the preimage does not have
a newline at EOF:

  $ printf "%s" "a a a" >a
  $ printf "%s\n" "a ab a" >b
  $ git diff --no-index --word-diff a b
  diff --git 1/a 2/b
  index 9f68e94..6a7c02f 100644
  --- 1/a
  +++ 2/b
  @@ -1 +1 @@
  [-a a a-]
   No newline at end of file
  {+a ab a+}

Because of the order of the lines in a unified diff

  @@ -1 +1 @@
  -a a a
  \ No newline at end of file
  +a ab a

the '\' line flushed the buffers, and the - and + lines were never
matched with each other.

A proper fix would defer such markers until the end of the hunk.
However, word-diff is inherently whitespace-ignoring, so as a cheap
fix simply ignore the marker (and hide it from the output).

We use a prefix match for '\ ' to parallel the logic in
apply.c:parse_fragment().  We currently do not localize this string
(just accept other variants of it in git-apply), but this should be
future-proof.

Noticed-by: Ivan Shirokoff <shirokoff@yandex-team.ru>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoarchive: re-allow HEAD:Documentation on a remote invocation
Carlos Martín Nieto [Wed, 11 Jan 2012 12:12:38 +0000 (13:12 +0100)]
archive: re-allow HEAD:Documentation on a remote invocation

The tightening done in (ee27ca4a: archive: don't let remote clients
get unreachable commits, 2011-11-17) went too far and disallowed
HEAD:Documentation as it would try to find "HEAD:Documentation" as a
ref.

Only DWIM the "HEAD" part to see if it exists as a ref. Once we're
sure that we've been given a valid ref, we follow the normal code
path. This still disallows attempts to access commits which are not
branch tips.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'maint'
Junio C Hamano [Thu, 12 Jan 2012 03:11:28 +0000 (19:11 -0800)]
Merge branch 'maint'

* maint:
  attr: fix leak in free_attr_elem
  t2203: fix wrong commit command

12 years agoMerge branch 'maint-1.7.7' into maint
Junio C Hamano [Thu, 12 Jan 2012 03:11:13 +0000 (19:11 -0800)]
Merge branch 'maint-1.7.7' into maint

* maint-1.7.7:
  attr: fix leak in free_attr_elem
  t2203: fix wrong commit command

12 years agoMerge branch 'maint-1.7.6' into maint-1.7.7
Junio C Hamano [Thu, 12 Jan 2012 03:11:00 +0000 (19:11 -0800)]
Merge branch 'maint-1.7.6' into maint-1.7.7

* maint-1.7.6:
  attr: fix leak in free_attr_elem
  t2203: fix wrong commit command

12 years agoattr: fix leak in free_attr_elem
Jeff King [Thu, 12 Jan 2012 03:05:03 +0000 (22:05 -0500)]
attr: fix leak in free_attr_elem

This function frees the individual "struct match_attr"s we
have allocated, but forgot to free the array holding their
pointers, leading to a minor memory leak (but it can add up
after checking attributes for paths in many directories).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agogit-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS
Sebastian Schuberth [Wed, 11 Jan 2012 09:21:10 +0000 (10:21 +0100)]
git-cvsexportcommit: Fix calling Perl's rel2abs() on MSYS

Due to MSYS path mangling GIT_DIR contains a Windows-style path when
checked inside a Perl script even if GIT_DIR was previously set to an
MSYS-style path in a shell script. So explicitly convert to an MSYS-style
path before calling Perl's rel2abs() to make it work.

This fix was inspired by a very similar patch in WebKit:

http://trac.webkit.org/changeset/76255/trunk/Tools/Scripts/commit-log-editor

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Tested-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot9200: On MSYS, do not pass Windows-style paths to CVS
Sebastian Schuberth [Wed, 11 Jan 2012 09:20:14 +0000 (10:20 +0100)]
t9200: On MSYS, do not pass Windows-style paths to CVS

For details, see the commit message of 4114156ae9. Note that while using
$PWD as part of GIT_DIR is not required here, it does no harm and it is
more consistent. In addition, on MSYS using an environment variable should
be slightly faster than spawning an external executable.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agounix-socket: do not let close() or chdir() clobber errno during cleanup
Jonathan Nieder [Wed, 11 Jan 2012 23:50:10 +0000 (17:50 -0600)]
unix-socket: do not let close() or chdir() clobber errno during cleanup

unix_stream_connect and unix_stream_listen return -1 on error, with
errno set by the failing underlying call to allow the caller to write
a useful diagnosis.

Unfortunately the error path involves a few system calls itself, such
as close(), that can themselves touch errno.

This is not as worrisome as it might sound.  If close() fails, this
just means substituting one meaningful error message for another,
which is perfectly fine.  However, when the call _succeeds_, it is
allowed to (and sometimes might) clobber errno along the way with some
undefined value, so it is good higiene to save errno and restore it
immediately before returning to the caller.  Do so.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agomailinfo documentation: accurately describe non -k case
Thomas Rast [Wed, 11 Jan 2012 20:13:42 +0000 (21:13 +0100)]
mailinfo documentation: accurately describe non -k case

Since its very first description of -k, the documentation for
git-mailinfo claimed that (in the case without -k) after cleaning up
bracketed strings [blah], it would insert [PATCH].

It doesn't; on the contrary, one of the important jobs of mailinfo is
to remove those strings.

Since we're already there, rewrite the paragraph to give a complete
enumeration of all the transformations.  Specifically, it was missing
the whitespace normalization (run of isspace(c) -> ' ') and the
removal of leading ':'.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agot2203: fix wrong commit command
Nguyễn Thái Ngọc Duy [Wed, 11 Jan 2012 03:21:38 +0000 (10:21 +0700)]
t2203: fix wrong commit command

Add commit message to avoid commit's aborting due to the lack of
commit message, not because there are INTENT_TO_ADD entries in index.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agorequest-pull: use the real fork point when preparing the message
Junio C Hamano [Wed, 11 Jan 2012 05:45:52 +0000 (21:45 -0800)]
request-pull: use the real fork point when preparing the message

The command takes the "start" argument and computes the merge base
between it and the commit to be pulled so that we can show the diffstat,
but uses the "start" argument as-is when composing the message

    The following changes since commit $X are available

to tell the integrator which commit the work is based on. Giving "origin"
(most of the time it resolves to refs/remotes/origin/master) as the start
argument is often convenient, but it is usually not the fork point, and
does not help the integrator at all.

Use the real fork point, which is the merge base we already compute, when
composing that part of the message.

Suggested-by: Linus Torvalds
Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge branch 'bw/maint-t8006-sed-incomplete-line'
Junio C Hamano [Tue, 10 Jan 2012 22:46:52 +0000 (14:46 -0800)]
Merge branch 'bw/maint-t8006-sed-incomplete-line'

* bw/maint-t8006-sed-incomplete-line:
  Use perl instead of sed for t8006-blame-textconv test

12 years agoSync with maint
Junio C Hamano [Tue, 10 Jan 2012 22:46:22 +0000 (14:46 -0800)]
Sync with maint

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoPrepare for 1.7.8.4
Junio C Hamano [Tue, 10 Jan 2012 22:27:14 +0000 (14:27 -0800)]
Prepare for 1.7.8.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
12 years agoMerge the attributes fix in from maint-1.6.7 branch
Junio C Hamano [Tue, 10 Jan 2012 22:24:01 +0000 (14:24 -0800)]
Merge the attributes fix in from maint-1.6.7 branch

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