Code

git.git
13 years agomerge-recursive: Fix recursive case with D/F conflict via add/add conflict
Elijah Newren [Fri, 12 Aug 2011 05:19:55 +0000 (23:19 -0600)]
merge-recursive: Fix recursive case with D/F conflict via add/add conflict

When a D/F conflict is introduced via an add/add conflict, when
o->call_depth > 0 we need to ensure that the higher stage entry from the
base stage is removed.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomerge-recursive: Avoid working directory changes during recursive case
Elijah Newren [Fri, 12 Aug 2011 05:19:54 +0000 (23:19 -0600)]
merge-recursive: Avoid working directory changes during recursive case

make_room_for_directories_of_df_conflicts() is about making sure necessary
working directory changes can succeed.  When o->call_depth > 0 (i.e. the
recursive case), we do not want to make any working directory changes so
this function should be skipped.

Note that make_room_for_directories_of_df_conflicts() is broken as has
been pointed out by Junio; it should NOT be unlinking files.  What it
should do is keep track of files that could be unlinked if a directory
later needs to be written in their place.  However, that work also is only
relevant in the non-recursive case, so this change is helpful either way.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomerge-recursive: Remember to free generated unique path names
Elijah Newren [Fri, 12 Aug 2011 05:19:53 +0000 (23:19 -0600)]
merge-recursive: Remember to free generated unique path names

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomerge-recursive: Consolidate different update_stages functions
Elijah Newren [Fri, 12 Aug 2011 05:19:52 +0000 (23:19 -0600)]
merge-recursive: Consolidate different update_stages functions

We are only calling update_stages_options() one way really, so we can
consolidate the slightly different variants into one and remove some
parameters whose values are always the same.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomerge-recursive: Mark some diff_filespec struct arguments const
Elijah Newren [Fri, 12 Aug 2011 05:19:51 +0000 (23:19 -0600)]
merge-recursive: Mark some diff_filespec struct arguments const

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomerge-recursive: Correct a comment
Elijah Newren [Fri, 12 Aug 2011 05:19:50 +0000 (23:19 -0600)]
merge-recursive: Correct a comment

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agomerge-recursive: Make BUG message more legible by adding a newline
Elijah Newren [Fri, 12 Aug 2011 05:19:49 +0000 (23:19 -0600)]
merge-recursive: Make BUG message more legible by adding a newline

Hopefully no one ever hits this error except when making large changes to
merge-recursive.c and debugging...

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6022: Add testcase for merging a renamed file with a simple change
Elijah Newren [Fri, 12 Aug 2011 05:19:48 +0000 (23:19 -0600)]
t6022: Add testcase for merging a renamed file with a simple change

This is a testcase that was broken by b2c8c0a (merge-recursive: When we
detect we can skip an update, actually skip it 2011-02-28) and fixed by
6db4105 (Revert "Merge branch 'en/merge-recursive'" 2011-05-19).  Include
this testcase to ensure we don't regress it again.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6022: New tests checking for unnecessary updates of files
Elijah Newren [Fri, 12 Aug 2011 05:19:47 +0000 (23:19 -0600)]
t6022: New tests checking for unnecessary updates of files

This testcase was part of en/merge-recursive that was reverted in 6db4105
(Revert "Merge branch 'en/merge-recursive'" 2011-05-19).  While the other
changes in that series caused unfortunate breakage, this testcase is still
useful; reinstate it.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6022: Remove unnecessary untracked files to make test cleaner
Elijah Newren [Fri, 12 Aug 2011 05:19:46 +0000 (23:19 -0600)]
t6022: Remove unnecessary untracked files to make test cleaner

Since this test later does a git add -A, we should clean out unnecessary
untracked files as part of our cleanup.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6036: criss-cross + rename/rename(1to2)/add-source + modify/modify
Elijah Newren [Fri, 12 Aug 2011 05:19:45 +0000 (23:19 -0600)]
t6036: criss-cross + rename/rename(1to2)/add-source + modify/modify

This is another challenging testcase trying to exercise the virtual merge
base creation in the rename/rename(1to2) code.  A testcase is added that
we should be able to merge cleanly, but which requires a virtual merge
base to be created that is aware of rename/rename(1to2)/add-source
conflicts and can handle those.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6036: criss-cross w/ rename/rename(1to2)/modify+rename/rename(2to1)/modify
Elijah Newren [Fri, 12 Aug 2011 05:19:44 +0000 (23:19 -0600)]
t6036: criss-cross w/ rename/rename(1to2)/modify+rename/rename(2to1)/modify

