Code

git.git
15 years agopush: prepare sender to receive extended ref information from the receiver
Junio C Hamano [Tue, 9 Sep 2008 08:27:09 +0000 (01:27 -0700)]
push: prepare sender to receive extended ref information from the receiver

"git push" enhancement allows the receiving end to report not only its own
refs but refs in repositories it borrows from via the alternate object
store mechanism.  By telling the sender that objects reachable from these
extra refs are already complete in the receiving end, the number of
objects that need to be transfered can be cut down.

These entries are sent over the wire with string ".have", instead of the
actual names of the refs.  This string was chosen so that they are ignored
by older programs at the sending end.  If we sent some random but valid
looking refnames for these entries, "matching refs" rule (triggered when
running "git push" without explicit refspecs, where the sender learns what
refs the receiver has, and updates only the ones with the names of the
refs the sender also has) and "delete missing" rule (triggered when "git
push --mirror" is used, where the sender tells the receiver to delete the
refs it itself does not have) would try to update/delete them, which is
not what we want.

This prepares the send-pack (and "push" that runs native protocol) to
accept extended existing ref information and make use of it.  The ".have"
entries are excluded from ref matching rules, and are exempt from deletion
rule while pushing with --mirror option, but are still used for pack
generation purposes by providing more "bottom" range commits.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoreceive-pack: make it a builtin
Junio C Hamano [Tue, 9 Sep 2008 08:27:08 +0000 (01:27 -0700)]
receive-pack: make it a builtin

It is a good thing to do in general, but more importantly, transport
routines can only be used by built-ins, which is what I'll be adding next.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agois_directory(): a generic helper function
Junio C Hamano [Tue, 9 Sep 2008 08:27:07 +0000 (01:27 -0700)]
is_directory(): a generic helper function

A simple "grep -e stat --and -e S_ISDIR" revealed there are many
open-coded implementations of this function.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot6023-merge-file: Work around non-portable sed usage
Arjen Laarhoven [Mon, 8 Sep 2008 18:29:18 +0000 (20:29 +0200)]
t6023-merge-file: Work around non-portable sed usage

OS X sed doesn't understand '\n' on the right side of a substitution.
Use a valid substitution character instead and use 'tr' to convert
those to a newline.

Signed-off-by: Arjen Laarhoven <arjen@yaph.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoCorrect output of git-count-objects.
Mikael Magnusson [Mon, 8 Sep 2008 17:56:32 +0000 (19:56 +0200)]
Correct output of git-count-objects.

The non-verbose output was not changed in fdb2a2a (compat: introduce
on_disk_bytes(), 2008-08-18) which caused git-count-objects to claim 512
times too much space used for loose objects.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoWindows: git-shell can be compiled again
Johannes Sixt [Mon, 8 Sep 2008 10:46:55 +0000 (12:46 +0200)]
Windows: git-shell can be compiled again

The reason that git-shell was excluded from the Windows build was that
our compatibility layer needed stuff that was removed when we tried to
link less of the git library into git-shell. Since 4cfc24a (shell: do
not play duplicated definition games to shrink the executable,
2008-08-19) the complete library is linked again, so we can build
git-shell on Windows as well. (This fixes 'make install', which depends
on that git-shell is always built.)

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot/t91XX git-svn tests: run "git svn" not "git-svn"
Nanako Shiraishi [Mon, 8 Sep 2008 10:02:08 +0000 (19:02 +0900)]
t/t91XX git-svn tests: run "git svn" not "git-svn"

This replaces 'git-svn' with 'git svn' in the tests.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot/t91XX-svn: start removing use of "git-" from these tests
Nanako Shiraishi [Mon, 8 Sep 2008 10:02:05 +0000 (19:02 +0900)]
t/t91XX-svn: start removing use of "git-" from these tests

Subversion tests use too many "git-foo" form, so I am converting them
in two steps.

This first step replaces literal strings "remotes/git-svn" and "git-svn-id"
by introducing $remotes_git_svn and $git_svn_id constants defined as shell
variables.  This will reduce the number of false hits from "git grep".

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Mon, 8 Sep 2008 21:15:17 +0000 (14:15 -0700)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: fix handling of even funkier branch names

15 years agoMerge branch 'ar/autospell'
Junio C Hamano [Mon, 8 Sep 2008 06:52:16 +0000 (23:52 -0700)]
Merge branch 'ar/autospell'

* ar/autospell:
  Add help.autocorrect to enable/disable autocorrecting
  git wrapper: DWIM mistyped commands

15 years agoMerge branch 'jc/cc-ld-dynpath'
Junio C Hamano [Mon, 8 Sep 2008 06:45:56 +0000 (23:45 -0700)]
Merge branch 'jc/cc-ld-dynpath'

* jc/cc-ld-dynpath:
  configure: auto detect dynamic library path switches
  Makefile: Allow CC_LD_DYNPATH to be overriden

Conflicts:
Makefile
config.mak.in

15 years agoMerge branch 'jc/hide-cr-in-diff-from-less'
Junio C Hamano [Mon, 8 Sep 2008 06:45:40 +0000 (23:45 -0700)]
Merge branch 'jc/hide-cr-in-diff-from-less'

* jc/hide-cr-in-diff-from-less:
  diff: Help "less" hide ^M from the output

15 years agoMerge branch 'jc/maint-checkout-fix'
Junio C Hamano [Mon, 8 Sep 2008 05:44:45 +0000 (22:44 -0700)]
Merge branch 'jc/maint-checkout-fix'

* jc/maint-checkout-fix:
  checkout: do not check out unmerged higher stages randomly

Conflicts:
t/t7201-co.sh

15 years agoTeach "git diff -p" to locate PHP class methods
Andreas Ericsson [Sun, 7 Sep 2008 20:15:29 +0000 (22:15 +0200)]
Teach "git diff -p" to locate PHP class methods

Otherwise it will always print the class-name rather
than the name of the function inside that class.

