Code

git.git
14 years agoTeach diff --submodule and status to handle .git files in submodules
Jens Lehmann [Sat, 10 Apr 2010 17:01:12 +0000 (19:01 +0200)]
Teach diff --submodule and status to handle .git files in submodules

The simple test for an existing .git directory gives an incorrect result
if .git is a file that records "gitdir: overthere". So for submodules that
use a .git file, "git status" and the diff family - when the "--submodule"
option is given - did assume the submodule was not populated at all when
a .git file was used, thus generating wrong output or no output at all.

This is fixed by using read_gitfile_gently() to get the correct location
of the .git directory. While at it, is_submodule_modified() was cleaned up
to use the "dir" member of "struct child_process" instead of setting the
GIT_WORK_TREE and GIT_DIR environment variables.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Sat, 10 Apr 2010 05:43:18 +0000 (22:43 -0700)]
Merge branch 'maint'

* maint:
  Let check_preimage() use memset() to initialize "struct checkout"
  fetch/push: fix usage strings

14 years agoLet check_preimage() use memset() to initialize "struct checkout"
Jens Lehmann [Fri, 9 Apr 2010 20:08:35 +0000 (22:08 +0200)]
Let check_preimage() use memset() to initialize "struct checkout"

Every code site except check_preimage() uses either memset() or declares
a static instance of "struct checkout" to achieve proper initialization.
Lets use memset() instead of explicit initialization of all members here
too to be on the safe side in case this structure is expanded someday.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'ef/maint-empty-commit-log' into maint
Junio C Hamano [Sat, 10 Apr 2010 05:38:53 +0000 (22:38 -0700)]
Merge branch 'ef/maint-empty-commit-log' into maint

* ef/maint-empty-commit-log:
  rev-list: fix --pretty=oneline with empty message

14 years agoMerge branch 'jc/conflict-marker-size' into maint
Junio C Hamano [Sat, 10 Apr 2010 05:38:34 +0000 (22:38 -0700)]
Merge branch 'jc/conflict-marker-size' into maint

* jc/conflict-marker-size:
  diff --check: honor conflict-marker-size attribute

14 years agoMerge branch 'sp/maint-http-backend-die-triggers-die-recursively' into maint
Junio C Hamano [Sat, 10 Apr 2010 05:38:16 +0000 (22:38 -0700)]
Merge branch 'sp/maint-http-backend-die-triggers-die-recursively' into maint

* sp/maint-http-backend-die-triggers-die-recursively:
  http-backend: Don't infinite loop during die()

14 years agoMerge branch 'mg/maint-send-email-lazy-editor' into maint
Junio C Hamano [Sat, 10 Apr 2010 05:23:04 +0000 (22:23 -0700)]
Merge branch 'mg/maint-send-email-lazy-editor' into maint

* mg/maint-send-email-lazy-editor:
  send-email: lazily assign editor variable

14 years agoMerge branch 'rr/imap-send-unconfuse-from-line' into maint
Junio C Hamano [Sat, 10 Apr 2010 05:22:44 +0000 (22:22 -0700)]
Merge branch 'rr/imap-send-unconfuse-from-line' into maint

* rr/imap-send-unconfuse-from-line:
  imap-send: Remove limitation on message body

14 years agoMerge branch 'rb/maint-python-path' into maint
Junio C Hamano [Sat, 10 Apr 2010 05:22:19 +0000 (22:22 -0700)]
Merge branch 'rb/maint-python-path' into maint

* rb/maint-python-path:
  Correct references to /usr/bin/python which does not exist on FreeBSD

14 years agoMerge branch 'gh/maint-stash-show-error-message' into maint
Junio C Hamano [Sat, 10 Apr 2010 05:22:14 +0000 (22:22 -0700)]
Merge branch 'gh/maint-stash-show-error-message' into maint

* gh/maint-stash-show-error-message:
  Improve error messages from 'git stash show'

14 years agoMerge branch 'mg/mailmap-update' into maint
Junio C Hamano [Sat, 10 Apr 2010 05:22:06 +0000 (22:22 -0700)]
Merge branch 'mg/mailmap-update' into maint

* mg/mailmap-update:
  .mailmap: Entries for Alex Bennée, Deskin Miller, Vitaly "_Vi" Shukela

14 years agoMerge branch 'bc/maint-daemon-sans-ss-family' into maint
Junio C Hamano [Sat, 10 Apr 2010 05:22:00 +0000 (22:22 -0700)]
Merge branch 'bc/maint-daemon-sans-ss-family' into maint

* bc/maint-daemon-sans-ss-family:
  daemon.c: avoid accessing ss_family member of struct sockaddr_storage

14 years agofetch/push: fix usage strings
Tay Ray Chuan [Sat, 10 Apr 2010 02:50:19 +0000 (10:50 +0800)]
fetch/push: fix usage strings

 - use "<options>" instead of just "options".
 - use "[<repository> [<refspec>...]]" to indicate that <repository> and
   <refspec> are optional, and that <refspec> cannot be specified
   without specifying <repository>.