This test is mostly just designed for testing optimality of the virtual
merge base in the event of a rename/rename(1to2) conflict.  The current
choice for resolving this in git seems somewhat confusing and suboptimal.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6036: tests for criss-cross merges with various directory/file conflicts
Elijah Newren [Fri, 12 Aug 2011 05:19:43 +0000 (23:19 -0600)]
t6036: tests for criss-cross merges with various directory/file conflicts

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6036: criss-cross with weird content can fool git into clean merge
Elijah Newren [Fri, 12 Aug 2011 05:19:42 +0000 (23:19 -0600)]
t6036: criss-cross with weird content can fool git into clean merge

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6036: Add differently resolved modify/delete conflict in criss-cross test
Elijah Newren [Fri, 12 Aug 2011 05:19:41 +0000 (23:19 -0600)]
t6036: Add differently resolved modify/delete conflict in criss-cross test

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6042: Add failing testcases for rename/rename/add-{source,dest} conflicts
Elijah Newren [Fri, 12 Aug 2011 05:19:40 +0000 (23:19 -0600)]
t6042: Add failing testcases for rename/rename/add-{source,dest} conflicts

Add testcases that cover three failures with current git merge, all
involving renaming one file on both sides of history:

Case 1:
If a single file is renamed to two different filenames on different sides
of history, there should be a conflict.  Adding a new file on one of those
sides of history whose name happens to match the rename source should not
cause the merge to suddenly succeed.

Case 2:
If a single file is renamed on both sides of history but renamed
identically, there should not be a conflict.  This works fine.  However,
if one of those sides also added a new file that happened to match the
rename source, then that file should be left alone.  Currently, the
rename/rename conflict handling causes that new file to become untracked.

Case 3:
If a single file is renamed to two different filenames on different sides
of history, there should be a conflict.  This works currently.  However,
if those renames also involve rename/add conflicts (i.e. there are new
files on one side of history that match the destination of the rename of
the other side of history), then the resulting conflict should be recorded
in the index, showing that there were multiple files with a given filename.
Currently, git silently discards one of file versions.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6042: Ensure rename/rename conflicts leave index and workdir in sane state
Elijah Newren [Fri, 12 Aug 2011 05:19:39 +0000 (23:19 -0600)]
t6042: Ensure rename/rename conflicts leave index and workdir in sane state

rename/rename conflicts, both with one file being renamed to two different
files and with two files being renamed to the same file, should leave the
index and the working copy in a sane state with appropriate conflict
recording, auxiliary files, etc.  Git seems to handle one of the two cases
alright, but has some problems with the two files being renamed to one
case.  Add tests for both cases.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6042: Add tests for content issues with modify/rename/directory conflicts
Elijah Newren [Fri, 12 Aug 2011 05:19:38 +0000 (23:19 -0600)]
t6042: Add tests for content issues with modify/rename/directory conflicts

Add testcases that cover a variety of merge issues with files being
renamed and modified on different sides of history, when there are
directories possibly conflicting with the rename location.

Case 1:
On one side of history, a file is modified and a new directory is added.
On the other side of history, the file is modified in a non-conflicting
way but is renamed to the location of the new directory.

Case 2:
[Same as case 1, but there is also a content conflict.  In detail:]
On one side of history, a file is modified and a new directory is added.
On the other side of history, the file is modified in a conflicting way
and it is renamed to the location of the new directory.

Case 3:
[Similar to case 1, but the "conflicting" directory is the directory
where the file original resided.  In detail:]
On one side of history, a file is modified.  On the other side of history,
the file is modified in a non-conflicting way, but the directory it was
under is removed and the file is renamed to the location of the directory
it used to reside in (i.e. 'sub/file' gets renamed to 'sub').  This is
flagged as a directory/rename conflict, but should be able to be resolved
since the directory can be cleanly removed by the merge.

One branch renames a file and makes a file where the directory the renamed
file used to be in, and the other branch updates the file in
place. Merging them should resolve it cleanly as long as the content level
change on the branches do not overlap and rename is detected, or should
leave conflict without losing information.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6042: Add a testcase where undetected rename causes silent file deletion
Elijah Newren [Fri, 12 Aug 2011 05:19:37 +0000 (23:19 -0600)]
t6042: Add a testcase where undetected rename causes silent file deletion

There are cases where history should merge cleanly, and which current git
does merge cleanly despite not detecting a rename; however the merge
currently nukes files that should not be removed.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6042: Add a pair of cases where undetected renames cause issues
Elijah Newren [Fri, 12 Aug 2011 05:19:36 +0000 (23:19 -0600)]
t6042: Add a pair of cases where undetected renames cause issues