While we're at it, reorder the gitattributes manpage to
list the built-in funcname pattern names in alphabetical
order.

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit-svn: fix handling of even funkier branch names
Eric Wong [Sun, 7 Sep 2008 03:18:18 +0000 (20:18 -0700)]
git-svn: fix handling of even funkier branch names

Apparently do_switch() tolerates the lack of escaping in less
funky branch names.  For the really strange and scary ones, we
need to escape them properly.  It strangely maintains compatible
with the existing handling of branch names with spaces and
exclamation marks.

Reported-by: m.skoric@web.de ($gmane/94677)
Signed-off-by: Eric Wong <normalperson@yhbt.net>
15 years agoUpdate draft release notes for 1.6.1
Junio C Hamano [Sun, 7 Sep 2008 01:22:00 +0000 (18:22 -0700)]
Update draft release notes for 1.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Sun, 7 Sep 2008 02:39:13 +0000 (19:39 -0700)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git-svn: set auto_props when renaming files
  t9124: clean up chdir usage
  git-svn: fix 'info' tests for unknown items
  git-svn: match SVN 1.5 behaviour of info' on unknown item
  git svn info: always quote URLs in 'info' output
  git svn info: make info relative to the current directory
  git svn info: tests: fix ptouch argument order in setup
  git svn info: tests: use test_cmp instead of git-diff
  git svn info: tests: do not use set -e
  git svn info: tests: let 'init' test run with SVN 1.5
  git svn: catch lack of upstream info for dcommit earlier
  git-svn: check error code of send_txstream
  git-svn: Send deltas during commits
  git-svn: Introduce SVN::Git::Editor::_chg_file_get_blob
  git-svn: extract base blob in generate_diff

15 years agogit-svn: set auto_props when renaming files
Paul Talacko [Sun, 7 Sep 2008 01:50:38 +0000 (18:50 -0700)]
git-svn: set auto_props when renaming files

Patch-by: Paul Talacko <gnuruandstuff@yahoo.co.uk>:
<http://article.gmane.org/gmane.comp.version-control.git/95006>
> Hello,
>
> There's an issue in git-svn as autoprops are not applied to
> renamed files, only to added files.
>
> This patch fixes the bug.

[ew: added test case]
Signed-off-by: Eric Wong <normalperson@yhbt.net>
15 years agot9124: clean up chdir usage
Eric Wong [Sun, 7 Sep 2008 01:29:12 +0000 (18:29 -0700)]
t9124: clean up chdir usage

Spawn subshells when running things in subdirectories instead of
chdir-ing to the path of an undefined variable, which is
confusing.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
15 years agoMerge updated git-gui and gitk that call each other
Junio C Hamano [Sun, 7 Sep 2008 01:06:39 +0000 (18:06 -0700)]
Merge updated git-gui and gitk that call each other

Merge git://repo.or.cz/git-gui and git://git.kernel.org/pub/scm/gitk/gitk

    * git://repo.or.cz/git-gui:
      git-gui: Show special diffs for complex conflict cases.
      git-gui: Make F5 reselect a diff, if an untracked file is selected.
      git-gui: Reimplement and enhance auto-selection of diffs.
      git-gui: Support conflict states _U & UT.
      git-gui: Support more merge tools.
      git-gui: Don't allow staging files with conflicts.
      git-gui: Support calling merge tools.
      git-gui: Support resolving conflicts via the diff context menu.
      git-gui: Mark forgotten strings for translation.
      git-gui: Allow specifying an initial line for git gui blame.
      git-gui: Better positioning in Blame Parent Commit
      git-gui: Support passing blame to a parent commit.
      git-gui: Support starting gitk from Gui Blame
      git-gui: Teach git gui about file type changes

    * git://git.kernel.org/pub/scm/gitk/gitk:
      gitk: Add menu item for calling git gui blame
      gitk: Add option to specify the default commit on command line

15 years agoMerge branch 'maint'
Junio C Hamano [Sat, 6 Sep 2008 23:47:32 +0000 (16:47 -0700)]
Merge branch 'maint'

* maint:
  Update draft release notes for 1.6.0.2
  stash: refresh the index before deciding if the work tree is dirty
  Mention the fact that 'git annotate' is only for backward compatibility.
  "blame -c" should be compatible with "annotate"
  git-gui: Fix diff parsing for lines starting with "--" or "++"
  git-gui: Fix string escaping in po2msg.sh
  git gui: show diffs with a minimum of 1 context line
  git-gui: update all remaining translations to French.
  git-gui: Update french translation

15 years agoUpdate draft release notes for 1.6.0.2
Junio C Hamano [Sat, 6 Sep 2008 23:18:31 +0000 (16:18 -0700)]
Update draft release notes for 1.6.0.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostash: refresh the index before deciding if the work tree is dirty
Junio C Hamano [Thu, 4 Sep 2008 09:41:22 +0000 (02:41 -0700)]
stash: refresh the index before deciding if the work tree is dirty

Unlike the case where the user does have a real change in the work tree,
refusing to work because of unclean stat information is not very helpful.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Nanako Shiraishi <nanako3@lavabit.com>
15 years agoMerge branch 'maint' of git://repo.or.cz/git-gui into maint
Junio C Hamano [Sat, 6 Sep 2008 23:03:22 +0000 (16:03 -0700)]
Merge branch 'maint' of git://repo.or.cz/git-gui into maint

* 'maint' of git://repo.or.cz/git-gui:
  git-gui: Fix diff parsing for lines starting with "--" or "++"
  git-gui: Fix string escaping in po2msg.sh
  git gui: show diffs with a minimum of 1 context line
  git-gui: update all remaining translations to French.
  git-gui: Update french translation

15 years agogit-svn: fix 'info' tests for unknown items
Thomas Rast [Fri, 29 Aug 2008 13:42:49 +0000 (15:42 +0200)]
git-svn: fix 'info' tests for unknown items