Note that when called without specifying <repository> (eg. "git fetch
-f"), it is accurate to say that the "git fetch [<options>]
[<repository> ...]" case takes precedence over "git fetch [<options>]
<group>".

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoremote-curl: ensure that URLs have a trailing slash
Tay Ray Chuan [Thu, 8 Apr 2010 02:15:18 +0000 (10:15 +0800)]
remote-curl: ensure that URLs have a trailing slash

Previously, we blindly assumed that URLs passed to the remote-curl
helper did not end with a trailing slash.

Use the convenience function end_url_with_slash() from http.[ch] to
ensure that URLs have a trailing slash on invocation of the remote-curl
helper, and use the URL as one with a trailing slash throughout.

It is possible for users to pass a URL with a trailing slash to
remote-curl, by, say, setting it in remote.<name>.url in their git
config. The resulting requests have an empty path component (//) and may
break implementations of the http git protocol.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohttp: make end_url_with_slash() public
Tay Ray Chuan [Thu, 8 Apr 2010 02:15:17 +0000 (10:15 +0800)]
http: make end_url_with_slash() public

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot5541-http-push: add test for URLs with trailing slash
Tay Ray Chuan [Thu, 8 Apr 2010 02:15:16 +0000 (10:15 +0800)]
t5541-http-push: add test for URLs with trailing slash

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'rc/maint-reflog-msg-for-forced-branch'
Junio C Hamano [Sat, 10 Apr 2010 03:42:10 +0000 (20:42 -0700)]
Merge branch 'rc/maint-reflog-msg-for-forced-branch'

* rc/maint-reflog-msg-for-forced-branch:
  branch: say "Reset to" in reflog entries for 'git branch -f' operations

Conflicts:
builtin-branch.c

14 years agobranch: say "Reset to" in reflog entries for 'git branch -f' operations
Tay Ray Chuan [Fri, 9 Apr 2010 12:38:18 +0000 (20:38 +0800)]
branch: say "Reset to" in reflog entries for 'git branch -f' operations

In 5f856dd (fix reflog entries for "git-branch"), it is mentioned that
'git branch -f' is intended to be equivalent to 'git reset'. Since we
usually say "reset to <commit>" in the git-reset Documentation and
elsewhere, it would make sense to say "Reset to" here as well, instead
of "Reset from" previously.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge early parts of jk/cached-textconv
Junio C Hamano [Fri, 9 Apr 2010 06:31:27 +0000 (23:31 -0700)]
Merge early parts of jk/cached-textconv

14 years agodiff.c: work around pointer constness warnings
Junio C Hamano [Fri, 9 Apr 2010 06:30:49 +0000 (23:30 -0700)]
diff.c: work around pointer constness warnings

The textconv leak fix introduced two invocations of free() to release
memory pointed by "const char *", which get annoying compiler warning.

14 years agoMerge branch 'maint'
Junio C Hamano [Fri, 9 Apr 2010 06:27:23 +0000 (23:27 -0700)]
Merge branch 'maint'

* maint:
  docs: clarify "branch -l"

14 years agolog.decorate: only ignore it under "log --pretty=raw"
Junio C Hamano [Thu, 8 Apr 2010 17:17:17 +0000 (10:17 -0700)]
log.decorate: only ignore it under "log --pretty=raw"

Unlike notes that are often multi-line and disrupting to be placed in many
output formats, a decoration is designed to be a small token that can be
tacked after an existing line of the output where a commit object name sits.
Disabling log.decorate for something like "log --oneline" would defeat the
purpose of the configuration.

We _might_ want to change it further in the future to force scripts that
do not want to be broken by random end user configurations to explicitly
say "log --no-decorate", but that would be an incompatible change that
needs the usual multi-release-cycle deprecation process.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoscript with rev-list instead of log
Jeff King [Thu, 8 Apr 2010 19:42:37 +0000 (15:42 -0400)]
script with rev-list instead of log

Because log.decorate now shows decorations for --pretty=oneline,
we must explicitly turn it off when scripting. Otherwise,
users with log.decorate set will get cruft like:

  $ git stash
  Saved working directory and index state WIP on master:
    2c1f7f5 (HEAD, master) commit subject

Instead of adding --no-decorate to the log command line,
let's just use the rev-list plumbing interface instead,
which does the right thing.

git-submodule has a similar call. Since it just counts the
commit lines, nothing is broken, but let's switch it, too,
for the sake of consistency and cleanliness.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agols-remote: fall-back to default remotes when no remote specified
Tay Ray Chuan [Thu, 8 Apr 2010 17:21:13 +0000 (01:21 +0800)]
ls-remote: fall-back to default remotes when no remote specified

Instead of breaking execution when no remote (as specified in the
variable dest) is specified when git-ls-remote is invoked, continue on
and let remote_get() handle it.

This way, we are able to use the default remotes (eg. "origin",
branch.<name>.remote), as git-fetch, git-push, and other users of
remote_get(), do.

If no suitable remote is found, exit with a message describing the
issue, instead of just the usage text, as we do previously.

Add several tests to check that git-ls-remote handles the
no-remote-specified situation.

Also add a test that "git ls-remote <pattern>" does not work; we are
unable to guess the remote in that situation, as are git-fetch and
git-push.

In that test, we are testing for messages coming from two separate
processes, but we should be OK, because the second message is triggered
by closing the fd which must happen after the first message is printed.
(analysis by Jeff King.)

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodocs: clarify "branch -l"
Jeff King [Thu, 8 Apr 2010 19:49:08 +0000 (15:49 -0400)]
docs: clarify "branch -l"

This option is mostly useless these days because we turn on
reflogs by default in non-bare repos.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoapply: Allow blank *trailing* context lines to match beyond EOF
Björn Gustavsson [Thu, 8 Apr 2010 04:14:31 +0000 (06:14 +0200)]
apply: Allow blank *trailing* context lines to match beyond EOF

In 51667147be, "git apply --whitespace=fix" was extended to
allow a blank context line to match beyond the end of the file,
but only if the context line was in the leading part of the
hunk (i.e. the hunk inserted additional contents at the end
of the file).

Drop the restriction that the context line must be in the
leading part of the hunk, thus allowing a file to be changed
from:

 a
 (blank line)

to:

 b
 a
 (blank line)

Note that the blank line will be kept, because "--whitespace=fix"
only removes trailing blank lines that a hunk would add, never
trailing blank lines in the context.

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoSubmittingPatches: update GMail section
Junio C Hamano [Wed, 7 Apr 2010 22:59:17 +0000 (15:59 -0700)]
SubmittingPatches: update GMail section

Even if you use imap-send to throw your drafts in the outbox, using their
web interface will mangle your patches.  Clarify that the imap-send is
meant to be used together with a real MUA that can use IMAP drafts, and
remove instructions related to the web interface, which is irrelevant.

Add description of send-email as an alternative.

Use --cover-letter, and do not use -C nor --no-color, on the example
command line for format-patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'mg/notes-reflog'
Junio C Hamano [Wed, 7 Apr 2010 22:34:09 +0000 (15:34 -0700)]
Merge branch 'mg/notes-reflog'

* mg/notes-reflog:
  refs.c: Write reflogs for notes just like for branch heads
  t3301-notes: Test the creation of reflog entries

14 years agoMerge branch 'jn/mailinfo-scissors'
Junio C Hamano [Wed, 7 Apr 2010 22:34:06 +0000 (15:34 -0700)]
Merge branch 'jn/mailinfo-scissors'

* jn/mailinfo-scissors:
  Teach mailinfo %< as an alternative scissors mark

14 years agoAdd option to git-commit to allow empty log messages
Ævar Arnfjörð Bjarmason [Tue, 6 Apr 2010 08:40:35 +0000 (08:40 +0000)]
Add option to git-commit to allow empty log messages

Change git-commit(1) to accept the --allow-empty-message option
to allow a commit with an empty message.  This is analogous to the
existing --allow-empty option which allows a commit that records
no changes.  As these are mainly for interoperating with foreign SCM
systems, and are not meant for normal use, ensure that "git commit -h"
does not talk about them.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofix typos and grammar in 1.7.1 draft release notes
Jeff King [Wed, 7 Apr 2010 20:57:11 +0000 (16:57 -0400)]
fix typos and grammar in 1.7.1 draft release notes

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoreflog --expire-unreachable: avoid merge-base computation
Junio C Hamano [Wed, 7 Apr 2010 18:09:12 +0000 (11:09 -0700)]
reflog --expire-unreachable: avoid merge-base computation

The option tells the command to expire older reflog entries that refer to
commits that are no longer reachable from the tip of the ref the reflog is
associated with.  To avoid repeated merge_base() invocations, we used to
mark commits that are known to be reachable by walking the history from
the tip until we hit commits that are older than expire-total (which is
the timestamp before which all the reflog entries are expired).

However, it is a different matter if a commit is _not_ known to be
reachable and the commit is known to be unreachable.  Because you can
rewind a ref to an ancient commit and then reset it back to the original
tip, a recent reflog entry can point at a commit that older than the
expire-total timestamp and we shouldn't expire it.  For that reason, we
had to run merge-base computation when a commit is _not_ known to be
reachable.

This introduces a lazy/on-demand traversal of the history to mark
reachable commits in steps.  As before, we mark commits that are newer
than expire-total to optimize the normal case before walking reflog, but
we dig deeper from the commits the initial step left off when we encounter
a commit that is not known to be reachable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agonotes.h: declare bit field as unsigned to silence compiler complaints
Brandon Casey [Tue, 6 Apr 2010 15:11:44 +0000 (10:11 -0500)]
notes.h: declare bit field as unsigned to silence compiler complaints

The IRIX MIPSPro compiler complains like this:

   cc-1107 c99: WARNING File = notes.h, Line = 215
     A signed bit field has a length of 1 bit.

           int suppress_default_notes:1;
               ^

'unsigned' is what was intended, so lets make it so.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agowar on "sleep" in tests
Junio C Hamano [Wed, 7 Apr 2010 00:08:54 +0000 (17:08 -0700)]
war on "sleep" in tests

In many places in test suite we have "sleep"s that do not have to be
there.

 - I do not simply see the point of the one in t3500.  It may be making
   sure that the timestamp order of commits generated during the test is
   stable, in which case test_tick is the right ingredient to use without
   wasting tester's time.

 - The one in t4011 is to make sure that the plumbing diff-index notices
   the stat-dirtyness of a removed then identically recreated symlink.
   Keeping the old symlink around to make sure that a newly created
   symlink gets different ino would be sufficient for that purpose.

 - The one in t7600 is to make sure that "git merge" does not get confused
   by stat-dirty "file" in the working tree.  Again, keeping the old file
   around and creating an identical copy to ensure a different ino would
   be sufficient for that purpose.

The "racy git" tests in t0010 are inherently about mtime between the index
itself and index entries.  The "sleep" in that test must stay as they are.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoGit 1.7.1-rc0 v1.7.1-rc0
Junio C Hamano [Tue, 6 Apr 2010 22:00:01 +0000 (15:00 -0700)]
Git 1.7.1-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'da/maint-python-startup'
Junio C Hamano [Tue, 6 Apr 2010 21:50:47 +0000 (14:50 -0700)]
Merge branch 'da/maint-python-startup'

* da/maint-python-startup:
  Makefile: Remove usage of deprecated Python "has_key" method

14 years agoMerge branch 'ic/bash-completion-rpm'
Junio C Hamano [Tue, 6 Apr 2010 21:50:47 +0000 (14:50 -0700)]
Merge branch 'ic/bash-completion-rpm'

* ic/bash-completion-rpm:
  RPM spec: include bash completion support

14 years agoMerge branch 'sb/fmt-merge-msg'
Junio C Hamano [Tue, 6 Apr 2010 21:50:46 +0000 (14:50 -0700)]
Merge branch 'sb/fmt-merge-msg'

* sb/fmt-merge-msg:
  fmt-merge-msg: hide summary option
  fmt-merge-msg: remove custom string_list implementation
  string-list: add unsorted_string_list_lookup()
  fmt-merge-msg: use pretty.c routines
  t6200: test fmt-merge-msg more
  t6200: modernize with test_tick
  fmt-merge-msg: be quiet if nothing to merge

14 years agoMerge branch 'jc/conflict-marker-size'
Junio C Hamano [Tue, 6 Apr 2010 21:50:46 +0000 (14:50 -0700)]
Merge branch 'jc/conflict-marker-size'

* jc/conflict-marker-size:
  diff --check: honor conflict-marker-size attribute

14 years agoMerge branch 'ef/maint-empty-commit-log'
Junio C Hamano [Tue, 6 Apr 2010 21:50:46 +0000 (14:50 -0700)]
Merge branch 'ef/maint-empty-commit-log'

* ef/maint-empty-commit-log:
  rev-list: fix --pretty=oneline with empty message

14 years agoMerge branch 'sg/bash-completion'
Junio C Hamano [Tue, 6 Apr 2010 21:50:45 +0000 (14:50 -0700)]
Merge branch 'sg/bash-completion'

* sg/bash-completion:
  bash: completion for gitk aliases
  bash: support user-supplied completion scripts for aliases
  bash: support user-supplied completion scripts for user's git commands
  bash: improve aliased command recognition

14 years agolog --pretty/--oneline: ignore log.decorate
Junio C Hamano [Tue, 6 Apr 2010 21:48:55 +0000 (14:48 -0700)]
log --pretty/--oneline: ignore log.decorate

Many scripts, most notably gitk, rely on output from the log family of
command not to be molested by random user configuration.  This is
especially true when --pretty=raw is given.

Just like we disable notes output unless the command line explicitly
asks for --show-notes, disable the decoration code unless --decorate is
given explicitly from the command line and --pretty or --oneline is
given.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoAdd `%B' in format strings for raw commit body in `git log' and friends
Eli Barzilay [Thu, 25 Mar 2010 02:51:52 +0000 (22:51 -0400)]
Add `%B' in format strings for raw commit body in `git log' and friends

Also update the documentation text and add a test.

Signed-off-by: Eli Barzilay <eli@barzilay.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoRevert "Link against libiconv on IRIX"
Junio C Hamano [Mon, 5 Apr 2010 17:16:11 +0000 (10:16 -0700)]
Revert "Link against libiconv on IRIX"

Brandon Casey reports:

    Subject: Re: [PATCH] Link against libiconv on IRIX
    Date: Mon, 05 Apr 2010 11:45:32 -0500
    Message-Id: <1UypQMCHLT57SnjSQIM66RTkLalsvavG8xXoQJv4rEQ@cipher.nrlssc.navy.mil>

    This breaks compilation on IRIX 6.5.29m for me since there
    is no separate libiconv.so.

    What version of IRIX are you using?

    On my system, even the iconv utility doesn't link against
    a libiconv shared object.  It seems the iconv functionality is in libc.

       # ldd /usr/bin/iconv
       libc.so.1  =>    /usr/lib32/libc.so.1

    Could it be that you are using a third party iconv library?
    I've experienced this on another system and the problem was related
    to curl.  In that case, curl was linked against an external iconv and
    not the native library, so if I tried to build with curl support, I had
    to also build against the external iconv library.

While we wait for an improved solution, revert the regression caused by
21704227904b51197976c61c595b52d807677533.

14 years agowhitespace: tests for git-apply --whitespace=fix with tab-in-indent
Chris Webb [Fri, 2 Apr 2010 23:37:37 +0000 (00:37 +0100)]
whitespace: tests for git-apply --whitespace=fix with tab-in-indent

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agowhitespace: add tab-in-indent support for --whitespace=fix
Chris Webb [Fri, 2 Apr 2010 23:37:30 +0000 (00:37 +0100)]
whitespace: add tab-in-indent support for --whitespace=fix

If tab-in-indent is set, --whitespace=fix will ensure that any stray tabs in
the initial indent are expanded to the correct number of space characters.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agowhitespace: replumb ws_fix_copy to take a strbuf *dst instead of char *dst
Chris Webb [Fri, 2 Apr 2010 23:37:23 +0000 (00:37 +0100)]
whitespace: replumb ws_fix_copy to take a strbuf *dst instead of char *dst

To implement --whitespace=fix for tab-in-indent, we have to allow for the
possibility that whitespace can increase in size when it is fixed, expanding
tabs to to multiple spaces in the initial indent.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agowhitespace: tests for git-diff --check with tab-in-indent error class
Chris Webb [Fri, 2 Apr 2010 23:37:15 +0000 (00:37 +0100)]
whitespace: tests for git-diff --check with tab-in-indent error class

[jc: with test fixes from J6t]

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Sun, 4 Apr 2010 17:23:21 +0000 (10:23 -0700)]
Merge branch 'maint'

* maint:
  pack-protocol.txt: fix pkt-line lengths
  pack-protocol.txt: fix spelling

14 years agopack-protocol.txt: fix pkt-line lengths
Tay Ray Chuan [Sun, 4 Apr 2010 13:12:17 +0000 (21:12 +0800)]
pack-protocol.txt: fix pkt-line lengths

Previously, the lengths were 4-bytes short. Fix it such that the lengths
reflect the total length of the pkt-line, as per spec.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agopack-protocol.txt: fix spelling
Tay Ray Chuan [Sun, 4 Apr 2010 13:12:16 +0000 (21:12 +0800)]
pack-protocol.txt: fix spelling

s/paramater/parameter/.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoTeach mailinfo %< as an alternative scissors mark
Jonathan Nieder [Sat, 3 Apr 2010 19:52:17 +0000 (14:52 -0500)]
Teach mailinfo %< as an alternative scissors mark

Handle perforations found “in the wild” more robustly by recognizing
“%<” as an alternative scissors mark.

This feature is only meant to support old habits.  Discourage new use
of the percent-based version by only documenting the 8< symbol so new
users’ perforations can still be recognized by old versions of Git.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'mb/rebase-i-no-ff'
Junio C Hamano [Sat, 3 Apr 2010 19:28:44 +0000 (12:28 -0700)]
Merge branch 'mb/rebase-i-no-ff'

* mb/rebase-i-no-ff:
  Teach rebase the --no-ff option.

Conflicts:
git-rebase--interactive.sh
t/t3404-rebase-interactive.sh

14 years agoMerge branch 'sp/maint-http-backend-die-triggers-die-recursively'
Junio C Hamano [Sat, 3 Apr 2010 19:28:43 +0000 (12:28 -0700)]
Merge branch 'sp/maint-http-backend-die-triggers-die-recursively'

* sp/maint-http-backend-die-triggers-die-recursively:
  http-backend: Don't infinite loop during die()

14 years agoMerge branch 'rr/imap-send-unconfuse-from-line'
Junio C Hamano [Sat, 3 Apr 2010 19:28:42 +0000 (12:28 -0700)]
Merge branch 'rr/imap-send-unconfuse-from-line'

* rr/imap-send-unconfuse-from-line:
  imap-send: Remove limitation on message body

14 years agoMerge branch 'mg/use-default-abbrev-length-in-rev-list'
Junio C Hamano [Sat, 3 Apr 2010 19:28:42 +0000 (12:28 -0700)]
Merge branch 'mg/use-default-abbrev-length-in-rev-list'

* mg/use-default-abbrev-length-in-rev-list:
  rev-list: use default abbrev length when abbrev-commit is in effect

14 years agoMerge branch 'mg/maint-send-email-lazy-editor'
Junio C Hamano [Sat, 3 Apr 2010 19:28:42 +0000 (12:28 -0700)]
Merge branch 'mg/maint-send-email-lazy-editor'

* mg/maint-send-email-lazy-editor:
  send-email: lazily assign editor variable

14 years agoMerge branch 'rb/maint-python-path'
Junio C Hamano [Sat, 3 Apr 2010 19:28:41 +0000 (12:28 -0700)]
Merge branch 'rb/maint-python-path'

* rb/maint-python-path:
  Correct references to /usr/bin/python which does not exist on FreeBSD

14 years agoMerge branch 'jn/merge-diff3-label'
Junio C Hamano [Sat, 3 Apr 2010 19:28:41 +0000 (12:28 -0700)]
Merge branch 'jn/merge-diff3-label'

* jn/merge-diff3-label:
  merge-recursive: add a label for ancestor
  cherry-pick, revert: add a label for ancestor
  revert: clarify label on conflict hunks
  compat: add mempcpy()
  checkout -m --conflict=diff3: add a label for ancestor
  merge_trees(): add ancestor label parameter for diff3-style output
  merge_file(): add comment explaining behavior wrt conflict style
  checkout --conflict=diff3: add a label for ancestor
  ll_merge(): add ancestor label parameter for diff3-style output
  merge-file --diff3: add a label for ancestor
  xdl_merge(): move file1 and file2 labels to xmparam structure
  xdl_merge(): add optional ancestor label to diff3-style output
  tests: document cherry-pick behavior in face of conflicts
  tests: document format of conflicts from checkout -m

Conflicts:
builtin/revert.c

14 years agoMerge branch 'ef/cherry-abbrev'
Junio C Hamano [Sat, 3 Apr 2010 19:28:40 +0000 (12:28 -0700)]
Merge branch 'ef/cherry-abbrev'

* ef/cherry-abbrev:
  ls: remove redundant logic
  cherry: support --abbrev option

14 years agoMerge branch 'bw/template-tool-buildconfig'
Junio C Hamano [Sat, 3 Apr 2010 19:28:40 +0000 (12:28 -0700)]
Merge branch 'bw/template-tool-buildconfig'

* bw/template-tool-buildconfig:
  Modernize git calling conventions in hook templates
  Make templates honour SHELL_PATH and PERL_PATH

14 years agoMerge branch 'mg/mailmap-update'
Junio C Hamano [Sat, 3 Apr 2010 19:28:40 +0000 (12:28 -0700)]
Merge branch 'mg/mailmap-update'

* mg/mailmap-update:
  .mailmap: Entries for Alex Bennée, Deskin Miller, Vitaly "_Vi" Shukela

14 years agoMerge branch 'bc/t5505-fix'
Junio C Hamano [Sat, 3 Apr 2010 19:28:40 +0000 (12:28 -0700)]
Merge branch 'bc/t5505-fix'

* bc/t5505-fix:
  t/t5505-remote.sh: escape * to prevent interpretation by shell as glob
  t5505: add missing &&
  t5505: remove unnecessary subshell invocations

14 years agoMerge branch 'gh/maint-stash-show-error-message'
Junio C Hamano [Sat, 3 Apr 2010 19:28:40 +0000 (12:28 -0700)]
Merge branch 'gh/maint-stash-show-error-message'

* gh/maint-stash-show-error-message:
  Improve error messages from 'git stash show'

14 years agoMerge branch 'rs/threaded-grep-context'
Junio C Hamano [Sat, 3 Apr 2010 19:28:39 +0000 (12:28 -0700)]
Merge branch 'rs/threaded-grep-context'

* rs/threaded-grep-context:
  grep: enable threading for context line printing

Conflicts:
grep.c

14 years agoMerge branch 'bc/maint-daemon-sans-ss-family'
Junio C Hamano [Sat, 3 Apr 2010 19:28:39 +0000 (12:28 -0700)]
Merge branch 'bc/maint-daemon-sans-ss-family'

* bc/maint-daemon-sans-ss-family:
  daemon.c: avoid accessing ss_family member of struct sockaddr_storage

14 years agoMerge branch 'bc/acl-test'
Junio C Hamano [Sat, 3 Apr 2010 19:28:39 +0000 (12:28 -0700)]
Merge branch 'bc/acl-test'

* bc/acl-test:
  t/t1304: make a second colon optional in the mask ACL check
  t/t1304: set the ACL effective rights mask
  t/t1304: use 'test -r' to test readability rather than looking at mode bits
  t/t1304: set the Default ACL base entries
  t/t1304: avoid -d option to setfacl

14 years agoMerge branch 'ja/send-email-ehlo'
Junio C Hamano [Sat, 3 Apr 2010 19:28:39 +0000 (12:28 -0700)]
Merge branch 'ja/send-email-ehlo'

* ja/send-email-ehlo:
  git-send-email.perl - try to give real name of the calling host to HELO/EHLO
  git-send-email.perl: add option --smtp-debug
  git-send-email.perl: improve error message in send_message()

14 years agoMerge branch 'do/rebase-i-arbitrary'
Junio C Hamano [Sat, 3 Apr 2010 19:28:38 +0000 (12:28 -0700)]
Merge branch 'do/rebase-i-arbitrary'

* do/rebase-i-arbitrary:
  rebase--interactive: don't require what's rebased to be a branch

Conflicts:
t/t3404-rebase-interactive.sh

14 years agoMerge branch 'ak/everyday-git'
Junio C Hamano [Sat, 3 Apr 2010 19:28:38 +0000 (12:28 -0700)]
Merge branch 'ak/everyday-git'

* ak/everyday-git:
  everyday: fsck and gc are not everyday operations

14 years agoMakefile: future-proof Cygwin version check
Jonathan Nieder [Sat, 3 Apr 2010 07:47:00 +0000 (02:47 -0500)]
Makefile: future-proof Cygwin version check

Tweak the condition that detects old Cygwin versions to not include
versions such as 1.8, 1.11, and 2.1.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot7508: add a test for "git status" in a read-only repository
Markus Heidelberg [Sat, 3 Apr 2010 10:11:57 +0000 (12:11 +0200)]
t7508: add a test for "git status" in a read-only repository

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit status: refresh the index if possible
Markus Heidelberg [Fri, 2 Apr 2010 21:44:21 +0000 (23:44 +0200)]
git status: refresh the index if possible

This was already the case before commit 9e4b7ab6 (git status: not
"commit --dry-run" anymore, 2009-08-15) with the difference that it died
at failure.
It got lost during the new implementation of "git status", which was
meant to only change behaviour when invoked with arguments.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot7508: add test for "git status" refreshing the index
Markus Heidelberg [Fri, 2 Apr 2010 12:27:20 +0000 (14:27 +0200)]
t7508: add test for "git status" refreshing the index

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoFix _XOPEN_SOURCE problem on DragonFly
YONETANI Tomokazu [Fri, 2 Apr 2010 07:52:09 +0000 (16:52 +0900)]
Fix _XOPEN_SOURCE problem on DragonFly

As on FreeBSD, defining _XOPEN_SOURCE to 600 on DragonFly BSD 2.4-RELEASE
or later hides symbols from programs, which leads to implicit declaration
of functions, making the return value to be assumed an int.  On architectures
where sizeof(int) < sizeof(void *), this can cause unexpected behaviors or
crashes.
This change won't affect other OSes unless they define __DragonFly__ macro,
or older versions of DragonFly BSD as the current git code doesn't rely on
the features only available with _XOPEN_SOURCE set to 600 on DragonFly.

Signed-off-by: YONETANI Tomokazu <y0netan1@dragonflybsd.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb: update INSTALL to use shorter make target
Mark Rada [Sat, 3 Apr 2010 00:37:33 +0000 (20:37 -0400)]
gitweb: update INSTALL to use shorter make target

Gitweb can be generated by the gitweb/gitweb.cgi target or the gitweb
target. Since the gitweb target is shorter, I think it would be better
to have new users be instructed to use it.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb: add documentation to INSTALL regarding gitweb.js
Mark Rada [Sat, 3 Apr 2010 00:36:44 +0000 (20:36 -0400)]
gitweb: add documentation to INSTALL regarding gitweb.js

This patch updates gitweb/INSTALL to mention gitweb.js, including
JavaScript minification support.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoinstaweb: add minification awareness
Mark Rada [Sat, 3 Apr 2010 00:40:33 +0000 (20:40 -0400)]
instaweb: add minification awareness

This patch will cause git-instaweb to use the minified version of gitweb
support files (e.g. CSS and JavaScript) if they were generated.

Without minification awareness, generating the minified version of
gitweb's support files will generate a broken instaweb script since the
copy of gitweb.cgi will look for gitweb.min.* which will not exist.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoGitweb: add autoconfigure support for minifiers
Mark Rada [Sat, 3 Apr 2010 00:35:54 +0000 (20:35 -0400)]
Gitweb: add autoconfigure support for minifiers

This will allow users to set a JavaScript/CSS minifier when/if they run
the autoconfigure script while building git.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoGitweb: add support for minifying gitweb.css
Mark Rada [Sat, 3 Apr 2010 00:35:05 +0000 (20:35 -0400)]
Gitweb: add support for minifying gitweb.css

The build system added support minifying gitweb.js through a
JavaScript minifier, but most minifiers come with support for
minifying CSS files as well, so we should use it if we can.

This patch will add the same facilities to gitweb.css that
gitweb.js has for minification. That does not mean that they
will use the same minifier though, as it is not safe to assume
that all JavaScript minifiers will also minify CSS files.

This patch also adds the GITWEB_PROGRAMS variable to the Makefile
to keep a list of potential gitweb dependencies separate from
OTHER_PROGRAMS when we need to know just the gitweb dependencies.

Though the bandwidth savings will not be as dramatic as with
the JavaScript minifier, every byte saved is important.

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoGitweb: add ignore and clean rules for minified files
Mark Rada [Sat, 3 Apr 2010 00:33:55 +0000 (20:33 -0400)]
Gitweb: add ignore and clean rules for minified files

Signed-off-by: Mark Rada <marada@uwaterloo.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agowhitespace: add tab-in-indent error class
Chris Webb [Fri, 2 Apr 2010 23:37:08 +0000 (00:37 +0100)]
whitespace: add tab-in-indent error class

Some projects and languages use coding style where no tab character is used to
indent the lines.

This only adds support and documentation for "apply --whitespace=warn" and
"diff --check"; later patches add "apply --whitespace=fix" and tests.

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agowhitespace: we cannot "catch all errors known to git" anymore
Junio C Hamano [Fri, 2 Apr 2010 23:37:00 +0000 (00:37 +0100)]
whitespace: we cannot "catch all errors known to git" anymore

Traditionally, "*.txt whitespace" in .gitattributes file has been an
instruction to catch _all_ classes of whitespace errors known to git.

This has to change, however, in order to introduce "tab-in-indent" which
is inherently incompatible with "indent-with-non-tab".  As we do not want
to break configuration of existing users, add a mechanism to allow marking
selected rules to be excluded from "all rules known to git".

Signed-off-by: Chris Webb <chris@arachsys.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobuiltin/commit: remove unnecessary variable definition
Markus Heidelberg [Fri, 2 Apr 2010 12:27:19 +0000 (14:27 +0200)]
builtin/commit: remove unnecessary variable definition

The file descriptor is already defined at the beginning of the function.

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobuiltin/commit: fix duplicated sentence in a comment
Markus Heidelberg [Fri, 2 Apr 2010 12:27:18 +0000 (14:27 +0200)]
builtin/commit: fix duplicated sentence in a comment

Signed-off-by: Markus Heidelberg <markus.heidelberg@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoIntegrate version 3 ciabot scripts into contrib/.
Eric Raymond [Fri, 2 Apr 2010 10:10:11 +0000 (06:10 -0400)]
Integrate version 3 ciabot scripts into contrib/.

These have been extensively live-tested in the last week. The version 2
ciabot.sh maintainer has passed the baton to me; ciabot.py is original.

Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff: avoid useless filespec population
Jeff King [Fri, 2 Apr 2010 00:14:24 +0000 (20:14 -0400)]
diff: avoid useless filespec population

builtin_diff calls fill_mmfile fairly early, which in turn
calls diff_populate_filespec, which actually retrieves the
file's blob contents into a buffer. Long ago, this was
sensible as we would need to look at the blobs eventually.

These days, however, we may not ever want those blobs if we
end up using a textconv cache, and for large binary files
(exactly the sort for which you might have a textconv
cache), just retrieving the objects can be costly.

This patch just pushes the fill_mmfile call a bit later, so
we can avoid populating the filespec in some cases.  There
is one thing to note that looks like a bug but isn't. We
push the fill_mmfile down into the first branch of a
conditional. It seems like we would need it on the other
branch, too, but we don't; fill_textconv does it for us (in
fact, before this, we were just writing over the results of
the fill_mmfile on that branch).