An undetected rename can cause a silent success where a conflict should
have been detected, or can cause an erroneous conflict state where the
merge should have been resolvable.  Add testcases for both.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6042: Add failing testcase for rename/modify/add-source conflict
Elijah Newren [Fri, 12 Aug 2011 05:19:35 +0000 (23:19 -0600)]
t6042: Add failing testcase for rename/modify/add-source conflict

If there is a cleanly resolvable rename/modify conflict AND there is a new
file introduced on the renamed side of the merge whose name happens to
match that of the source of the rename (but is otherwise unrelated to the
rename), then git fails to cleanly resolve the merge despite the fact that
the new file should not cause any problems.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot6042: Add a testcase where git deletes an untracked file
Elijah Newren [Fri, 12 Aug 2011 05:19:34 +0000 (23:19 -0600)]
t6042: Add a testcase where git deletes an untracked file

Current git will nuke an untracked file during a rename/delete conflict if
(a) there is an untracked file whose name matches the source of a rename
and (b) the merge is done in a certain direction.  Add a simple testcase
demonstrating this bug.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agofetch: do not leak a refspec
Jim Meyering [Wed, 8 Jun 2011 20:06:33 +0000 (22:06 +0200)]
fetch: do not leak a refspec

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoStart 1.7.5.4 draft release notes
Junio C Hamano [Tue, 31 May 2011 19:06:40 +0000 (12:06 -0700)]
Start 1.7.5.4 draft release notes

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jm/maint-misc-fix' into maint
Junio C Hamano [Mon, 30 May 2011 07:09:41 +0000 (00:09 -0700)]
Merge branch 'jm/maint-misc-fix' into maint

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

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

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

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

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

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

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

13 years agoconfig.mak.in: allow "configure --sysconfdir=/else/where"
Junio C Hamano [Thu, 5 May 2011 01:50:45 +0000 (18:50 -0700)]
config.mak.in: allow "configure --sysconfdir=/else/where"

We do allow vanilla Makefile users to say make sysconfdir=/else/where
and config.mak can also be tweaked manually for the same effect. Give
the same configurablity to ./configure users as well.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodocs: fix some antique example output
Jeff King [Fri, 27 May 2011 02:33:15 +0000 (22:33 -0400)]
docs: fix some antique example output

These diff-index and diff-tree sample outputs date back to
the first month of git's existence. The output format has
changed slightly since then, so let's have it match the
current output.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodocs: make sure literal "->" isn't converted to arrow
Jeff King [Fri, 27 May 2011 02:32:41 +0000 (22:32 -0400)]
docs: make sure literal "->" isn't converted to arrow

Recent versions of asciidoc will treat "->" as a
single-glyph arrow symbol, unless it is inside a literal
code block. This is a problem if we are discussing literal
output and want to show the ASCII characters.

Our usage falls into three categories:

  1. Inside a code block. These can be left as-is.

  2. Discussing literal output or code, but inside a
     paragraph. This patch escapes these as "\->".

  3. Using the arrow as a symbolic element, such as "use the
     Edit->Account Settings menu". In this case, the
     arrow symbol is preferable, so we leave it as-is.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodocs: update status --porcelain format
Jeff King [Fri, 27 May 2011 02:31:51 +0000 (22:31 -0400)]
docs: update status --porcelain format

The --porcelain format was originally identical to the
--short format, but designed to be stable as the short
format changed. Since this was written, the short format
picked up a few incompatible niceties, but this description
was never changed.

Let's mention the differences. While we're at it, let's add
some sub-section headings to make the "output" section a
little easier to navigate.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodocs: minor grammar fixes to git-status
Jeff King [Fri, 27 May 2011 02:31:11 +0000 (22:31 -0400)]
docs: minor grammar fixes to git-status

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-submodule.sh: separate parens by a space to avoid confusing some shells
Brandon Casey [Thu, 26 May 2011 20:52:04 +0000 (13:52 -0700)]
git-submodule.sh: separate parens by a space to avoid confusing some shells

Some shells interpret '(( ))' according to the rules for arithmetic
expansion.  This may not follow POSIX, but is prevalent in commonly used
shells.  Bash does not have a problem with this particular instance of
'((', likely because it is not followed by a '))', but the public domain
ksh does, and so does ksh on IRIX 6.5.