The previous tests all expected the results from SVN and Git to be
identical, and expected both to return success.  This cannot be
guaranteed: SVN changed the message style between 1.4 and 1.5, and
in 1.5, sets a failure exit code.

Change the tests to verify that 'git svn info <item>' sets a failure
exit code, and that its output contains the file name.  This should
hopefully catch all other errors.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: match SVN 1.5 behaviour of info' on unknown item
Thomas Rast [Fri, 29 Aug 2008 13:42:48 +0000 (15:42 +0200)]
git-svn: match SVN 1.5 behaviour of info' on unknown item

Previously 'git svn info unknown-file' only announced its failure (in
the SVN 1.4 style, "not a versioned resource"), and exited
successfully.

It is desirable to actually exit with failure, so change the code to
exit(1) under this condition.  Since that is already halfway SVN 1.5
compatibility, also change the error output to match 1.5.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit svn info: always quote URLs in 'info' output
Thomas Rast [Tue, 26 Aug 2008 19:32:37 +0000 (21:32 +0200)]
git svn info: always quote URLs in 'info' output

Changes 'git svn info' to always URL-escape the 'URL' and 'Repository'
fields and --url output, like SVN (at least 1.5) does.

Note that reusing the escape_url() further down in Git::SVN::Ra is not
possible because it only triggers for http(s) URLs.  I did not know
whether extending it to all schemes would break SVN access anywhere,
so I made a new one that quotes in all schemes.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit svn info: make info relative to the current directory
Thomas Rast [Tue, 26 Aug 2008 19:32:36 +0000 (21:32 +0200)]
git svn info: make info relative to the current directory

Previously 'git svn info <path>' would always treat the <path> as
relative to the working directory root, with a default of ".".  This
does not match the behaviour of 'svn info'.  Prepend $(git rev-parse
--show-prefix) to the path used inside cmd_info to make it relative to
the current working directory.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit svn info: tests: fix ptouch argument order in setup
Thomas Rast [Tue, 26 Aug 2008 19:32:35 +0000 (21:32 +0200)]
git svn info: tests: fix ptouch argument order in setup

The arguments must be <gitwc-path> <svnwc-path>, otherwise it fails to
update the timestamps (without setting a failure exit code) and
results in bad test output later on.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit svn info: tests: use test_cmp instead of git-diff
Thomas Rast [Tue, 26 Aug 2008 19:32:34 +0000 (21:32 +0200)]
git svn info: tests: use test_cmp instead of git-diff

git-diff does not appear to return the correct exit values, and gives
a false success for more than half (!) of the tests due to the space
in "trash directory" which git-svn fails to encode.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit svn info: tests: do not use set -e
Thomas Rast [Tue, 26 Aug 2008 19:32:33 +0000 (21:32 +0200)]
git svn info: tests: do not use set -e

Exiting in the middle of a test confuses the test suite, which will
just say "FATAL: Unexpected exit with code 1" in response to a failed
test, instead of actually diagnosing failure and continuing with the
next test.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit svn info: tests: let 'init' test run with SVN 1.5
Thomas Rast [Tue, 26 Aug 2008 19:32:32 +0000 (21:32 +0200)]
git svn info: tests: let 'init' test run with SVN 1.5

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit svn: catch lack of upstream info for dcommit earlier
Thomas Rast [Sun, 31 Aug 2008 13:50:59 +0000 (15:50 +0200)]
git svn: catch lack of upstream info for dcommit earlier

Since 711521e 'git svn dcommit' attempts to use the upstream
information to determine the SVN URL, before it verifies that it even
found an upstream.  Move up the corresponding check.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: check error code of send_txstream
Eric Wong [Mon, 1 Sep 2008 02:45:07 +0000 (19:45 -0700)]
git-svn: check error code of send_txstream

Not checking the error code of a function used to transform and
send data makes me nervous.  It currently returns "undef" on
success; so die if we get any result other than "undef" because
it's likely something went wrong somewhere.  I really wish this
function returned an MD5 like send_stream (or better yet, SHA1)
for verification.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: Send deltas during commits
Florian Weimer [Sun, 31 Aug 2008 15:47:09 +0000 (17:47 +0200)]
git-svn: Send deltas during commits

Signed-off-by: Florian Weimer <fw@deneb.enyo.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: Introduce SVN::Git::Editor::_chg_file_get_blob
Florian Weimer [Sun, 31 Aug 2008 15:45:04 +0000 (17:45 +0200)]
git-svn: Introduce SVN::Git::Editor::_chg_file_get_blob

Signed-off-by: Florian Weimer <fw@deneb.enyo.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agogit-svn: extract base blob in generate_diff
Florian Weimer [Sun, 31 Aug 2008 15:05:09 +0000 (17:05 +0200)]
git-svn: extract base blob in generate_diff

We need the base blob to compute a delta to be sent to the server.

Signed-off-by: Florian Weimer <fw@deneb.enyo.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
15 years agoMention the fact that 'git annotate' is only for backward compatibility.
Junio C Hamano [Fri, 5 Sep 2008 07:29:51 +0000 (00:29 -0700)]
Mention the fact that 'git annotate' is only for backward compatibility.

When somebody is reading git-blame.txt (or git-annotate.txt) for the first
time, the message we would like to send is:

 (1) Here is why you would want to use this command, what it can do
     (perhaps more than what you would have expected from "$scm blame"),
     and how you tell it to do what it does.

     This is obvious.

 (2) You might have heard of the command with the other name.  There is no
     difference between the two, except they differ in their default
     output formats.

     This is essential to answer: "git has both?  how are they different?"

 (3) We tend to encourage blame over annotate for new scripts and new
     people, but there is no reason to choose one over the other.

     This is not as important as (2), but would be useful to avoid
     repeated questions about "when will we start deprecating this?"