Here's a timing sample on a commit with 45 changed jpgs and
avis. The result is fully textconv cached, but we still
wasted a lot of time just pulling the blobs from storage.
The total size of the blobs (source and dest) is about
180M.

  [before]
  $ time git show >/dev/null
  real    0m0.352s
  user    0m0.148s
  sys     0m0.200s

  [after]
  $ time git show >/dev/null
  real    0m0.009s
  user    0m0.004s
  sys     0m0.004s

And that's on a warm cache. On a cold cache, the "after"
case is not much worse, but the "before" case has to do an
extra 180M of I/O.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agodiff: cache textconv output
Jeff King [Fri, 2 Apr 2010 00:12:15 +0000 (20:12 -0400)]
diff: cache textconv output

Running a textconv filter can take a long time. It's
particularly bad for a large file which needs to be spooled
to disk, but even for small files, the fork+exec overhead
can add up for something like "git log -p".

This patch uses the notes-cache mechanism to keep a fast
cache of textconv output. Caches are stored in
refs/notes/textconv/$x, where $x is the userdiff driver
defined in gitattributes.

Caching is enabled only if diff.$x.cachetextconv is true.

In my test repo, on a commit with 45 jpg and avi files
changed and a textconv to show their exif tags:

  [before]
  $ time git show >/dev/null
  real    0m13.724s
  user    0m12.057s
  sys     0m1.624s

  [after, first run]
  $ git config diff.mfo.cachetextconv true
  $ time git show >/dev/null
  real    0m14.252s
  user    0m12.197s
  sys     0m1.800s

  [after, subsequent runs]
  $ time git show >/dev/null
  real    0m0.352s
  user    0m0.148s
  sys     0m0.200s