So, add a space between the parenthesis to avoid confusing these shells.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoDocumentation/technical/api-diff.txt: correct name of diff_unmerge()
Brandon Casey [Thu, 26 May 2011 20:46:56 +0000 (13:46 -0700)]
Documentation/technical/api-diff.txt: correct name of diff_unmerge()

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoread_gitfile_gently: use ssize_t to hold read result
Jeff King [Thu, 26 May 2011 16:28:44 +0000 (12:28 -0400)]
read_gitfile_gently: use ssize_t to hold read result

Otherwise, a negative error return becomes a very large read
value. We catch this in practice because we compare the
expected and actual numbers of bytes (and you are not likely
to be reading (size_t)-1 bytes), but this makes the
correctness a little more obvious.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoremove tests of always-false condition
Jim Meyering [Thu, 26 May 2011 13:58:16 +0000 (15:58 +0200)]
remove tests of always-false condition

* fsck.c (fsck_error_function): Don't test obj->sha1 == 0.
It can never be true, since that sha1 member is an array.
* transport.c (set_upstreams): Likewise for ref->new_sha1.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agorerere.c: diagnose a corrupt MERGE_RR when hitting EOF between TAB and '\0'
Jim Meyering [Thu, 26 May 2011 13:54:18 +0000 (15:54 +0200)]
rerere.c: diagnose a corrupt MERGE_RR when hitting EOF between TAB and '\0'

If we reach EOF after the SHA1-then-TAB, yet before the NUL that
terminates each file name, we would fill the file name buffer with \255
bytes resulting from the repeatedly-failing fgetc (returns EOF/-1) and
ultimately complain about "filename too long", because no NUL was
encountered.

Signed-off-by: Jim Meyering <jim@meyering.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.7.5.3 v1.7.5.3
Junio C Hamano [Thu, 26 May 2011 16:45:29 +0000 (09:45 -0700)]
Git 1.7.5.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'maint-1.7.4' into maint
Junio C Hamano [Thu, 26 May 2011 17:29:24 +0000 (10:29 -0700)]
Merge branch 'maint-1.7.4' into maint

* maint-1.7.4:

13 years agoMerge branch 'jk/git-connection-deadlock-fix' into maint-1.7.4
Junio C Hamano [Thu, 26 May 2011 17:28:10 +0000 (10:28 -0700)]
Merge branch 'jk/git-connection-deadlock-fix' into maint-1.7.4

* jk/git-connection-deadlock-fix:
  test core.gitproxy configuration
  send-pack: avoid deadlock on git:// push with failed pack-objects
  connect: let callers know if connection is a socket
  connect: treat generic proxy processes like ssh processes

Conflicts:
connect.c

13 years agoMerge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix' into maint-1.7.4
Junio C Hamano [Thu, 26 May 2011 17:27:55 +0000 (10:27 -0700)]
Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix' into maint-1.7.4

* js/maint-send-pack-stateless-rpc-deadlock-fix:
  sideband_demux(): fix decl-after-stmt
  send-pack: unbreak push over stateless rpc
  send-pack: avoid deadlock when pack-object dies early

13 years agoMerge branch 'jk/maint-upload-pack-shallow' into maint-1.7.4
Junio C Hamano [Thu, 26 May 2011 17:27:29 +0000 (10:27 -0700)]
Merge branch 'jk/maint-upload-pack-shallow' into maint-1.7.4

* jk/maint-upload-pack-shallow:
  upload-pack: start pack-objects before async rev-list

13 years agoMerge branch 'jm/maint-diff-words-with-sbe' into maint
Junio C Hamano [Thu, 26 May 2011 16:43:00 +0000 (09:43 -0700)]
Merge branch 'jm/maint-diff-words-with-sbe' into maint

* jm/maint-diff-words-with-sbe:
  do not read beyond end of malloc'd buffer

13 years agoMerge branch 'kk/maint-prefix-in-config-mak' into maint
Junio C Hamano [Thu, 26 May 2011 16:42:12 +0000 (09:42 -0700)]
Merge branch 'kk/maint-prefix-in-config-mak' into maint

* kk/maint-prefix-in-config-mak:
  Honor $(prefix) set in config.mak* when defining ETC_GIT*
  Revert "Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir"
  Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir

13 years agoMerge branch 'mg/diff-uiconfig-doc' into maint
Junio C Hamano [Thu, 26 May 2011 16:41:11 +0000 (09:41 -0700)]
Merge branch 'mg/diff-uiconfig-doc' into maint

* mg/diff-uiconfig-doc:
  config.txt,diff-options.txt: porcelain vs. plumbing for color.diff

13 years agoMerge branch 'ft/gitweb-tar-with-gzip-n' into maint
Junio C Hamano [Thu, 26 May 2011 16:40:50 +0000 (09:40 -0700)]
Merge branch 'ft/gitweb-tar-with-gzip-n' into maint