As long as we describe (2) on git-annotate page clearly enough, people who
read git-blame page first and get curious can refer to git-annotate page.
While at it, subtly hint (3) without being overly explicit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years ago"blame -c" should be compatible with "annotate"
Junio C Hamano [Fri, 5 Sep 2008 07:57:35 +0000 (00:57 -0700)]
"blame -c" should be compatible with "annotate"

There is no reason to have a separate variable cmd_is_annotate;
OUTPUT_ANNOTATE_COMPAT option is supposed to produce the compatibility
output, and we should produce the same output even when the command was
not invoked as "annotate" but as "blame -c".

Noticed by Pasky.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jc/maint-log-grep'
Junio C Hamano [Fri, 5 Sep 2008 05:30:44 +0000 (22:30 -0700)]
Merge branch 'jc/maint-log-grep'

* jc/maint-log-grep:
  log --author/--committer: really match only with name part
  diff --cumulative is a sub-option of --dirstat
  bash completion: Hide more plumbing commands

15 years agolog --author/--committer: really match only with name part
Junio C Hamano [Fri, 5 Sep 2008 05:15:02 +0000 (22:15 -0700)]
log --author/--committer: really match only with name part

When we tried to find commits done by AUTHOR, the first implementation
tried to pattern match a line with "^author .*AUTHOR", which later was
enhanced to strip leading caret and look for "^author AUTHOR" when the
search pattern was anchored at the left end (i.e. --author="^AUTHOR").

This had a few problems:

 * When looking for fixed strings (e.g. "git log -F --author=x --grep=y"),
   the regexp internally used "^author .*x" would never match anything;

 * To match at the end (e.g. "git log --author='google.com>$'"), the
   generated regexp has to also match the trailing timestamp part the
   commit header lines have.  Also, in order to determine if the '$' at
   the end means "match at the end of the line" or just a literal dollar
   sign (probably backslash-quoted), we would need to parse the regexp
   ourselves.

An earlier alternative tried to make sure that a line matches "^author "
(to limit by field name) and the user supplied pattern at the same time.
While it solved the -F problem by introducing a special override for
matching the "^author ", it did not solve the trailing timestamp nor tail
match problem.  It also would have matched every commit if --author=author
was asked for, not because the author's email part had this string, but
because every commit header line that talks about the author begins with
that field name, regardleses of who wrote it.

Instead of piling more hacks on top of hacks, this rethinks the grep
machinery that is used to look for strings in the commit header, and makes
sure that (1) field name matches literally at the beginning of the line,
followed by a SP, and (2) the user supplied pattern is matched against the
remainder of the line, excluding the trailing timestamp data.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Shawn O. Pearce [Fri, 5 Sep 2008 04:53:06 +0000 (21:53 -0700)]
Merge branch 'maint'

* maint:
  git-gui: Fix diff parsing for lines starting with "--" or "++"

15 years agogit-gui: Fix diff parsing for lines starting with "--" or "++"
Shawn O. Pearce [Fri, 5 Sep 2008 04:46:56 +0000 (21:46 -0700)]
git-gui: Fix diff parsing for lines starting with "--" or "++"

Languages like Lua and SQL use "--" to mark a line as commented out.
If this appears at column 0 and is part of the pre-image we may see
"--- foo" in the diff, indicating that the line whose content is
 "-- foo" has been removed from the new version.

git-gui was incorrectly parsing "--- foo" as the old file name
in the file header, causing it to generate a bad patch file when
the user tried to stage or unstage a hunk or the selected line.
We need to keep track of where we are in the parsing so that we do
not misread a deletion or addition record as part of the header.

Reported-by: Alexander Gladysh <agladysh@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Show special diffs for complex conflict cases.
Alexander Gavrilov [Sat, 30 Aug 2008 21:05:22 +0000 (01:05 +0400)]
git-gui: Show special diffs for complex conflict cases.

Add special handling for displaying diffs of modified/deleted,
and symlink/mode conflicts. Currently the display is completely
unusable for deciding how to resolve the conflict.

New display modes:

1) Deleted/Modified conflict: e.g.
LOCAL: deleted
REMOTE:
[diff :1:$path :3:$path]

2) Conflict involving symlinks:
LOCAL:
[diff :1:$path :2:$path]
REMOTE:
[diff :1:$path :3:$path]

In order to be able to display multiple diffs, this
patch adds a queue of commands to call.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Make F5 reselect a diff, if an untracked file is selected.
Alexander Gavrilov [Sat, 30 Aug 2008 21:04:10 +0000 (01:04 +0400)]
git-gui: Make F5 reselect a diff, if an untracked file is selected.

If an untracked file is selected, F5 and other manual rescan synonyms
would try to select a tracked file instead. Also, clicking on an icon
in the unstaged changes list skips over untracked files, unless the
file clicked is untracked itself.

The objective is to make it easier to ignore untracked files showing
up in the Unstaged Changes list, and ensure that no modifications
to tracked objects are left unstaged.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Reimplement and enhance auto-selection of diffs.
Alexander Gavrilov [Sat, 30 Aug 2008 21:02:56 +0000 (01:02 +0400)]
git-gui: Reimplement and enhance auto-selection of diffs.

Generalize the next_diff system, and implement auto-reselection
for merge tool resolution and reshow_diff. Also add auto-selection
of diffs after rescan, if no diff is already selected.

New auto-select rules:

- Rescan auto-selects the first conflicting file, or if none
  a modified tracked file, if nothing was selected previously.
- Resolving a conflict auto-selects the nearest conflicting
  file, or nothing if everything is resolved.
- Staging the last remaining hunk auto-selects the nearest
  modified staged file.
- Staging a file through its icon auto-selects the nearest file.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Support conflict states _U & UT.
Alexander Gavrilov [Sat, 30 Aug 2008 21:00:49 +0000 (01:00 +0400)]
git-gui: Support conflict states _U & UT.

Support _U (local deleted, remote modified) and
UT (file type changed in conflict) modes.