So for a slight (3.8%) cost on the first run, we achieve an
almost 40x speed up on subsequent runs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agotextconv: refactor calls to run_textconv
Jeff King [Fri, 2 Apr 2010 00:09:26 +0000 (20:09 -0400)]
textconv: refactor calls to run_textconv

This patch adds a fill_textconv wrapper, which centralizes
some minor logic like error checking and handling the case
of no-textconv.

In addition to dropping the number of lines, this will make
it easier in future patches to handle multiple types of
textconv.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agointroduce notes-cache interface
Jeff King [Fri, 2 Apr 2010 00:07:40 +0000 (20:07 -0400)]
introduce notes-cache interface

Notes provide a fast lookup mechanism for data keyed by
sha1. This is ideal for caching certain operations, like
textconv filters.

This patch builds some infrastructure to make it simpler to
use notes trees as caches. In particular, caches:

  1. don't have arbitrary commit messages. They store a
     cache validity string in the commit, and clear the tree
     when the cache validity string changes.

  2. don't keep any commit history. The accumulated history
     of a a cache is just useless cruft.

  3. use a looser form of locking for ref updates. If two
     processes try to write to the cache simultaneously, it
     is OK if one overwrites the other, losing some changes.
     It's just a cache, so we will just end up with an extra
     miss.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomake commit_tree a library function