* ft/gitweb-tar-with-gzip-n:
  gitweb: supply '-n' to gzip for identical output

13 years agoMerge branch 'ss/doc-svn' into maint
Junio C Hamano [Thu, 26 May 2011 16:39:40 +0000 (09:39 -0700)]
Merge branch 'ss/doc-svn' into maint

* ss/doc-svn:
  remove noise and inaccuracies from git-svn docs

13 years agoMerge branch 'jn/format-patch-doc' into maint
Junio C Hamano [Thu, 26 May 2011 16:39:33 +0000 (09:39 -0700)]
Merge branch 'jn/format-patch-doc' into maint

* jn/format-patch-doc:
  Documentation/format-patch: suggest Toggle Word Wrap add-on for Thunderbird
  Documentation: publicize hints for sending patches with GMail
  Documentation: publicize KMail hints for sending patches inline
  Documentation: hints for sending patches inline with Thunderbird
  Documentation: explain how to check for patch corruption

13 years agoMerge branch 'jc/maint-pathspec-stdin-and-cmdline' into maint
Junio C Hamano [Thu, 26 May 2011 16:38:44 +0000 (09:38 -0700)]
Merge branch 'jc/maint-pathspec-stdin-and-cmdline' into maint

* jc/maint-pathspec-stdin-and-cmdline:
  setup_revisions(): take pathspec from command line and --stdin correctly

13 years agoMerge branch 'jk/cherry-pick-root-with-resolve' into maint
Junio C Hamano [Thu, 26 May 2011 16:37:41 +0000 (09:37 -0700)]
Merge branch 'jk/cherry-pick-root-with-resolve' into maint

* jk/cherry-pick-root-with-resolve:
  t3503: test cherry picking and reverting root commits
  revert: allow reverting a root commit
  cherry-pick: handle root commits with external strategies

13 years agoMerge branch 'rg/copy-gecos-username' into maint
Junio C Hamano [Thu, 26 May 2011 16:37:04 +0000 (09:37 -0700)]
Merge branch 'rg/copy-gecos-username' into maint

* rg/copy-gecos-username:
  copy_gecos: fix not adding nlen to len when processing "&"

13 years agoMerge branch 'fc/completion-zsh' into maint
Junio C Hamano [Thu, 26 May 2011 16:36:33 +0000 (09:36 -0700)]
Merge branch 'fc/completion-zsh' into maint

* fc/completion-zsh:
  git-completion: fix regression in zsh support

13 years agoMerge branch 'jk/git-connection-deadlock-fix' into maint
Junio C Hamano [Thu, 26 May 2011 16:33:25 +0000 (09:33 -0700)]
Merge branch 'jk/git-connection-deadlock-fix' into maint

* jk/git-connection-deadlock-fix:
  test core.gitproxy configuration
  send-pack: avoid deadlock on git:// push with failed pack-objects
  connect: let callers know if connection is a socket
  connect: treat generic proxy processes like ssh processes

Conflicts:
connect.c

13 years agoMerge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix' into maint
Junio C Hamano [Thu, 26 May 2011 16:32:14 +0000 (09:32 -0700)]
Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix' into maint

* js/maint-send-pack-stateless-rpc-deadlock-fix:
  sideband_demux(): fix decl-after-stmt
  send-pack: unbreak push over stateless rpc
  send-pack: avoid deadlock when pack-object dies early

13 years agoMerge branch 'svn-fe-maint' of git://repo.or.cz/git/jrn into maint
Junio C Hamano [Thu, 26 May 2011 15:52:11 +0000 (08:52 -0700)]
Merge branch 'svn-fe-maint' of git://repo.or.cz/git/jrn into maint

* 'svn-fe-maint' of git://repo.or.cz/git/jrn:
  Revert "t0081 (line-buffer): add buffering tests"

13 years agouserformat_find_requirements(): find requirement for the correct format
Junio C Hamano [Wed, 25 May 2011 19:23:44 +0000 (12:23 -0700)]
userformat_find_requirements(): find requirement for the correct format

This function was introduced in 5b16360 (pretty: Initialize notes if %N is
used, 2010-04-13) to check what kind of information the "log --format=..."
user format string wants. The function can be passed a NULL instead of a
format string to ask it to check user_format variable kept by an earlier
call to save_user_format().

But it unconditionally checked user_format and not the string it was
given.  The only caller introduced by the change passes NULL, which
kept the bug unnoticed, until a new GCC noticed that there is an
assignment to fmt that is never used.