Note that 'file type changed' does not refer to
changes in the executable bit, instead it denotes
replacing a file with a link, or vice versa.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Support more merge tools.
Alexander Gavrilov [Sat, 30 Aug 2008 20:59:47 +0000 (00:59 +0400)]
git-gui: Support more merge tools.

Add native support for Araxis Merge, WinMerge and Perforce merge.

Custom merge tools are not implemented by mergetool.tcl; besides,
native support allows constructing the command lines in a more
intelligent way.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Don't allow staging files with conflicts.
Alexander Gavrilov [Sat, 30 Aug 2008 20:54:19 +0000 (00:54 +0400)]
git-gui: Don't allow staging files with conflicts.

Prevent staging files with conflict markers by clicking
on the icon in the 'Unstaged Changes' list. Instead, pretend
that the user clicked the name, and show the diff.

Originally it made some sense to allow staging conflicting
files, because git-gui did not provide any tools to resolve
them from within the GUI. But now that we have added mergetool
capabilities, it is more likely to cause accidental and
non-undoable errors.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Support calling merge tools.
Alexander Gavrilov [Sat, 30 Aug 2008 20:56:51 +0000 (00:56 +0400)]
git-gui: Support calling merge tools.

Adds an item to the diff context menu in conflict mode,
which invokes a merge tool for the selected file. Tool
command-line handling code was ported from git-mergetool.

Automatic default tool selection and custom merge tools
are not supported. If merge.tool is not set, git-gui
defaults to meld.

This implementation uses a checkout-index hack in order
to retrieve all stages with autocrlf and filters properly
applied. It requires temporarily moving the original
conflict file out of the way.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Support resolving conflicts via the diff context menu.
Alexander Gavrilov [Sat, 30 Aug 2008 20:55:45 +0000 (00:55 +0400)]
git-gui: Support resolving conflicts via the diff context menu.

If the file has merge conflicts, show a special version of the
diff context menu, which includes conflict resolution commands
instead of Stage Hunk/Line. This patch only supports resolving
by discarding all sides except one.

Discarding is the only way to resolve conflicts involving symlinks
and/or deletion, excluding manual editing.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit-gui: Mark forgotten strings for translation.
Christian Stimming [Thu, 4 Sep 2008 09:50:53 +0000 (11:50 +0200)]
git-gui: Mark forgotten strings for translation.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agodiff --cumulative is a sub-option of --dirstat
Junio C Hamano [Wed, 3 Sep 2008 00:28:59 +0000 (17:28 -0700)]
diff --cumulative is a sub-option of --dirstat

The option used to be implemented as if it is a totally independent one,
but "git diff --cumulative" would not mean anything without "--dirstat".

This makes --cumulative imply --dirstat.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agobash completion: Hide more plumbing commands
Petr Baudis [Tue, 26 Aug 2008 17:11:44 +0000 (19:11 +0200)]
bash completion: Hide more plumbing commands

git <tab><tab> still shows way too many commands, some of them
are clearly plumbing. This patch hides the plumbing commands
liberally (that is, in special cases, users still might want to
call one of the hidden commands, a *normal* workflow should never
involve these, though - and if it does, we have a UI problem anyway).

Signed-off-by: Petr Baudis <pasky@suse.cz>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoUpdate draft release notes for 1.6.1
Junio C Hamano [Wed, 3 Sep 2008 23:27:59 +0000 (16:27 -0700)]
Update draft release notes for 1.6.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 3 Sep 2008 23:08:23 +0000 (16:08 -0700)]
Merge branch 'maint'

* maint:
  Start 1.6.0.2 maintenance cycle
  tests: use "git xyzzy" form (t7200 - t9001)
  tests: use "git xyzzy" form (t7000 - t7199)
  Fix passwd(5) ref and reflect that commit doens't use commit-tree
  improve handling of sideband message display
  tests: use "git xyzzy" form (t3600 - t6999)
  tests: use "git xyzzy" form (t0000 - t3599)
  checkout: fix message when leaving detached HEAD
  clone: fix creation of explicitly named target directory
  'git foo' program identifies itself without dash in die() messages
  setup_git_directory(): fix move to worktree toplevel directory
  update-index: fix worktree setup
  Start conforming code to "git subcmd" style
  read-tree: setup worktree if merge is required
  grep: fix worktree setup
  diff*: fix worktree setup

Conflicts:
RelNotes
t/t3900-i18n-commit.sh
t/t7003-filter-branch.sh

15 years agoStart 1.6.0.2 maintenance cycle
Junio C Hamano [Wed, 3 Sep 2008 22:39:19 +0000 (15:39 -0700)]
Start 1.6.0.2 maintenance cycle

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'nd/worktree' into maint
Junio C Hamano [Wed, 3 Sep 2008 22:35:37 +0000 (15:35 -0700)]
Merge branch 'nd/worktree' into maint

* nd/worktree:
  setup_git_directory(): fix move to worktree toplevel directory
  update-index: fix worktree setup
  read-tree: setup worktree if merge is required
  grep: fix worktree setup
  diff*: fix worktree setup

15 years agoMerge branch 'ho/dashless' into maint
Junio C Hamano [Wed, 3 Sep 2008 21:51:56 +0000 (14:51 -0700)]
Merge branch 'ho/dashless' into maint

* ho/dashless:
  tests: use "git xyzzy" form (t7200 - t9001)
  tests: use "git xyzzy" form (t7000 - t7199)
  tests: use "git xyzzy" form (t3600 - t6999)
  tests: use "git xyzzy" form (t0000 - t3599)
  'git foo' program identifies itself without dash in die() messages
  Start conforming code to "git subcmd" style

15 years agotests: use "git xyzzy" form (t7200 - t9001)
Nanako Shiraishi [Wed, 3 Sep 2008 08:59:33 +0000 (17:59 +0900)]
tests: use "git xyzzy" form (t7200 - t9001)