Jeff King [Fri, 2 Apr 2010 00:05:23 +0000 (20:05 -0400)]
make commit_tree a library function

Until now, this has been part of the commit-tree builtin.
However, it is already used by other builtins (like commit,
merge, and notes), and it would be useful to access it from
library code.

The check_valid helper has to come along, too, but is given
a more library-ish name of "assert_sha1_type".

Otherwise, the code is unchanged. There are still a few
rough edges for a library function, like printing the utf8
warning to stderr, but we can address those if and when they
come up as inappropriate.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofix textconv leak in emit_rewrite_diff
Jeff King [Fri, 2 Apr 2010 00:04:14 +0000 (20:04 -0400)]
fix textconv leak in emit_rewrite_diff

We correctly free() for the normal diff case, but leak for
rewrite diffs.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofix const-correctness of write_sha1_file
Jeff King [Fri, 2 Apr 2010 00:03:18 +0000 (20:03 -0400)]
fix const-correctness of write_sha1_file

These should take const buffers as input data, but zlib's
next_in pointer is not const-correct. Let's fix it at the
zlib level, though, so the cast happens in one obvious
place. This should be safe, as a similar cast is used in
zlib's example code for a const array.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: update defaults for modern Cygwin
Eric Blake [Thu, 1 Apr 2010 22:43:54 +0000 (16:43 -0600)]
Makefile: update defaults for modern Cygwin

