Code

git.git
14 years agofmt-merge-msg: hide summary option
Stephen Boyd [Wed, 24 Mar 2010 07:16:04 +0000 (00:16 -0700)]
fmt-merge-msg: hide summary option

The --summary command line option has been deprecated in favor of --log.
Hide the option from the help message to further discourage the use of
this option.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofmt-merge-msg: remove custom string_list implementation
Stephen Boyd [Wed, 24 Mar 2010 07:16:03 +0000 (00:16 -0700)]
fmt-merge-msg: remove custom string_list implementation

This command uses a custom version of string list when it could
just as easily use the string_list API. Convert it to use string_list
and reduce the code size a bit.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agostring-list: add unsorted_string_list_lookup()
Stephen Boyd [Wed, 24 Mar 2010 07:16:02 +0000 (00:16 -0700)]
string-list: add unsorted_string_list_lookup()

Sometimes users need to lookup a string in an unsorted string_list. In
that case they should use this function instead of the version for
sorted strings.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofmt-merge-msg: use pretty.c routines
Stephen Boyd [Wed, 24 Mar 2010 07:16:01 +0000 (00:16 -0700)]
fmt-merge-msg: use pretty.c routines

This command duplicates functionality of the '%s' pretty format.
Simplify the code a bit by using the pretty printing routine
instead of open-coding it here.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot6200: test fmt-merge-msg more
Stephen Boyd [Wed, 24 Mar 2010 07:16:00 +0000 (00:16 -0700)]
t6200: test fmt-merge-msg more

Add some more tests so we don't break behavior upon modernizing
fmt-merge-msg.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot6200: modernize with test_tick
Stephen Boyd [Wed, 24 Mar 2010 07:15:59 +0000 (00:15 -0700)]
t6200: modernize with test_tick

This test defines its own version of test_tick. Get rid of it.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofmt-merge-msg: be quiet if nothing to merge
Stephen Boyd [Wed, 24 Mar 2010 07:15:58 +0000 (00:15 -0700)]
fmt-merge-msg: be quiet if nothing to merge