Converts tests between t7201-t9001.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotests: use "git xyzzy" form (t7000 - t7199)
Nanako Shiraishi [Wed, 3 Sep 2008 08:59:31 +0000 (17:59 +0900)]
tests: use "git xyzzy" form (t7000 - t7199)

Converts tests between t7001-t7103.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix passwd(5) ref and reflect that commit doens't use commit-tree
Jonas Fonseca [Wed, 3 Sep 2008 08:50:43 +0000 (10:50 +0200)]
Fix passwd(5) ref and reflect that commit doens't use commit-tree

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoimprove handling of sideband message display
Nicolas Pitre [Wed, 3 Sep 2008 19:13:42 +0000 (15:13 -0400)]
improve handling of sideband message display

Currently the code looks for line break characters in order to prepend
"remote: " to every line received as many lines can be sent in a single
chunk.  However the opposite might happen too, i.e. a single message
line split amongst multiple chunks.  This patch adds support for the
later case to avoid displays like:

remote: Compressing objeremote: cts: 100% (313/313), done.

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotests: use "git xyzzy" form (t3600 - t6999)
Nanako Shiraishi [Wed, 3 Sep 2008 08:59:29 +0000 (17:59 +0900)]
tests: use "git xyzzy" form (t3600 - t6999)

Converts tests between t3600-t6300.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agotests: use "git xyzzy" form (t0000 - t3599)
Nanako Shiraishi [Wed, 3 Sep 2008 08:59:27 +0000 (17:59 +0900)]
tests: use "git xyzzy" form (t0000 - t3599)

Converts tests between t0050-t3903.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocheckout: fix message when leaving detached HEAD
Jeff King [Wed, 3 Sep 2008 18:07:26 +0000 (14:07 -0400)]
checkout: fix message when leaving detached HEAD

The shell version of git checkout would print:

  Previous HEAD position was 1234abcd... commit subject line

when leaving a detached HEAD for another commit. Ths C
version attempted to implement this, but got the condition
wrong such that the behavior never triggered.

This patch simplifies the conditions for showing the message
to the ones used by the shell version: any time we are
leaving a detached HEAD and the new and old commits are not
the same (this suppresses it for the "git checkout -b new"
case recommended when you enter the detached state).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoclone: fix creation of explicitly named target directory
Clemens Buchacher [Wed, 3 Sep 2008 18:55:55 +0000 (20:55 +0200)]
clone: fix creation of explicitly named target directory

'git clone <repo> path/' (note the trailing slash) fails, because the
entire path is interpreted as leading directories. So when mkdir tries to
create the actual path, it already exists.

This makes sure trailing slashes are removed.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'tr/filter-branch'
Junio C Hamano [Wed, 3 Sep 2008 00:47:13 +0000 (17:47 -0700)]
Merge branch 'tr/filter-branch'

* tr/filter-branch:
  revision --simplify-merges: make it a no-op without pathspec
  revision --simplify-merges: do not leave commits unprocessed
  revision --simplify-merges: use decoration instead of commit->util field
  Documentation: rev-list-options: move --simplify-merges documentation
  filter-branch: use --simplify-merges
  filter-branch: fix ref rewriting with --subdirectory-filter
  filter-branch: Extend test to show rewriting bug
  Topo-sort before --simplify-merges
  revision traversal: show full history with merge simplification
  revision.c: whitespace fix

15 years agoMerge branch 'np/maint-safer-pack'
Junio C Hamano [Wed, 3 Sep 2008 00:46:48 +0000 (17:46 -0700)]
Merge branch 'np/maint-safer-pack'

* np/maint-safer-pack:
  fixup_pack_header_footer(): use nicely aligned buffer sizes
  index-pack: use fixup_pack_header_footer()'s validation mode
  pack-objects: use fixup_pack_header_footer()'s validation mode
  improve reliability of fixup_pack_header_footer()
  pack-objects: improve returned information from write_one()

15 years agoMerge branch 'rf/man-env'
Junio C Hamano [Wed, 3 Sep 2008 00:45:41 +0000 (17:45 -0700)]
Merge branch 'rf/man-env'

* rf/man-env:
  builtin-help: fallback to GIT_MAN_VIEWER before man

15 years agoMerge branch 'jc/author-nickname'
Junio C Hamano [Wed, 3 Sep 2008 00:45:28 +0000 (17:45 -0700)]
Merge branch 'jc/author-nickname'

* jc/author-nickname:
  git commit --author=$name: look $name up in existing commits

15 years agoMerge branch 'dp/pid-uintmax'
Junio C Hamano [Wed, 3 Sep 2008 00:45:25 +0000 (17:45 -0700)]
Merge branch 'dp/pid-uintmax'

* dp/pid-uintmax:
  cast pid_t's to uintmax_t to improve portability

15 years agogitweb: ref markers link to named shortlogs
Giuseppe Bilotta [Tue, 2 Sep 2008 19:47:05 +0000 (21:47 +0200)]
gitweb: ref markers link to named shortlogs

This patch turns ref markers for tags and heads into links to
appropriate views for the ref name, depending on current context.

For annotated tags, we link to the tag view, unless that's the current
view, in which case we switch to shortlog. For other refs, we prefer the
current view if it's history or (short)log, and default to shortlog
otherwise.

Appropriate changes are made in the CSS to prevent ref markers from
being annoyingly blue and underlined, unless hovered. A visual
indication of the target view difference is also implemented by making
annotated tags show up in italic.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Acked-by: Petr Baudis <pasky@suse.cz>
Acked-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Wed, 3 Sep 2008 00:10:08 +0000 (17:10 -0700)]
Merge branch 'maint'

* maint:
  Makefile: add merge_recursive.h to LIB_H
  Improve documentation for --dirstat diff option
  Bring local clone's origin URL in line with that of a remote clone
  Documentation: minor cleanup in a use case in 'git stash' manual
  Documentation: fix disappeared lines in 'git stash' manpage
  Documentation: fix reference to a for-each-ref option