Now that Cygwin 1.7.x has enabled lots of new features, and Cygwin 1.5
is no longer actively supported by the Cygwin mailing lists, we might
as well update the defaults to cater to those new features.

NO_TRUSTABLE_FILEMODE is only necessary on FAT drives; the Cygwin
community recommends NTFS drives, but there is still too much use
for FAT to switch the default.  Likewise, UNRELIABLE_FSTAT is probably
file-system specific, but worth keeping unchanged.

This commit does not change the default for NO_MMAP, although definitive
proof of whether this option is necessary is lacking.

Signed-off-by: Eric Blake <eblake@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoPrompt for a username when an HTTP request 401s
Scott Chacon [Thu, 1 Apr 2010 22:14:35 +0000 (15:14 -0700)]
Prompt for a username when an HTTP request 401s

When an HTTP request returns a 401, Git will currently fail with a
confusing message saying that it got a 401, which is not very
descriptive.

Currently if a user wants to use Git over HTTP, they have to use one
URL with the username in the URL (e.g. "http://user@host.com/repo.git")
for write access and another without the username for unauthenticated
read access (unless they want to be prompted for the password each
time). However, since the HTTP servers will return a 401 if an action
requires authentication, we can prompt for username and password if we
see this, allowing us to use a single URL for both purposes.