When FETCH_HEAD contains only 'not-for-merge' entries fmt-merge-msg
still outputs "Merge" (and if the branch isn't master " into <branch>").
In this case fmt-merge-msg is outputting junk and should really just
be quiet. Fix it.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff --check: honor conflict-marker-size attribute
Junio C Hamano [Thu, 25 Mar 2010 02:21:32 +0000 (19:21 -0700)]
diff --check: honor conflict-marker-size attribute

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jh/maint-submodule-status-in-void'
Junio C Hamano [Wed, 24 Mar 2010 23:55:37 +0000 (16:55 -0700)]
Merge branch 'jh/maint-submodule-status-in-void'

* jh/maint-submodule-status-in-void:
  git submodule summary: Handle HEAD as argument when on an unborn branch
  submodule summary: do not fail before the first commit

14 years agoMerge branch 'tr/notes-display'
Junio C Hamano [Wed, 24 Mar 2010 23:26:43 +0000 (16:26 -0700)]
Merge branch 'tr/notes-display'

* tr/notes-display:
  git-notes(1): add a section about the meaning of history
  notes: track whether notes_trees were changed at all
  notes: add shorthand --ref to override GIT_NOTES_REF
  commit --amend: copy notes to the new commit
  rebase: support automatic notes copying
  notes: implement helpers needed for note copying during rewrite
  notes: implement 'git notes copy --stdin'
  rebase -i: invoke post-rewrite hook
  rebase: invoke post-rewrite hook
  commit --amend: invoke post-rewrite hook
  Documentation: document post-rewrite hook
  Support showing notes from more than one notes tree
  test-lib: unset GIT_NOTES_REF to stop it from influencing tests

Conflicts:
git-am.sh
refs.c

14 years agoMerge branch 'jl/submodule-diff-dirtiness'
Junio C Hamano [Wed, 24 Mar 2010 23:25:43 +0000 (16:25 -0700)]
Merge branch 'jl/submodule-diff-dirtiness'

* jl/submodule-diff-dirtiness:
  git status: ignoring untracked files must apply to submodules too
  git status: Fix false positive "new commits" output for dirty submodules
  Refactor dirty submodule detection in diff-lib.c
  git status: Show detailed dirty status of submodules in long format
  git diff --submodule: Show detailed dirty status of submodules

14 years agoMerge branch 'pb/log-first-parent-p-m'
Junio C Hamano [Wed, 24 Mar 2010 23:25:39 +0000 (16:25 -0700)]
Merge branch 'pb/log-first-parent-p-m'

* pb/log-first-parent-p-m:
  show --first-parent/-m: do not default to --cc
  show -c: show patch text
  revision: introduce setup_revision_opt
  t4013: add tests for log -p -m --first-parent
  git log -p -m: document -m and honor --first-parent

14 years agoMerge branch 'jc/maint-refs-dangling'
Junio C Hamano [Wed, 24 Mar 2010 23:25:34 +0000 (16:25 -0700)]
Merge branch 'jc/maint-refs-dangling'

* jc/maint-refs-dangling:
  refs: ref entry with NULL sha1 is can be a dangling symref

14 years agoMerge branch 'maint'
Junio C Hamano [Wed, 24 Mar 2010 23:24:21 +0000 (16:24 -0700)]
Merge branch 'maint'

* maint:
  Documentation: explain the meaning of "-g" in git-describe output

14 years agoMerge branch 'jc/color-attrs' into maint
Junio C Hamano [Wed, 24 Mar 2010 23:24:13 +0000 (16:24 -0700)]
Merge branch 'jc/color-attrs' into maint

* jc/color-attrs:
  color: allow multiple attributes

14 years agoMerge branch 'jk/maint-add-ignored-dir' into maint
Junio C Hamano [Wed, 24 Mar 2010 23:24:03 +0000 (16:24 -0700)]
Merge branch 'jk/maint-add-ignored-dir' into maint

* jk/maint-add-ignored-dir:
  tests for "git add ignored-dir/file" without -f
  dir: fix COLLECT_IGNORED on excluded prefixes
  t0050: mark non-working test as such

14 years agoMerge branch 'bg/apply-fix-blank-at-eof' into maint
Junio C Hamano [Wed, 24 Mar 2010 23:23:50 +0000 (16:23 -0700)]
Merge branch 'bg/apply-fix-blank-at-eof' into maint

* bg/apply-fix-blank-at-eof:
  t3417: Add test cases for "rebase --whitespace=fix"
  t4124: Add additional tests of --whitespace=fix
  apply: Allow blank context lines to match beyond EOF
  apply: Remove the quick rejection test
  apply: Don't unnecessarily update line lengths in the preimage

14 years agoTeach rebase the --no-ff option.
Marc Branchaud [Wed, 24 Mar 2010 20:34:04 +0000 (16:34 -0400)]
Teach rebase the --no-ff option.

For git-rebase.sh, --no-ff is a synonym for --force-rebase.

For git-rebase--interactive.sh, --no-ff cherry-picks all the commits in
the rebased branch, instead of fast-forwarding over any unchanged commits.

--no-ff offers an alternative way to deal with reverted merges.  Instead of
"reverting the revert" you can use "rebase --no-ff" to recreate the branch
with entirely new commits (they're new because at the very least the
committer time is different).  This obviates the need to revert the
reversion, as you can re-merge the new topic branch directly.  Added an
addendum to revert-a-faulty-merge.txt describing the situation and how to
use --no-ff to handle it.

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohttp-backend: Don't infinite loop during die()
Shawn O. Pearce [Mon, 22 Mar 2010 14:22:04 +0000 (07:22 -0700)]
http-backend: Don't infinite loop during die()

If stdout has already been closed by the CGI and die() gets called,
the CGI will fail to write the "Status: 500 Internal Server Error" to
the pipe, which results in die() being called again (via safe_write).
This goes on in an infinite loop until the stack overflows and the
process is killed by SIGSEGV.

Instead set a flag on the first die() invocation and if we came back to
the handler, just die silently, as it only means we failed to report the
failure---we cannot report anything anyway in such a case.  This way
failures to write the error messages to the stdout pipe do not result in
an infinite loop.

We also now report on the death to stderr before we report to stdout,
to increase the chances that the cause of the die() invocation will
appear in the server's error log.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fixup! http-backend.c: Don't infinite loop

Now die_webcgi() actually can return during a recursive call into it,
causing

    http-backend.c:554: error: 'noreturn' function does return

The only reason we would come back to the die handler is because we
failed during it, so we cannot report anything anyway.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoCorrect references to /usr/bin/python which does not exist on FreeBSD
R. Tyler Ballance [Sun, 21 Mar 2010 19:01:50 +0000 (12:01 -0700)]
Correct references to /usr/bin/python which does not exist on FreeBSD

On FreeBSD, Python does not ship as part of the base system but is available
via the ports system, which install the binary in /usr/local/bin.

Signed-off-by: R. Tyler Ballance <tyler@monkeypox.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: explain the meaning of "-g" in git-describe output
Markus Heidelberg [Mon, 22 Mar 2010 20:45:33 +0000 (21:45 +0100)]
Documentation: explain the meaning of "-g" in git-describe output

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorev-list: use default abbrev length when abbrev-commit is in effect
Michael J Gruber [Mon, 22 Mar 2010 13:36:30 +0000 (14:36 +0100)]
rev-list: use default abbrev length when abbrev-commit is in effect

Currently, rev-list has a default of "0" for abbrev which means that
switching on abbreviations with --abbrev-commit has no visible effect,
even though the option is documented.

Set abbrev to DEFAULT_ABBREV so that --abbrev-commit has the same effect
as for log.

Reported-by: Eli Barzilay <eli@barzilay.org>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoimap-send: Remove limitation on message body
Ramkumar Ramachandra [Mon, 22 Mar 2010 18:07:52 +0000 (23:37 +0530)]
imap-send: Remove limitation on message body

There is a documented limitation on the body of any email not being
able to contain lines starting with "From ". This patch removes that
limitation by improving the parser to search for "From", "Date", and
"Subject" fields in the email before considering it to be an email.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoSync with Git 1.7.0.3
Junio C Hamano [Mon, 22 Mar 2010 00:01:55 +0000 (17:01 -0700)]
Sync with Git 1.7.0.3

* maint:
  Git 1.7.0.3
  .mailmap: Map the the first submissions of MJG by e-mail
  Documentation/git-clone: Transform description list into item list
  Documentation/urls: Remove spurious example markers
  Documentation/gitdiffcore: Remove misleading date in heading
  Documentation/git-reflog: Fix formatting of command lists

14 years agoGit 1.7.0.3 v1.7.0.3
Junio C Hamano [Mon, 22 Mar 2010 00:01:22 +0000 (17:01 -0700)]
Git 1.7.0.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint-1.6.6' into maint
Junio C Hamano [Mon, 22 Mar 2010 00:00:22 +0000 (17:00 -0700)]
Merge branch 'maint-1.6.6' into maint

* maint-1.6.6:
  Documentation/git-clone: Transform description list into item list
  Documentation/urls: Remove spurious example markers
  Documentation/gitdiffcore: Remove misleading date in heading
  Documentation/git-reflog: Fix formatting of command lists

14 years ago.mailmap: Map the the first submissions of MJG by e-mail
Michael J Gruber [Sun, 21 Mar 2010 13:43:47 +0000 (14:43 +0100)]
.mailmap: Map the the first submissions of MJG by e-mail

so that git shortlog with '-e' coalesces all my commits.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agols: remove redundant logic
Erik Faye-Lund [Sat, 20 Mar 2010 18:55:28 +0000 (19:55 +0100)]
ls: remove redundant logic

find_unique_abbrev() already returns the full SHA-1 if abbrev = 0,
so we can remove the logic that avoids the call.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocherry: support --abbrev option
Erik Faye-Lund [Sat, 20 Mar 2010 18:55:27 +0000 (19:55 +0100)]
cherry: support --abbrev option

Switch to parse-options API while we're at it.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/git-clone: Transform description list into item list
Michael J Gruber [Sun, 21 Mar 2010 17:30:19 +0000 (18:30 +0100)]
Documentation/git-clone: Transform description list into item list

so that the list of examples is formatted in the same way as for
git-fetch, and, more importantly, the different identation for the
code blocks in the examples (compared to the immediately preceding code
blocks from url.txt) doesn't look like misformatted, but is clarified by
the items' bullets.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/urls: Remove spurious example markers
Michael J Gruber [Sun, 21 Mar 2010 17:30:18 +0000 (18:30 +0100)]
Documentation/urls: Remove spurious example markers

In urls.txt (which is included from git-{clone,fetch,push}.txt)
several item lists are surrounded by example block markers. This is
problematic for two reasons:

- None of these lists are example lists, so they should not be marked as
  such semantically.
- The html output looks weird (bulleted list with left sidebar).

Therefore, remove the example block markers. Output by the man backend
is unaffected.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/gitdiffcore: Remove misleading date in heading
Michael J Gruber [Sun, 21 Mar 2010 17:30:17 +0000 (18:30 +0100)]
Documentation/gitdiffcore: Remove misleading date in heading

Ever since the automatic conversion into man form, the heading
contained a misidentified subheading reading "June 2005".
Remove this since the documentation is more recent, and the correct
date is in the footer.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/git-reflog: Fix formatting of command lists
Michael J Gruber [Sun, 21 Mar 2010 17:30:16 +0000 (18:30 +0100)]
Documentation/git-reflog: Fix formatting of command lists

A misplaced list continuation mark appears literally in the
rendered doc. Fix this by removing it.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorev-list: fix --pretty=oneline with empty message
Erik Faye-Lund [Sun, 21 Mar 2010 14:40:16 +0000 (15:40 +0100)]
rev-list: fix --pretty=oneline with empty message

55246aa (Dont use "<unknown>" for placeholders and suppress printing
of empty user formats) introduced a check to prevent empty
user-formats from being printed. This test didn't take empty commit
messages into account, and prevented the line-termination from being
output. This lead to multiple commits on a single line.

Correct it by guarding the check with a check for user-format. A
similar correction for the --graph code-path has been included.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge-recursive: add a label for ancestor
Jonathan Nieder [Sun, 21 Mar 2010 00:52:21 +0000 (19:52 -0500)]
merge-recursive: add a label for ancestor

git merge-recursive (and hence git merge) will present conflict hunks
in output something like what ‘diff3 -m’ produces if the
merge.conflictstyle configuration option is set to diff3.
There is a small difference from diff3: diff3 -m includes a label
for the merge base on the ||||||| line.

Tools familiar with the format and humans unfamiliar with the format
both can benefit from such a label.  So mark the start of the text
from the merge bases with the heading "||||||| merged common
ancestors".

It would be nicer to use a more informative label.  Perhaps someone
will provide one some day.

git rerere does not have trouble parsing the new output, and its
preimage ids are unchanged since it has its own code for re-creating
conflict hunks.  No other code in git parses conflict hunks.

Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocherry-pick, revert: add a label for ancestor
Jonathan Nieder [Sun, 21 Mar 2010 00:46:07 +0000 (19:46 -0500)]
cherry-pick, revert: add a label for ancestor

When writing conflict hunks in ‘diff3 -m’ format, also add a label to
the common ancestor.  Especially in a cherry-pick, it is not immediately
obvious without such a label what the common ancestor represents.

git rerere does not have trouble parsing the new output and its preimage
ids are unchanged since it includes its own code for recreating conflict
hunks.  No other code in git parses conflict hunks.

Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorevert: clarify label on conflict hunks
Jonathan Nieder [Sun, 21 Mar 2010 00:45:21 +0000 (19:45 -0500)]
revert: clarify label on conflict hunks

When reverting a commit, the commit being merged is not the commit
to revert itself but its parent.  Add “parent of” to the conflict
hunk label to make this more clear.

The conflict hunk labels are all pieces of a single string written in
the new get_message() function.  Avoid some complication by using
mempcpy to advance a pointer as the result is written.

Also free the corresponding temporary buffer (it was leaked before).
This is not important because it is a small one-time allocation.  It
would become a memory leak if unnoticed when libifying revert.

This patch uses calls to strlen() instead of integer constants in some
places.  GCC will compute the length at compile time; I am not sure
about other compilers, but this is not performance-critical anyway.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocompat: add mempcpy()
Jonathan Nieder [Sun, 21 Mar 2010 00:43:32 +0000 (19:43 -0500)]
compat: add mempcpy()

The mempcpy() function was added in glibc 2.1.  It is quite handy, so
add an implementation for cross-platform use.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocheckout -m --conflict=diff3: add a label for ancestor
Jonathan Nieder [Sun, 21 Mar 2010 00:42:51 +0000 (19:42 -0500)]
checkout -m --conflict=diff3: add a label for ancestor

git checkout --merge --conflict=diff3 can be used to present conflict
hunks including text from the common ancestor.  The added information
is helpful for resolving a merge by hand, and merge tools tend to
understand it because it is very similar to what ‘diff3 -m’ produces.

Unlike current git, diff3 -m includes a label for the merge base on
the ||||||| line, and unfortunately, some tools cannot parse the
conflict hunks without it.  Humans can benefit from a cue when
learning to interpreting the format, too.  Mark the start of the text
from the old branch with a label based on the branch’s name.

git rerere does not have trouble parsing this output and its preimage
ids are unchanged since it includes its own code for recreating
conflict hunks.  No other code in git tries to parse conflict hunks.

Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge_trees(): add ancestor label parameter for diff3-style output
Jonathan Nieder [Sun, 21 Mar 2010 00:41:38 +0000 (19:41 -0500)]
merge_trees(): add ancestor label parameter for diff3-style output

Commands using the merge_trees() machinery will present conflict hunks
in output something like what ‘diff3 -m’ produces if the
merge.conflictstyle configuration option is set to diff3.  The output
lacks the name of the merge base on the ||||||| line of the output,
and tools can misparse the conflict hunks without it.  Add a new
o->ancestor parameter to merge_trees() for use as a label for the
ancestor in conflict hunks.

If o->ancestor is NULL, the output format is as before.  All callers
pass NULL for now.

If o->ancestor is non-NULL and both branches renamed the base file
to the same name, that name is included in the conflict hunk labels.
Even if o->ancestor is NULL I think this would be a good change, but
this patch only does it in the non-NULL case to ensure the output
format does not change where it might matter.

Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge_file(): add comment explaining behavior wrt conflict style
Jonathan Nieder [Sun, 21 Mar 2010 00:40:53 +0000 (19:40 -0500)]
merge_file(): add comment explaining behavior wrt conflict style

The merge_file() function is a helper for ‘git read-tree’, which does
not respect the merge.conflictstyle option, so there is no need to
worry about what ancestor_name it should pass to ll_merge().  Add a
comment to this effect.

Signed-off-by: Jonathan Nieder <jrnieder@mgila.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agocheckout --conflict=diff3: add a label for ancestor
Jonathan Nieder [Sun, 21 Mar 2010 00:40:19 +0000 (19:40 -0500)]
checkout --conflict=diff3: add a label for ancestor

git checkout --conflict=diff3 can be used to present conflicts hunks
including text from the common ancestor:

<<<<<<< ours
ourside
|||||||
original
=======
theirside
>>>>>>> theirs

The added information is helpful for resolving a merge by hand, and
merge tools can usually understand it without trouble because it looks
like output from ‘diff3 -m’.

diff3 includes a label for the merge base on the ||||||| line, and it
seems some tools (for example, Emacs 22’s smerge-mode) cannot parse
conflict hunks without such a label.  Humans could use help in
interpreting the output, too.  So change the marker for the start of the
text from the common ancestor to include the label “base”.

git rerere’s conflict identifiers are not affected: to parse conflict
hunks, rerere looks for whitespace after the ||||||| marker rather
than a newline, and to compute preimage ids, rerere has its own code
for creating conflict hunks.  No other code in git tries to parse
conflict hunks.

Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoll_merge(): add ancestor label parameter for diff3-style output
Jonathan Nieder [Sun, 21 Mar 2010 00:38:58 +0000 (19:38 -0500)]
ll_merge(): add ancestor label parameter for diff3-style output

Commands using the ll_merge() function will present conflict hunks
imitating ‘diff3 -m’ output if the merge.conflictstyle configuration
option is set appropriately.  Unlike ‘diff3 -m’, the output does not
include a label for the merge base on the ||||||| line of the output,
and some tools misparse the conflict hunks without that.

Add a new ancestor_label parameter to ll_merge() to give callers the
power to rectify this situation.  If ancestor_label is NULL, the output
format is unchanged.  All callers pass NULL for now.

Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge-file --diff3: add a label for ancestor
Jonathan Nieder [Sun, 21 Mar 2010 00:37:33 +0000 (19:37 -0500)]
merge-file --diff3: add a label for ancestor

git merge-file --diff3 can be used to present conflicts hunks
including text from the common ancestor.

The added information is helpful for resolving a merge by hand, and
merge tools can usually grok it because it looks like output from
diff3 -m.  However, ‘diff3’ includes a label for the merge base on the
||||||| line and some tools cannot parse conflict hunks without such a
label.  Write the base-name as passed in a -L option (or the name of
the ancestor file by default) on that line.

git rerere will not have trouble parsing this output, since instead of
looking for a newline, it looks for whitespace after the |||||||
marker.  Since rerere includes its own code for recreating conflict
hunks, conflict identifiers are unaffected.  No other code in git tries
to parse conflict hunks.

Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoxdl_merge(): move file1 and file2 labels to xmparam structure
Jonathan Nieder [Sun, 21 Mar 2010 00:35:18 +0000 (19:35 -0500)]
xdl_merge(): move file1 and file2 labels to xmparam structure

The labels for the three participants in a potential conflict are all
optional arguments for the xdiff merge routine; if they are NULL, then
xdl_merge() can cope by omitting the labels from its output.  Move
them to the xmparam structure to allow new callers to save some
keystrokes where they are not needed.

This also has the virtue of making the xdiff merge interface more
similar to merge_trees, which might make it easier to learn.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoxdl_merge(): add optional ancestor label to diff3-style output
Jonathan Nieder [Sun, 21 Mar 2010 00:31:44 +0000 (19:31 -0500)]
xdl_merge(): add optional ancestor label to diff3-style output

The ‘git checkout --conflict=diff3’ command can be used to
present conflicts hunks including text from the common ancestor:

<<<<<<< ours
ourside
|||||||
original
=======
theirside
>>>>>>> theirs

The added information is helpful for resolving merges by hand, and
merge tools can usually grok it because it is very similar to the
output from diff3 -m.

A subtle change can help more tools to understand the output.  ‘diff3’
includes the name of the merge base on the ||||||| line of the output,
and some tools misparse the conflict hunks without it.  Add a new
xmp->ancestor parameter to xdl_merge() for use with conflict style
XDL_MERGE_DIFF3 as a label on the ||||||| line for any conflict hunks.

If xmp->ancestor is NULL, the output format is unchanged.  Thus, this
change only provides unexposed plumbing for the new feature; it does
not affect the outward behavior of git.

Requested-by: Stefan Monnier <monnier@iro.umontreal.ca>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Bert Wesarg <Bert.Wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotests: document cherry-pick behavior in face of conflicts
Jonathan Nieder [Sun, 21 Mar 2010 00:28:14 +0000 (19:28 -0500)]
tests: document cherry-pick behavior in face of conflicts

We are about to change the format of the conflict hunks that
cherry-pick and revert write.  Add tests checking the current behavior
first.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotests: document format of conflicts from checkout -m
Jonathan Nieder [Sun, 21 Mar 2010 00:27:17 +0000 (19:27 -0500)]
tests: document format of conflicts from checkout -m

We are about to change the format of the conflict hunks that ‘checkout
--merge’ writes.  Add tests checking the current behavior first.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years ago.mailmap: Entries for Alex Bennée, Deskin Miller, Vitaly "_Vi" Shukela
Michael J Gruber [Fri, 19 Mar 2010 11:02:04 +0000 (12:02 +0100)]
.mailmap: Entries for Alex Bennée, Deskin Miller, Vitaly "_Vi" Shukela

With the current .mailmap, git shortlog shows the following for these:

    11 Deskin Miller
     3 Vitaly \"_Vi\" Shukela
     1 Alex Bennee
     1 Alex Bennée
     1 Deskin Miler
     1 Vitaly _Vi Shukela

Add (e-mail based qualified) entries to .mailmap to get:

    12 Deskin Miller
     4 Vitaly "_Vi" Shukela
     2 Alex Bennée

The Shukela spelling is based on the version used consistently in the s-o-b
lines of all his patches.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorevert: fix tiny memory leak in cherry-pick --ff
Jonathan Nieder [Sun, 21 Mar 2010 02:01:20 +0000 (21:01 -0500)]
revert: fix tiny memory leak in cherry-pick --ff

We forgot to free defmsg when returning early for a fast-forward.

Fixing this should reduce noise during test suite runs with valgrind.
More importantly, once cherry-pick learns to pick multiple commits,
the amount of memory leaked would start to add up.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoUpdate draft release notes to 1.7.1
Junio C Hamano [Sat, 20 Mar 2010 18:42:34 +0000 (11:42 -0700)]
Update draft release notes to 1.7.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jk/maint-add-ignored-dir'
Junio C Hamano [Sat, 20 Mar 2010 18:29:36 +0000 (11:29 -0700)]
Merge branch 'jk/maint-add-ignored-dir'

* jk/maint-add-ignored-dir:
  tests for "git add ignored-dir/file" without -f
  dir: fix COLLECT_IGNORED on excluded prefixes
  t0050: mark non-working test as such

14 years agoMerge branch 'ml/color-grep'
Junio C Hamano [Sat, 20 Mar 2010 18:29:36 +0000 (11:29 -0700)]
Merge branch 'ml/color-grep'

* ml/color-grep:
  grep: Colorize selected, context, and function lines
  grep: Colorize filename, line number, and separator
  Add GIT_COLOR_BOLD_* and GIT_COLOR_BG_*

14 years agoMerge branch 'jc/color-attrs'
Junio C Hamano [Sat, 20 Mar 2010 18:29:36 +0000 (11:29 -0700)]
Merge branch 'jc/color-attrs'

* jc/color-attrs:
  color: allow multiple attributes

14 years agoMerge branch 'cc/reset-keep'
Junio C Hamano [Sat, 20 Mar 2010 18:29:35 +0000 (11:29 -0700)]
Merge branch 'cc/reset-keep'

* cc/reset-keep:
  Documentation: improve description of "git reset --keep"
  reset: disallow using --keep when there are unmerged entries
  reset: disallow "reset --keep" outside a work tree
  Documentation: reset: describe new "--keep" option
  reset: add test cases for "--keep" option
  reset: add option "--keep" to "git reset"

14 years agoMerge branch 'fl/askpass'
Junio C Hamano [Sat, 20 Mar 2010 18:29:35 +0000 (11:29 -0700)]
Merge branch 'fl/askpass'

* fl/askpass:
  git-core: Support retrieving passwords with GIT_ASKPASS
  git-svn: Support retrieving passwords with GIT_ASKPASS

14 years agoMerge branch 'bg/apply-fix-blank-at-eof'
Junio C Hamano [Sat, 20 Mar 2010 18:29:35 +0000 (11:29 -0700)]
Merge branch 'bg/apply-fix-blank-at-eof'

* bg/apply-fix-blank-at-eof:
  t3417: Add test cases for "rebase --whitespace=fix"
  t4124: Add additional tests of --whitespace=fix
  apply: Allow blank context lines to match beyond EOF
  apply: Remove the quick rejection test
  apply: Don't unnecessarily update line lengths in the preimage

14 years agoMerge branch 'bw/union-merge-refactor'
Junio C Hamano [Sat, 20 Mar 2010 18:29:34 +0000 (11:29 -0700)]
Merge branch 'bw/union-merge-refactor'

* bw/union-merge-refactor:
  merge-file: add option to select union merge favor
  merge-file: add option to specify the marker size
  refactor merge flags into xmparam_t
  make union merge an xdl merge favor

14 years agoMerge branch 'maint'
Junio C Hamano [Sat, 20 Mar 2010 18:29:19 +0000 (11:29 -0700)]
Merge branch 'maint'

* maint:
  Update draft release notes to 1.7.0.3
  fetch: Fix minor memory leak
  fetch: Future-proof initialization of a refspec on stack
  fetch: Check for a "^{}" suffix with suffixcmp()
  daemon: parse_host_and_port SIGSEGV if port is specified
  Makefile: Fix CDPATH problem
  pull: replace unnecessary sed invocation

14 years agoUpdate draft release notes to 1.7.0.3
Junio C Hamano [Sat, 20 Mar 2010 18:29:13 +0000 (11:29 -0700)]
Update draft release notes to 1.7.0.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorebase -i: use new --ff cherry-pick option
Christian Couder [Sat, 6 Mar 2010 20:34:46 +0000 (21:34 +0100)]
rebase -i: use new --ff cherry-pick option

This simplifies rebase -i a little bit.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofetch: Fix minor memory leak
Andreas Gruenbacher [Mon, 15 Mar 2010 22:18:48 +0000 (23:18 +0100)]
fetch: Fix minor memory leak

A temporary struct ref is allocated in store_updated_refs() but not
freed.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofetch: Future-proof initialization of a refspec on stack
Andreas Gruenbacher [Fri, 12 Mar 2010 22:27:33 +0000 (23:27 +0100)]
fetch: Future-proof initialization of a refspec on stack

The open-coded version to initialize each and every member will break
when a new member is added to the structure.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofetch: Check for a "^{}" suffix with suffixcmp()
Andreas Gruenbacher [Sat, 13 Mar 2010 17:17:04 +0000 (18:17 +0100)]
fetch: Check for a "^{}" suffix with suffixcmp()

Otherwise, we will check random bytes for ref names < 3 characters.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoFix a spelling mistake in a git-p4 console message
Benjamin C Meyer [Fri, 19 Mar 2010 04:39:10 +0000 (00:39 -0400)]
Fix a spelling mistake in a git-p4 console message

Signed-off-by: Benjamin C Meyer <bmeyer@rim.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoUse test_expect_success for test setups
Brian Gernhardt [Sat, 20 Mar 2010 08:29:11 +0000 (04:29 -0400)]
Use test_expect_success for test setups

Several tests did not use test_expect_success for their setup
commands.  Putting these start commands into the testing framework
means both that errors during setup will be caught quickly and that
non-error text will be suppressed without -v.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoModernize git calling conventions in hook templates
Ben Walton [Sat, 20 Mar 2010 14:48:09 +0000 (10:48 -0400)]
Modernize git calling conventions in hook templates

The hook templates were still using/referencing 'git-foo' instead of
'git foo.'  This patch updates the sample hooks to use the modern
conventions instead.

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMake templates honour SHELL_PATH and PERL_PATH
Ben Walton [Sat, 20 Mar 2010 14:48:08 +0000 (10:48 -0400)]
Make templates honour SHELL_PATH and PERL_PATH

The hook script templates were hard coded to use /bin/sh and perl.
This patch ensures that they use the same tools specified for the rest
of the suite.

The impetus for the change was noticing that, as shipped, some of the
hooks used shell constructs that wouldn't work under Solaris' /bin/sh
(eg: $(cmd...) substitutions).

Signed-off-by: Ben Walton <bwalton@artsci.utoronto.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodaemon: parse_host_and_port SIGSEGV if port is specified
Imre Deak [Sat, 20 Mar 2010 02:23:58 +0000 (04:23 +0200)]
daemon: parse_host_and_port SIGSEGV if port is specified

This typo will lead to git-daemon dying any time the connect
string includes a port after the host= attribute. This can lead
for example to one of the following error messages on the client
side when someone tries git clone git://...:<port>.

When the daemon is running on localhost:
  fatal: The remote end hung up unexpectedly

or when the daemon is connected through an ssh tunnel:
  fatal: protocol error: bad line length character: erro

In the latter case 'erro' comes from the daemon's reply:
  error: git-daemon died of signal 11

Signed-off-by: Imre Deak <imre.deak@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: Fix occasional GIT-CFLAGS breakage
Jonathan Nieder [Sat, 20 Mar 2010 03:20:12 +0000 (22:20 -0500)]
Makefile: Fix occasional GIT-CFLAGS breakage

GNU make’s target-specific variables facility has one weird facet: any
variables set for a given target apply to all of its dependencies,
too.  For example, when running “make exec_cmd.o”, since exec_cmd.o
depends on GIT-CFLAGS, the variable assignment in

exec_cmd.s exec_cmd.o: ALL_CFLAGS += \
'-DGIT_EXEC_PATH="$(gitexecdir_SQ)"' \
'-DBINDIR="$(bindir_relative_SQ)"' \
'-DPREFIX="$(prefix_SQ)"'

applies when refreshing GIT-CFLAGS, and the extra options get included
in the tracked compiler flags.  If an object file like this is the
first target built, GIT-CFLAGS will appear to be out of date,
resulting in useless rebuilds and the dreaded “new build flags or
prefix” message.

This does not happen with every build because GIT-CFLAGS is only
refreshed once in a given “make” run, and usually the first target
does not set any variables.  When this problem does rear its head, it
is very annoying.

So put target-specific flags in a separate EXTRA_CPPFLAGS variable
that is not included in $(TRACK_CFLAGS).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: Fix CDPATH problem
Jonathan Nieder [Sat, 20 Mar 2010 00:06:15 +0000 (19:06 -0500)]
Makefile: Fix CDPATH problem

If CDPATH is set, "cd" prints its destination to stdout, causing
the common (cd a && tar cf - .) | (cd b && tar xf -) idiom to fail.
For example:

 make -C templates DESTDIR='' install
 make[1]: Entering directory `/users/e477610/exptool/src/git-1.7.0.2/templates'
 install -d -m 755 '/home/e477610/exptool/share/git-core/templates'
 (cd blt && gtar cf - .) | \
(cd '/home/e477610/exptool/share/git-core/templates' && umask 022 && gtar xof -)
 gtar: This does not look like a tar archive

Most git scripts already protect against use of CDPATH through
git-sh-setup, but the Makefile doesn’t.

Reported-by: Michael Cox <mhcox@bluezoosoftware.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/t5505-remote.sh: escape * to prevent interpretation by shell as glob
Brandon Casey [Sat, 20 Mar 2010 00:10:20 +0000 (19:10 -0500)]
t/t5505-remote.sh: escape * to prevent interpretation by shell as glob

This test is supposed to check that git-remote correctly refuses to delete
all URLS for the specified remote which match the '.*' regular expression.
Since the '*' was not protected, it was interpreted by the shell as a file
glob and expanded before being passed to git-remote.  The call to
git-remote still exited non-zero in this case, and the overall test still
passed, but it exited non-zero because git-remote was passed the incorrect
number of arguments, not for the reason it was supposed to fail.

Correct the test by escaping the '*'.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot5505: add missing &&
Brandon Casey [Fri, 19 Mar 2010 23:36:35 +0000 (18:36 -0500)]
t5505: add missing &&

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot5505: remove unnecessary subshell invocations
Brandon Casey [Fri, 19 Mar 2010 23:36:34 +0000 (18:36 -0500)]
t5505: remove unnecessary subshell invocations

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agonotes.c: remove inappropriate call to return
Brandon Casey [Thu, 18 Mar 2010 15:03:43 +0000 (10:03 -0500)]
notes.c: remove inappropriate call to return

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Acked-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agopull: replace unnecessary sed invocation
Stephen Boyd [Thu, 18 Mar 2010 05:10:45 +0000 (22:10 -0700)]
pull: replace unnecessary sed invocation

Getting the shortened branch name is as easy as using the shell's
parameter expansion.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Wed, 17 Mar 2010 21:24:08 +0000 (14:24 -0700)]
Merge branch 'maint'

* maint:
  Documentation: receive.denyCurrentBranch defaults to 'refuse'
  bash: complete *_HEAD refs if present

14 years agoDocumentation: receive.denyCurrentBranch defaults to 'refuse'
Thomas Rast [Wed, 17 Mar 2010 11:14:57 +0000 (12:14 +0100)]
Documentation: receive.denyCurrentBranch defaults to 'refuse'

acd2a45 (Refuse updating the current branch in a non-bare repository
via push, 2009-02-11) changed the default to refuse such a push, but
it forgot to update the docs.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobash: complete *_HEAD refs if present
Ian Ward Comfort [Wed, 17 Mar 2010 09:20:35 +0000 (02:20 -0700)]
bash: complete *_HEAD refs if present

We already complete HEAD, of course, and might as well complete the other
common refs mentioned in the rev-parse man page: FETCH_HEAD, ORIG_HEAD, and
MERGE_HEAD.

Signed-off-by: Ian Ward Comfort <icomfort@stanford.edu>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Wed, 17 Mar 2010 02:30:37 +0000 (19:30 -0700)]
Merge branch 'maint'

* maint:
  Documentation/git-read-tree: clarify 2-tree merge
  Documentation/git-read-tree: fix table layout

14 years agoeveryday: fsck and gc are not everyday operations
Anders Kaseorg [Wed, 21 Oct 2009 20:02:48 +0000 (16:02 -0400)]
everyday: fsck and gc are not everyday operations

Back in 2005 when this document was written, it may have made sense to
introduce ‘git fsck’ (then ‘git fsck-objects’) as the very first example
command for new users of Git 0.99.9.  Now that Git has been stable for
years and does not actually tend to eat your data, it makes significantly
less sense.  In fact, it sends an entirely wrong message.

‘git gc’ is also unnecessary for the purposes of this document, especially
with gc.auto enabled by default.

The only other commands in the “Basic Repository” section were ‘git init’
and ‘git clone’.  ‘clone’ is already listed in the “Participant” section,
so move ‘init’ to the “Standalone” section and get rid of “Basic
Repository” entirely.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoImprove error messages from 'git stash show'
Gustaf Hendeby [Tue, 16 Mar 2010 17:52:37 +0000 (18:52 +0100)]
Improve error messages from 'git stash show'

The previous error message "fatal: Needed a single revision" is not
very informative.

Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodaemon.c: avoid accessing ss_family member of struct sockaddr_storage
Brandon Casey [Mon, 15 Mar 2010 22:10:06 +0000 (17:10 -0500)]
daemon.c: avoid accessing ss_family member of struct sockaddr_storage

When NO_SOCKADDR_STORAGE is set for a platform, either sockaddr_in or
sockaddr_in6 is used intead.  Neither of which has an ss_family member.
They have an sin_family and sin6_family member respectively.  Since the
addrcmp() function accesses the ss_family member of a sockaddr_storage
struct, compilation fails on platforms which define NO_SOCKADDR_STORAGE.

Since any sockaddr_* structure can be cast to a struct sockaddr and
have its sa_family member read, do so here to workaround this issue.

Thanks to Martin Storsjö for pointing out the fix, and Gary Vaughan
for drawing attention to the issue.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/t1304: make a second colon optional in the mask ACL check
Brandon Casey [Mon, 15 Mar 2010 17:14:37 +0000 (12:14 -0500)]
t/t1304: make a second colon optional in the mask ACL check

Solaris only uses one colon in the listing of the ACL mask, Linux uses two,
so substitute egrep for grep and make the second colon optional.

The -q option for Solaris 7's /usr/xpg4/bin/egrep does not appear to be
implemented, so redirect output to /dev/null.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/t1304: set the ACL effective rights mask
Brandon Casey [Mon, 15 Mar 2010 18:35:03 +0000 (13:35 -0500)]
t/t1304: set the ACL effective rights mask

Some implementations of setfacl do not recalculate the effective rights
mask when the ACL is modified.  So, set the effective rights mask
explicitly to ensure that the ACL's that are set on the directories will
have effect.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/t1304: use 'test -r' to test readability rather than looking at mode bits
Brandon Casey [Mon, 15 Mar 2010 17:14:35 +0000 (12:14 -0500)]
t/t1304: use 'test -r' to test readability rather than looking at mode bits

This test was using the group read permission bit as an indicator of the
default ACL mask.  This behavior is valid on Linux but not on other
platforms like Solaris.  So, rather than looking at mode bits, just test
readability for the user.  This, along with the checks for the existence
of the ACL's that were set on the parent directories, should be enough.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/t1304: set the Default ACL base entries
Brandon Casey [Mon, 15 Mar 2010 17:14:34 +0000 (12:14 -0500)]
t/t1304: set the Default ACL base entries

According to the Linux setfacl man page, in order for an ACL to be valid,
the following rules must be satisfied:

   * Whenever an ACL contains any Default ACL entries, the three Default
     ACL base entries (default owner, default group, and default others)
     must also exist.

   * Whenever a Default ACL contains named user entries or named group
     objects, it must also contain a default effective rights mask.

Some implementations of setfacl (Linux) do this automatically when
necessary, some (Solaris) do not.  Solaris's setfacl croaks when trying to
create a default user ACL if the above rules are not satisfied.  So, create
them before modifying the default user ACL's.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/t1304: avoid -d option to setfacl
Brandon Casey [Mon, 15 Mar 2010 17:14:33 +0000 (12:14 -0500)]
t/t1304: avoid -d option to setfacl

Some platforms (Solaris) have a setfacl whose -d switch works differently
than the one on Linux.  On Linux, it causes all operations to be applied
to the Default ACL.  There is a notation for operating on the Default ACL:

   [d[efault]:] [u[ser]:]uid [:perms]

so use it instead of the -d switch.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorefs: ref entry with NULL sha1 is can be a dangling symref
Junio C Hamano [Tue, 16 Mar 2010 05:12:55 +0000 (22:12 -0700)]
refs: ref entry with NULL sha1 is can be a dangling symref

Brandon Casey noticed that t5505 had accidentally broken its && chain,
hiding inconsistency between the code that writes the warning to the
standard output and the test that expects to see the warning on the
standard error, which was introduced by f8948e2 (remote prune: warn
dangling symrefs, 2009-02-08).

It turns out that the issue is deeper than that.  After f8948e2, a symref
that is dangling is marked with a NULL sha1, and the idea of using NULL
sha1 to mean a deleted ref was scrapped, but somehow a follow-up eafb452
(do_one_ref(): null_sha1 check is not about broken ref, 2009-07-22)
incorrectly reorganized do_one_ref(), still thinking NULL sha1 is never
used in the code.

Fix this by:

 - adopt Brandon's fix to t5505 test;

 - introduce REF_BROKEN flag to mark a ref that fails to resolve (dangling
   symref);

 - move the check for broken ref back inside the "if we are skipping
   dangling refs" code block.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogrep: enable threading for context line printing
René Scharfe [Mon, 15 Mar 2010 16:21:10 +0000 (17:21 +0100)]
grep: enable threading for context line printing

If context lines are to be printed, grep separates them with hunk marks
("--\n").  These marks are printed between matches from different files,
too.  They are not printed before the first file, though.

Threading was disabled when context line printing was enabled because
avoiding to print the mark before the first line was an unsolved
synchronisation problem.  This patch separates the code for printing
hunk marks for the threaded and the unthreaded case, allowing threading
to be turned on together with the common -ABC options.

->show_hunk_mark, which controls printing of hunk marks between files in
show_line(), is now set in grep_buffer_1(), but only if some results
have already been printed and threading is disabled.  The threaded case
is handled in work_done().

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/git-read-tree: clarify 2-tree merge
Michael J Gruber [Mon, 15 Mar 2010 10:54:46 +0000 (11:54 +0100)]
Documentation/git-read-tree: clarify 2-tree merge

Clarify the description of the 2-tree merge by defining the terms
which are used in the table, and by applying some small linguistic
changes.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation/git-read-tree: fix table layout
Michael J Gruber [Mon, 15 Mar 2010 10:54:45 +0000 (11:54 +0100)]
Documentation/git-read-tree: fix table layout

Asciidoc takes the first non-space character in the first line of the
paragraph as a reference point for preformatted layout, so adjust to
that to make the table align.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'sd/format-patch-to'
Junio C Hamano [Mon, 15 Mar 2010 07:58:55 +0000 (00:58 -0700)]
Merge branch 'sd/format-patch-to'

* sd/format-patch-to:
  send-email: add --no-cc, --no-to, and --no-bcc
  format-patch: add --no-cc, --no-to, and --no-add-headers
  format-patch: use a string_list for headers
  Add 'git format-patch --to=' option and 'format.to' configuration variable.

14 years agoMerge branch 'tc/http-cleanup'
Junio C Hamano [Mon, 15 Mar 2010 07:58:50 +0000 (00:58 -0700)]
Merge branch 'tc/http-cleanup'

* tc/http-cleanup:
  remote-curl: init walker only when needed
  remote-curl: use http_fetch_ref() instead of walker wrapper
  http: init and cleanup separately from http-walker
  http-walker: cleanup more thoroughly
  http-push: remove "|| 1" to enable verbose check
  t554[01]-http-push: refactor, add non-ff tests
  t5541-http-push: check that ref is unchanged for non-ff test

14 years agoMerge branch 'tc/transport-verbosity'
Junio C Hamano [Mon, 15 Mar 2010 07:58:42 +0000 (00:58 -0700)]
Merge branch 'tc/transport-verbosity'

* tc/transport-verbosity:
  transport: update flags to be in running order
  fetch and pull: learn --progress
  push: learn --progress
  transport->progress: use flag authoritatively
  clone: support multiple levels of verbosity
  push: support multiple levels of verbosity
  fetch: refactor verbosity option handling into transport.[ch]
  Documentation/git-push: put --quiet before --verbose
  Documentation/git-pull: put verbosity options before merge/fetch ones
  Documentation/git-clone: mention progress in -v

Conflicts:
transport.h

14 years agoMerge branch 'ld/push-porcelain'
Junio C Hamano [Mon, 15 Mar 2010 07:58:24 +0000 (00:58 -0700)]
Merge branch 'ld/push-porcelain'

* ld/push-porcelain:
  t5516: Use test_cmp when appropriate
  git-push: add tests for git push --porcelain
  git-push: make git push --porcelain print "Done"
  git-push: send "To <remoteurl>" messages to the standard output in --porcelain mode
  git-push: fix an advice message so it goes to stderr

Conflicts:
transport.c

14 years agoMerge branch 'jh/notes'
Junio C Hamano [Mon, 15 Mar 2010 07:52:06 +0000 (00:52 -0700)]
Merge branch 'jh/notes'

* jh/notes: (33 commits)
  Documentation: fix a few typos in git-notes.txt
  notes: fix malformed tree entry
  builtin-notes: Minor (mostly parse_options-related) fixes
  builtin-notes: Add "copy" subcommand for copying notes between objects
  builtin-notes: Misc. refactoring of argc and exit value handling
  builtin-notes: Add -c/-C options for reusing notes
  builtin-notes: Refactor handling of -F option to allow combining -m and -F
  builtin-notes: Deprecate the -m/-F options for "git notes edit"
  builtin-notes: Add "append" subcommand for appending to note objects
  builtin-notes: Add "add" subcommand for adding notes to objects
  builtin-notes: Add --message/--file aliases for -m/-F options
  builtin-notes: Add "list" subcommand for listing note objects
  Documentation: Generalize git-notes docs to 'objects' instead of 'commits'
  builtin-notes: Add "prune" subcommand for removing notes for missing objects
  Notes API: prune_notes(): Prune notes that belong to non-existing objects
  t3305: Verify that removing notes triggers automatic fanout consolidation
  builtin-notes: Add "remove" subcommand for removing existing notes
  Teach builtin-notes to remove empty notes
  Teach notes code to properly preserve non-notes in the notes tree
  t3305: Verify that adding many notes with git-notes triggers increased fanout
  ...

Conflicts:
Makefile

14 years agorebase--interactive: don't require what's rebased to be a branch
Dave Olszewski [Mon, 15 Mar 2010 04:48:22 +0000 (21:48 -0700)]
rebase--interactive: don't require what's rebased to be a branch

git rebase allows you to specify a non-branch commit-ish as the "branch"
argument, which leaves HEAD detached when it's finished.  This is
occasionally useful, and this patch brings the same functionality to git
rebase --interactive.

Signed-off-by: Dave Olszewski <cxreg@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-send-email.perl - try to give real name of the calling host to HELO/EHLO
Jari Aalto [Sun, 14 Mar 2010 15:16:45 +0000 (17:16 +0200)]
git-send-email.perl - try to give real name of the calling host to HELO/EHLO

Add new functions maildomain_net(), maildomain_mta() and
maildomain(), which return FQDN where possible for use in
send_message(). The value is passed to Net::SMTP HELO/EHLO
handshake. The domain name can also be set via new --smtp-domain
option.

The default value in Net::SMTP may not get through:

  Net::SMTP=GLOB(0x267ec28)>>> EHLO localhost.localdomain
  Net::SMTP=GLOB(0x267ec28)<<< 550 EHLO argument does not match calling host

whereas using the FQDN that matches the IP, the result is:

  Net::SMTP=GLOB(0x15b8e80)>>> EHLO host.example.com
  Net::SMTP=GLOB(0x15b8e80)<<< 250-host.example.com Hello host.example.com [192.168.1.7]

The maildomain*() code is based on ideas in Perl library
Test::Reporter by Graham Barr <gbarr@pobox.com> and Mark Overmeer
<mailtools@overmeer.net> released under the same terms as Perl
itself.

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-send-email.perl: add option --smtp-debug
Jari Aalto [Sun, 14 Mar 2010 15:16:09 +0000 (17:16 +0200)]
git-send-email.perl: add option --smtp-debug

Signed-off-by: Jari Aalto <jari.aalto@cante.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>