15 years agoMakefile: add merge_recursive.h to LIB_H
Miklos Vajna [Tue, 2 Sep 2008 23:49:05 +0000 (01:49 +0200)]
Makefile: add merge_recursive.h to LIB_H

When modifying merge-recursive.h, for example builtin-merge-recursive.c
have to be recompiled which was not true till now, causing various
runtime errors using an incremental build.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoImprove documentation for --dirstat diff option
Heikki Orsila [Mon, 1 Sep 2008 00:50:28 +0000 (03:50 +0300)]
Improve documentation for --dirstat diff option

Signed-off-by: Heikki Orsila <heikki.orsila@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoBring local clone's origin URL in line with that of a remote clone
Johan Herland [Mon, 1 Sep 2008 19:07:33 +0000 (21:07 +0200)]
Bring local clone's origin URL in line with that of a remote clone

On a local clone, "git clone" would use the fully DWIMmed path as the origin
URL in the resulting repo. This was slightly inconsistent with the case of a
remote clone where the _given_ URL was used as the origin URL (because the
DWIMming was done remotely, and was therefore not available to "git clone").

This behaviour caused problems when cloning a local non-bare repo with
relative submodule URLs, because these submodule URLs would then be resolved
against the DWIMmed URL (e.g. "/repo/.git") instead of the given URL (e.g.
"/repo").

This patch teaches "git clone" to use the _given_ URL - instead of the
DWIMmed path - as the origin URL. This causes relative submodule URLs to be
resolved correctly, as long the _given_ URL indicates the correct directory
against which the submodule URLs should be resolved.

The patch also updates a testcase that contained the old-style origin URLs.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: minor cleanup in a use case in 'git stash' manual
SZEDER Gábor [Tue, 2 Sep 2008 01:45:01 +0000 (03:45 +0200)]
Documentation: minor cleanup in a use case in 'git stash' manual

There is no need to explicitly pass the file to be committed to 'git
commit', because it's contents is already in the index.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: fix disappeared lines in 'git stash' manpage
SZEDER Gábor [Tue, 2 Sep 2008 01:35:24 +0000 (03:35 +0200)]
Documentation: fix disappeared lines in 'git stash' manpage

Asciidoc removes lines starting with a dot when creating manpages.
Since those lines were comments in use case examples showing shell
commands, preceed those lines with a hash sign.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocumentation: fix reference to a for-each-ref option
SZEDER Gábor [Mon, 1 Sep 2008 21:02:09 +0000 (23:02 +0200)]
Documentation: fix reference to a for-each-ref option

... to match the synopsis section

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Shawn O. Pearce [Mon, 1 Sep 2008 22:39:56 +0000 (15:39 -0700)]
Merge branch 'maint'

* maint:
  git-gui: Fix string escaping in po2msg.sh
  git gui: show diffs with a minimum of 1 context line

Conflicts:
lib/option.tcl

15 years agogit-gui: Fix string escaping in po2msg.sh
Alexander Gavrilov [Sat, 30 Aug 2008 21:12:26 +0000 (01:12 +0400)]
git-gui: Fix string escaping in po2msg.sh

Escape '$', because otherwise git-gui crashes while
trying to load malformed Japanese localization strings.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agogit gui: show diffs with a minimum of 1 context line
Clemens Buchacher [Sat, 30 Aug 2008 16:45:27 +0000 (18:45 +0200)]
git gui: show diffs with a minimum of 1 context line

Staging hunks without context does not work, because line number
information would have to be recomputed for individual hunks.

Since it is already possible to stage individual lines using
'Stage Line for Commit', zero context diffs are not really
necessary for git gui.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
15 years agoMerge branch 'tr/rev-list-docs' into tr/filter-branch
Junio C Hamano [Sun, 31 Aug 2008 17:41:01 +0000 (10:41 -0700)]
Merge branch 'tr/rev-list-docs' into tr/filter-branch

This prepares the necessary parts to merge filter-branch
fix based on simplify-merges to master.

15 years agocast pid_t's to uintmax_t to improve portability
David Soria Parra [Sun, 31 Aug 2008 12:09:39 +0000 (14:09 +0200)]
cast pid_t's to uintmax_t to improve portability

Some systems (like e.g. OpenSolaris) define pid_t as long,
therefore all our sprintf that use %i/%d cause a compiler warning
beacuse of the implicit long->int cast. To make sure that
we fit the limits, we display pids as PRIuMAX and cast them explicitly
to uintmax_t.

Signed-off-by: David Soria Parra <dsp@php.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 31 Aug 2008 23:52:53 +0000 (16:52 -0700)]
Merge branch 'maint'

* maint:
  Document sendemail.envelopesender configuration
  Document clarification: gitmodules, gitattributes
  config.txt: Add missing colons after option name

15 years agoDocument sendemail.envelopesender configuration
Ask Bjørn Hansen [Sun, 31 Aug 2008 20:32:43 +0000 (13:32 -0700)]
Document sendemail.envelopesender configuration

Signed-off-by: Ask Bjørn Hansen <ask@develooper.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDocument clarification: gitmodules, gitattributes
Gustaf Hendeby [Sun, 31 Aug 2008 16:00:27 +0000 (18:00 +0200)]
Document clarification: gitmodules, gitattributes

The SYNOPSIS section of gitattibutes and gitmodule fail to clearly
specify the name of the in tree files used.  This patch brings in the
initial `.' and the fact that the `.gitmodules' file should reside at
the top-level of the working tree.

Signed-off-by: Gustaf Hendeby <hendeby@isy.liu.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd help.autocorrect to enable/disable autocorrecting
Alex Riesen [Sun, 31 Aug 2008 13:54:58 +0000 (15:54 +0200)]
Add help.autocorrect to enable/disable autocorrecting

It is off(0) by default, to avoid scaring people unless they asked to.
If set to a non-0 value, wait for that amount of deciseconds before
running the corrected command.