Noticed-by: Chris Wilson's compiler
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Jeff King <peff@peff.net>
13 years agoinit/clone: remove short option -L and document --separate-git-dir
Nguyen Thai Ngoc Duy [Tue, 24 May 2011 16:40:32 +0000 (23:40 +0700)]
init/clone: remove short option -L and document --separate-git-dir

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agohandle_options(): do not miscount how many arguments were used
Junio C Hamano [Tue, 24 May 2011 22:50:35 +0000 (18:50 -0400)]
handle_options(): do not miscount how many arguments were used

The handle_options() function advances the base of the argument array and
returns the number of arguments it used. The caller in handle_alias()
wants to reallocate the argv array it passes to this function, and
attempts to do so by subtracting the returned value to compensate for the
change handle_options() makes to the new_argv.

But handle_options() did not correctly count when "-c <config=value>" is
given, causing a wrong pointer to be passed to realloc().

Fix it by saving the original argv at the beginning of handle_options(),
and return the difference between the final value of argv, which will
relieve the places that move the array pointer from the additional burden
of keeping track of "handled" counter.

Noticed-by: Kazuki Tsujimoto
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoconfig: always parse GIT_CONFIG_PARAMETERS during git_config
Jeff King [Tue, 24 May 2011 22:49:55 +0000 (18:49 -0400)]
config: always parse GIT_CONFIG_PARAMETERS during git_config

Previously we parsed GIT_CONFIG_PARAMETERS lazily into a
linked list, and then checked that list during future
invocations of git_config. However, that ignores the fact
that the environment variable could change during our run
(e.g., because we parse more "-c" as part of an alias).

Instead, let's just re-parse the environment variable each
time. It's generally not very big, and it's no more work
than parsing the config files, anyway.

As a bonus, we can ditch all of the linked list storage code
entirely, making the code much simpler.

The test unfortunately still does not pass because of an
unrelated bug in handle_options.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit_config: don't peek at global config_parameters
Jeff King [Tue, 24 May 2011 22:49:45 +0000 (18:49 -0400)]
git_config: don't peek at global config_parameters

The config_parameters list in config.c is an implementation
detail of git_config_from_parameters; instead, that function
should tell us whether it found anything.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoconfig: make environment parsing routines static
Jeff King [Tue, 24 May 2011 22:49:36 +0000 (18:49 -0400)]
config: make environment parsing routines static

Nobody outside of git_config_from_parameters should need
to use the GIT_CONFIG_PARAMETERS parsing functions, so let's
make them private.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agodo not read beyond end of malloc'd buffer
Jim Meyering [Fri, 20 May 2011 17:20:12 +0000 (19:20 +0200)]
do not read beyond end of malloc'd buffer

With diff.suppress-blank-empty=true, "git diff --word-diff" would
output data that had been read from uninitialized heap memory.
The problem was that fn_out_consume did not account for the
possibility of a line with length 1, i.e., the empty context line
that diff.suppress-blank-empty=true converts from " \n" to "\n".
Since it assumed there would always be a prefix character (the space),
it decremented "len" unconditionally, thus passing len=0 to emit_line,
which would then blindly call emit_line_0 with len=-1 which would
pass that value on to fwrite as SIZE_MAX.  Boom.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agogit-svn: Fix git svn log --show-commit
Michael J Gruber [Fri, 20 May 2011 11:16:34 +0000 (13:16 +0200)]
git-svn: Fix git svn log --show-commit

git svn log --show-commit had no tests and, consequently, no attention
by the author of

b1b4755 (git-log: put space after commit mark, 2011-03-10)

who kept git svn log working only without --show-commit.

Introduce a test and fix it.

Reported-by: Bernt Hansen <bernt@norang.ca>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoGit 1.7.5.2 v1.7.5.2
Junio C Hamano [Fri, 20 May 2011 03:30:44 +0000 (20:30 -0700)]
Git 1.7.5.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoprovide a copy of the LGPLv2.1
Jonathan Nieder [Thu, 19 May 2011 15:14:25 +0000 (10:14 -0500)]
provide a copy of the LGPLv2.1

The LGPL seems to require providing a copy of the license when
distributing xdiff, compat/fnmatch, and so on, or altering the license
notices to refer to the GPL intead.  Since we don't want to do the
latter, let's do the former.  It's nice to let people know their
rights anyway.

Inspired-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agotest core.gitproxy configuration
Jeff King [Wed, 18 May 2011 08:57:44 +0000 (04:57 -0400)]
test core.gitproxy configuration