This patch changes http_request to prompt for the username and password,
then return HTTP_REAUTH so http_get_strbuf can try again.  If it gets
a 401 even when a user/pass is supplied, http_request will now return
HTTP_NOAUTH which remote_curl can then use to display a more
intelligent error message that is less confusing.

Signed-off-by: Scott Chacon <schacon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorevert: add "--strategy" option to choose merge strategy
Christian Couder [Wed, 31 Mar 2010 19:22:08 +0000 (21:22 +0200)]
revert: add "--strategy" option to choose merge strategy

This patch makes it possible to use a different merge strategy when
cherry-picking. This is usefull mainly for debugging purposes as it
allows to see if some failures are caused by the merge strategy used or
not.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge: make function try_merge_command non static
Christian Couder [Wed, 31 Mar 2010 19:22:07 +0000 (21:22 +0200)]
merge: make function try_merge_command non static

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge: refactor code that calls "git merge-STRATEGY"
Christian Couder [Wed, 31 Mar 2010 19:22:06 +0000 (21:22 +0200)]
merge: refactor code that calls "git merge-STRATEGY"

In the try_merge_strategy() function, when the strategy is "recursive"
or "subtree", the merge_recursive() function is called.
Otherwise we launch a "git merge-STRATEGY" process.

To make it possible to reuse code that launches a "git merge-STRATEGY"
process, this patch refactors this code into a new try_merge_command()
function.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorevert: refactor merge recursive code into its own function
Christian Couder [Wed, 31 Mar 2010 19:22:05 +0000 (21:22 +0200)]
revert: refactor merge recursive code into its own function

The code that is used to do a recursive merge is extracted from
the revert_or_cherry_pick() function and put into a new
do_recursive_merge() function.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agorevert: use strbuf to refactor the code that writes the merge message
Christian Couder [Wed, 31 Mar 2010 19:22:04 +0000 (21:22 +0200)]
revert: use strbuf to refactor the code that writes the merge message

The code in this commit was written by Stephan Beyer for the sequencer
GSoC project:

    git://repo.or.cz/git/sbeyer.git

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>