Suggested by Junio, so he has a chance to hit Ctrl-C.

Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit wrapper: DWIM mistyped commands
Johannes Schindelin [Sun, 31 Aug 2008 13:50:23 +0000 (15:50 +0200)]
git wrapper: DWIM mistyped commands

This patch introduces a modified Damerau-Levenshtein algorithm into
Git's code base, and uses it with the following penalties to show some
similar commands when an unknown command was encountered:

swap = 0, insertion = 1, substitution = 2, deletion = 4

A typical output would now look like this:

$ git sm
git: 'sm' is not a git-command. See 'git --help'.

Did you mean one of these?
am
rm

The cut-off is at similarity rating 6, which was empirically determined
to give sensible results.

As a convenience, if there is only one candidate, Git continues under
the assumption that the user mistyped it.  Example:

$ git reabse
WARNING: You called a Git program named 'reabse', which does
not exist.
Continuing under the assumption that you meant 'rebase'
[...]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Alex Riesen <raa.lkml@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years ago'git foo' program identifies itself without dash in die() messages
Junio C Hamano [Sun, 31 Aug 2008 16:39:19 +0000 (09:39 -0700)]
'git foo' program identifies itself without dash in die() messages

This is a mechanical conversion of all '*.c' files with:

s/((?:die|error|warning)\("git)-(\S+:)/$1 $2/;

The result was manually inspected and no false positive was found.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agosetup_git_directory(): fix move to worktree toplevel directory
Nguyễn Thái Ngọc Duy [Sat, 30 Aug 2008 09:15:32 +0000 (16:15 +0700)]
setup_git_directory(): fix move to worktree toplevel directory

When setup_git_directory() returns successfully, it is supposed to move
current working directory to worktree toplevel directory.

However, the code recomputing prefix inside setup_git_directory() has
to move cwd back to original working directory, in order to get new
prefix.  After that, it should move cwd back to worktree toplevel
directory as expected.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoupdate-index: fix worktree setup
Nguyễn Thái Ngọc Duy [Sat, 30 Aug 2008 09:13:58 +0000 (16:13 +0700)]
update-index: fix worktree setup

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoconfig.txt: Add missing colons after option name
Teemu Likonen [Fri, 29 Aug 2008 07:29:42 +0000 (10:29 +0300)]
config.txt: Add missing colons after option name

gitcvs.usecrlfattr --> gitcvs.usecrlfattr::

This fixes an asciidoc markup issue.

Signed-off-by: Teemu Likonen <tlikonen@iki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogit commit --author=$name: look $name up in existing commits
Junio C Hamano [Wed, 27 Aug 2008 06:13:13 +0000 (23:13 -0700)]
git commit --author=$name: look $name up in existing commits

This allows "git commit --author=$name" to accept a name that is not in
the required "A U Thor <author@example.xz>" format, and use that to look
up an author name that matches from existing commits.

When using this feature, it is the user's responsibility to give a name
that uniquely matches the name s/he wants, as the logic returns the name
from the first matching commit.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agodiff: Help "less" hide ^M from the output
Junio C Hamano [Thu, 28 Aug 2008 02:48:01 +0000 (19:48 -0700)]
diff: Help "less" hide ^M from the output

When the tracked contents have CRLF line endings, colored diff output
shows "^M" at the end of output lines, which is distracting, even though
the pager we use by default ("less") knows to hide them.

The problem is that "less" hides a carriage-return only at the end of the
line, immediately before a line feed.  The colored diff output does not
take this into account, and emits four element sequence for each line:

   - force this color;
   - the line up to but not including the terminating line feed;
   - reset color
   - line feed.

By including the carriage return at the end of the line in the second
item, we are breaking the smart our pager has in order not to show "^M".
This can be fixed by changing the sequence to:

   - force this color;
   - the line up to but not including the terminating end-of-line;
   - reset color
   - end-of-line.

where end-of-line is either a single linefeed or a CRLF pair.  When the
output is not colored, "force this color" and "reset color" sequences are
both empty, so we won't have this problem with or without this patch.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Sun, 31 Aug 2008 03:31:39 +0000 (20:31 -0700)]
Merge branch 'maint'

* maint:
  gitattributes: -crlf is not binary
  git-apply: Loosen "match_beginning" logic
  Fix example in git-name-rev documentation
  shell: do not play duplicated definition games to shrink the executable
  Fix use of hardlinks in "make install"
  pack-objects: Allow missing base objects when creating thin packs

15 years agogitattributes: -crlf is not binary
Junio C Hamano [Sat, 30 Aug 2008 21:35:15 +0000 (14:35 -0700)]
gitattributes: -crlf is not binary

The description of crlf attribute incorrectly said that "-crlf" means
binary.  It is true that for binary files you would want "-crlf", but
that is not the same thing.

We also have supported attribute macros and via that mechanism a handy
"binary" to specify "-crlf -diff" at the same time.  It was not documented
anywhere as far as I can tell, even though the support was there from
the very beginning.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocheckout: do not check out unmerged higher stages randomly
Junio C Hamano [Fri, 29 Aug 2008 20:40:36 +0000 (13:40 -0700)]
checkout: do not check out unmerged higher stages randomly

During a conflicted merge when you have unmerged stages for a
path F in the index, if you said:

    $ git checkout F

we rewrote F as many times as we have stages for it, and the
last one (typically "theirs") was left in the work tree, without
resolving the conflict.

This fixes it by noticing that a specified pathspec pattern
matches an unmerged path, and by erroring out.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'jc/post-simplify' (early part) into tr/filter-branch
Junio C Hamano [Sat, 30 Aug 2008 23:03:40 +0000 (16:03 -0700)]
Merge branch 'jc/post-simplify' (early part) into tr/filter-branch

* 'jc/post-simplify' (early part):
  revision --simplify-merges: make it a no-op without pathspec
  revision --simplify-merges: do not leave commits unprocessed
  revision --simplify-merges: use decoration instead of commit->util field