This is just a basic sanity test to see whether
core.gitproxy works at all. Until now, we were not testing
anywhere.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agocopy_gecos: fix not adding nlen to len when processing "&"
Rafael Gieschke [Mon, 16 May 2011 20:08:21 +0000 (22:08 +0200)]
copy_gecos: fix not adding nlen to len when processing "&"

nlen has to be added to len when inserting (capitalized) pw_name as
substitution for "&" in pw_gecos. Otherwise, pw_gecos will be truncated
and data might be written beyond name+sz.

Signed-off-by: Rafael Gieschke <rafael@gieschke.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoadd -i: ignore terminal escape sequences
Thomas Rast [Tue, 17 May 2011 15:19:08 +0000 (17:19 +0200)]
add -i: ignore terminal escape sequences

On the author's terminal, the up-arrow input sequence is ^[[A, and
thus fat-fingering an up-arrow into 'git checkout -p' is quite
dangerous: git-add--interactive.perl will ignore the ^[ and [
characters and happily treat A as "discard everything".

As a band-aid fix, use Term::Cap to get all terminal capabilities.
Then use the heuristic that any capability value that starts with ^[
(i.e., \e in perl) must be a key input sequence.  Finally, given an
input that starts with ^[, read more characters until we have read a
full escape sequence, then return that to the caller.  We use a
timeout of 0.5 seconds on the subsequent reads to avoid getting stuck
if the user actually input a lone ^[.

Since none of the currently recognized keys start with ^[, the net
result is that the sequence as a whole will be ignored and the help
displayed.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix' into js/maint...
Junio C Hamano [Tue, 17 May 2011 00:01:03 +0000 (17:01 -0700)]
Merge branch 'js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix' into js/maint-send-pack-stateless-rpc-deadlock-fix

* js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix:
  sideband_demux(): fix decl-after-stmt

13 years agoUpdate draft release notes to 1.7.5.2
Junio C Hamano [Mon, 16 May 2011 23:44:50 +0000 (16:44 -0700)]
Update draft release notes to 1.7.5.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoMerge branch 'jn/maint-format-patch-doc' into maint
Junio C Hamano [Mon, 16 May 2011 23:39:09 +0000 (16:39 -0700)]
Merge branch 'jn/maint-format-patch-doc' into maint

* jn/maint-format-patch-doc:
  Documentation: describe the format of messages with inline patches

13 years agoMerge branch 'ss/cherry-pick-x-doc' into maint
Junio C Hamano [Mon, 16 May 2011 23:38:56 +0000 (16:38 -0700)]
Merge branch 'ss/cherry-pick-x-doc' into maint

* ss/cherry-pick-x-doc:
  doc: Clarify that "cherry-pick -x" does not use "git notes"

13 years agoMerge branch 'vr/merge-base-doc' into maint
Junio C Hamano [Mon, 16 May 2011 23:38:46 +0000 (16:38 -0700)]
Merge branch 'vr/merge-base-doc' into maint

* vr/merge-base-doc:
  Restructure documentation for git-merge-base.
  Documentation: update to git-merge-base --octopus

13 years agoMerge branch 'sr/maint-fast-import-tighten-option-parsing' into maint
Junio C Hamano [Mon, 16 May 2011 23:38:16 +0000 (16:38 -0700)]
Merge branch 'sr/maint-fast-import-tighten-option-parsing' into maint

* sr/maint-fast-import-tighten-option-parsing:
  fast-import: fix option parser for no-arg options

13 years agoMerge branch 'jc/t1506-shell-param-expansion-gotcha' into maint
Junio C Hamano [Mon, 16 May 2011 23:37:54 +0000 (16:37 -0700)]
Merge branch 'jc/t1506-shell-param-expansion-gotcha' into maint

* jc/t1506-shell-param-expansion-gotcha:
  t1507: avoid "${parameter<op>'word'}" inside double-quotes

13 years agoMerge branch 'jc/fix-add-u-unmerged' into maint
Junio C Hamano [Mon, 16 May 2011 23:37:33 +0000 (16:37 -0700)]
Merge branch 'jc/fix-add-u-unmerged' into maint

* jc/fix-add-u-unmerged:
  Fix "add -u" that sometimes fails to resolve unmerged paths

Conflicts:
builtin/add.c

13 years agoMerge branch 'jn/gitweb-dependency' into maint
Junio C Hamano [Mon, 16 May 2011 23:37:12 +0000 (16:37 -0700)]
Merge branch 'jn/gitweb-dependency' into maint

* jn/gitweb-dependency:
  Remove gitweb/gitweb.cgi and other legacy targets from main Makefile
  git-instaweb: Simplify build dependency on gitweb

13 years agoMerge branch 'jc/maint-branch-mergeoptions' into maint
Junio C Hamano [Mon, 16 May 2011 23:37:07 +0000 (16:37 -0700)]
Merge branch 'jc/maint-branch-mergeoptions' into maint

* jc/maint-branch-mergeoptions:
  merge: make branch.<name>.mergeoptions correctly override merge.<option>

Conflicts:
builtin/merge.c

13 years agoMerge branch 'jc/maint-add-p-overlapping-hunks' into maint
Junio C Hamano [Mon, 16 May 2011 23:36:46 +0000 (16:36 -0700)]
Merge branch 'jc/maint-add-p-overlapping-hunks' into maint

* jc/maint-add-p-overlapping-hunks:
  t3701: add-p-fix makes the last test to pass
  "add -p": work-around an old laziness that does not coalesce hunks
  add--interactive.perl: factor out repeated --recount option
  t3701: Editing a split hunk in an "add -p" session
  add -p: 'q' should really quit

13 years agoDocumentation/git-fsck.txt: fix typo: unreadable -> unreachable
Jim Meyering [Mon, 16 May 2011 18:23:35 +0000 (20:23 +0200)]
Documentation/git-fsck.txt: fix typo: unreadable -> unreachable

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosend-pack: avoid deadlock on git:// push with failed pack-objects
Jeff King [Mon, 16 May 2011 06:52:57 +0000 (02:52 -0400)]
send-pack: avoid deadlock on git:// push with failed pack-objects

Commit 09c9957c fixes a deadlock in which pack-objects
fails, the remote end is still waiting for pack data, and we
are still waiting for the remote end to say something (see
that commit for a much more in-depth explanation).

We solved the problem there by making sure the output pipe
is closed on error; thus the remote sees EOF, and proceeds
to complain and close its end of the connection.

However, in the special case of push over git://, we don't
have a pipe, but rather a full-duplex socket, with another
dup()-ed descriptor in place of the second half of the pipe.
In this case, closing the second descriptor signals nothing
to the remote end, and we still deadlock.

This patch calls shutdown() explicitly to signal EOF to the
other side.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoconnect: let callers know if connection is a socket
Jeff King [Mon, 16 May 2011 06:52:11 +0000 (02:52 -0400)]
connect: let callers know if connection is a socket

They might care because they want to do a half-duplex close.
With pipes, that means simply closing the output descriptor;
with a socket, you must actually call shutdown.

Instead of exposing the magic no_fork child_process struct,
let's encapsulate the test in a function.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agoconnect: treat generic proxy processes like ssh processes
Jeff King [Mon, 16 May 2011 06:46:07 +0000 (02:46 -0400)]
connect: treat generic proxy processes like ssh processes

The git_connect function returns two ends of a pipe for
talking with a remote, plus a struct child_process
representing the other end of the pipe. If we have a direct
socket connection, then this points to a special "no_fork"
child process.

The code path for doing git-over-pipes or git-over-ssh sets
up this child process to point to the child git command or
the ssh process. When we call finish_connect eventually, we
check wait() on the command and report its return value.

The code path for git://, on the other hand, always sets it
to no_fork. In the case of a direct TCP connection, this
makes sense; we have no child process. But in the case of a
proxy command (configured by core.gitproxy), we do have a
child process, but we throw away its pid, and therefore
ignore its return code.

Instead, let's keep that information in the proxy case, and
respect its return code, which can help catch some errors
(though depending on your proxy command, it will be errors
reported by the proxy command itself, and not propagated
from git commands. Still, it is probably better to propagate
such errors than to ignore them).

It also means that the child_process field can reliably be
used to determine whether the returned descriptors are
actually a full-duplex socket, which means we should be
using shutdown() instead of a simple close.

Signed-off-by: Jeff King <peff@peff.net>
Helped-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agosideband_demux(): fix decl-after-stmt
Junio C Hamano [Mon, 16 May 2011 23:19:49 +0000 (16:19 -0700)]
sideband_demux(): fix decl-after-stmt

Signed-off-by: Junio C Hamano <gitster@pobox.com>
13 years agot3503: test cherry picking and reverting root commits
Jeff King [Thu, 12 May 2011 11:10:07 +0000 (07:10 -0400)]
t3503: test cherry picking and reverting root commits

We already tested cherry-picking a root commit, but only
with the internal merge-recursive strategy. Let's also test
the recently-allowed reverting of a root commit, as well as
testing with external strategies (which until recently
triggered a segfault).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>