Code

git.git
14 years agoRename t9301 to t9350, to make room for more fast-import tests
Johan Herland [Mon, 7 Dec 2009 11:27:25 +0000 (12:27 +0100)]
Rename t9301 to t9350, to make room for more fast-import tests

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agofast-import: Proper notes tree manipulation
Johan Herland [Mon, 7 Dec 2009 11:27:24 +0000 (12:27 +0100)]
fast-import: Proper notes tree manipulation

This patch teaches 'git fast-import' to automatically organize note objects
in a fast-import stream into an appropriate fanout structure. The notes API
in notes.h is NOT used to accomplish this, because trying to keep the
fast-import and notes data structures in sync would yield a significantly
larger patch with higher complexity.

Note objects are added with the 'N' command, and accounted for with a
per-branch counter, which is used to trigger fanout restructuring when
needed. Note that when restructuring the branch tree, _any_ entry whose
path consists of 40 hex chars (not including directory separators) will
be recognized as a note object. It is therefore not advisable to
manipulate note entries with M/D/R/C commands.

Since note objects are stored in the same tree structure as other objects,
the unloading and reloading of a fast-import branches handle note objects
transparently.

This patch has been improved by the following contributions:
- Shawn O. Pearce: Several style- and logic-related improvements

Cc: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoFix crasher on encountering SHA1-like non-note in notes tree
Johan Herland [Thu, 3 Dec 2009 03:53:54 +0000 (04:53 +0100)]
Fix crasher on encountering SHA1-like non-note in notes tree

When loading a notes tree, the code primarily looks for SHA1-like paths
whose total length (discounting directory separators) are 40 chars
(interpreted as valid note entries) or less (interpreted as subtree
entries that may in turn contain note entries when unpacked).

However, there is an additional condition that must hold for valid
subtree entries: They must be _tree_ objects (duh).

This patch adds an appropriate test for this condition, thereby fixing
the crash that occured when passing a non-tree object to the tree-walk
API.

The patch also adds another selftest verifying correct behaviour of
non-notes in note trees.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'
Brandon Casey [Thu, 3 Dec 2009 17:52:46 +0000 (11:52 -0600)]
t9001: use older Getopt::Long boolean prefix '--no' rather than '--no-'

The '--no-chain-reply-to' option is a Getopt::Long boolean option. The
'--no-' prefix (as in --no-chain-reply-to) for boolean options is not
supported in Getopt::Long version 2.32 which was released with Perl 5.8.0.
This version only supports '--no' as in '--nochain-reply-to'.  More recent
versions of Getopt::Long, such as version 2.34, support either prefix. So
use the older form in the tests.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge in 1.6.5.4
Junio C Hamano [Thu, 3 Dec 2009 08:37:56 +0000 (00:37 -0800)]
Merge in 1.6.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoGit 1.6.5.4 v1.6.5.4
Junio C Hamano [Thu, 3 Dec 2009 08:08:16 +0000 (00:08 -0800)]
Git 1.6.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoUnconditionally set man.base.url.for.relative.links
Junio C Hamano [Thu, 3 Dec 2009 08:06:52 +0000 (00:06 -0800)]
Unconditionally set man.base.url.for.relative.links

Even setting it to empty is better than leaving it unset as it
prevents the warning cruft from appearing in the output.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Thu, 3 Dec 2009 02:45:26 +0000 (02:45 +0000)]
Merge branch 'maint'

14 years agoDocumentation/Makefile: allow man.base.url.for.relative.link to be set from Make
Junio C Hamano [Thu, 3 Dec 2009 02:45:09 +0000 (02:45 +0000)]
Documentation/Makefile: allow man.base.url.for.relative.link to be set from Make

Signed-off-by: Junio C Hamano <junio@kernel.org>
14 years agoGit 1.6.6-rc1 v1.6.6-rc1
Junio C Hamano [Wed, 2 Dec 2009 18:50:17 +0000 (10:50 -0800)]
Git 1.6.6-rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogit-pull.sh: Fix call to git-merge for new command format
Horst H. von Brand [Tue, 1 Dec 2009 22:44:11 +0000 (19:44 -0300)]
git-pull.sh: Fix call to git-merge for new command format

Now "git merge <msg> HEAD" is officially deprecated, we should
clean our own use as well.

Signed-off-by: Horst H. von Brand <vonbrand@inf.utfsm.cl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Wed, 2 Dec 2009 18:30:12 +0000 (10:30 -0800)]
Merge branch 'maint'

* maint:
  Prepare for 1.6.5.4
  merge: do not add standard message when message is given with -m option
  Do not misidentify "git merge foo HEAD" as an old-style invocation

Conflicts:
RelNotes

14 years agoPrepare for 1.6.5.4
Junio C Hamano [Wed, 2 Dec 2009 18:29:00 +0000 (10:29 -0800)]
Prepare for 1.6.5.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge: do not add standard message when message is given with -m option
Junio C Hamano [Wed, 2 Dec 2009 18:00:58 +0000 (10:00 -0800)]
merge: do not add standard message when message is given with -m option

Even if the user explicitly gave her own message to "git merge", the
command still added its standard merge message.  It resulted in a
useless repetition like this:

    % git merge -m "Merge early part of side branch" `git rev-parse side~2`
    % git show -s
    commit 37217141e7519629353738d5e4e677a15096206f
    Merge: e68e646 a1d2374
    Author: しらいし ななこ <nanako3@lavabit.com>
    Date:   Wed Dec 2 14:33:20 2009 +0900

Merge early part of side branch

Merge commit 'a1d2374f8f52f4e8a53171601a920b538a6cec23'

The gave her own message because she didn't want git to add the
standard message (if she wanted to, she wouldn't have given one,
or she would have prepared it using git-fmt-merge-msg command).

Noticed by Nanako Shiraishi

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDo not misidentify "git merge foo HEAD" as an old-style invocation
Junio C Hamano [Wed, 2 Dec 2009 17:59:35 +0000 (09:59 -0800)]
Do not misidentify "git merge foo HEAD" as an old-style invocation

This was misinterpreted as an ancient style "git merge <message> HEAD
<commit> <commit>..." that merges one (or more) <commit> into the current
branch and record the resulting commit with the given message.  Then a
later sanity check found that there is no <commit> specified and gave
a usage message.

Tested-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoUpdate draft release notes to 1.6.6 before -rc1
Junio C Hamano [Mon, 30 Nov 2009 23:54:08 +0000 (15:54 -0800)]
Update draft release notes to 1.6.6 before -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Tue, 1 Dec 2009 20:47:04 +0000 (12:47 -0800)]
Merge branch 'maint'

* maint:
  help: Do not unnecessarily look for a repository
  Documentation: Fix a few i.e./e.g. mix-ups
  Documentation: Document --branch option in git clone synopsis

14 years agoMerge branch 'jc/deprecate-old-syntax-from-merge'
Junio C Hamano [Tue, 1 Dec 2009 20:47:01 +0000 (12:47 -0800)]
Merge branch 'jc/deprecate-old-syntax-from-merge'

* jc/deprecate-old-syntax-from-merge:
  git-merge: a deprecation notice of the ancient command line syntax

14 years agogit-merge: a deprecation notice of the ancient command line syntax
Junio C Hamano [Tue, 1 Dec 2009 00:23:50 +0000 (16:23 -0800)]
git-merge: a deprecation notice of the ancient command line syntax

The ancient form of git merge command used in the original sample script
has been copied from Linus and are still found everywhere, I think, and
people may still have it in their scripts, but on the other hand, it is so
unintuitive that even people reasonably familiar with git are surprised by
accidentally triggering the support to parse this ancient form.

Gently nudge people to upgrade their script to more recent and readable
style for eventual removal of the original syntax.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'bw/remote-get-ref-states-fix'
Junio C Hamano [Tue, 1 Dec 2009 20:26:45 +0000 (12:26 -0800)]
Merge branch 'bw/remote-get-ref-states-fix'

* bw/remote-get-ref-states-fix:
  get_ref_states: strdup entries and free util in stale list

14 years agoget_ref_states: strdup entries and free util in stale list
Bert Wesarg [Mon, 30 Nov 2009 23:57:27 +0000 (00:57 +0100)]
get_ref_states: strdup entries and free util in stale list

The entries in states->stale list is filled in handle_one_branch() that is
a call-back funcation to for_each_ref() using the callback parameter given
to it.  We need to strdup() the refnames (both the string list key and the
value stored in util) for more permanent storage and free them when we are
done.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agohelp: Do not unnecessarily look for a repository
David Aguilar [Tue, 1 Dec 2009 19:27:34 +0000 (11:27 -0800)]
help: Do not unnecessarily look for a repository

Although 'git help' actually doesn't need to be run inside a git
repository and uses no repository-specific information, it looks for a git
directory.  Searching for a git directory can be annoying in auto-mount
environments.  With this commit, 'git help' no longer searches for a
repository when run without any options.

7c3baa9 originally modified 'git help -a' to not require a repository.
This applies the same fix for 'git help'.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoDocumentation: Fix a few i.e./e.g. mix-ups
Michael J Gruber [Tue, 1 Dec 2009 09:19:05 +0000 (10:19 +0100)]
Documentation: Fix a few i.e./e.g. mix-ups

A git bundle can be transported by several means (such as e-mail), not
only by snekaernet, so use e.g. instead of i.e.

The mix-up in git-bundle.txt is obvious.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'jn/gitweb-blame'
Junio C Hamano [Tue, 1 Dec 2009 19:28:15 +0000 (11:28 -0800)]
Merge branch 'jn/gitweb-blame'

* jn/gitweb-blame:
  gitweb: Add link to other blame implementation in blame views
  gitweb: Make linking to actions requiring JavaScript a feature
  gitweb.js: fix padLeftStr() and its usage
  gitweb.js: Harden setting blamed commit info in incremental blame
  gitweb.js: fix null object exception in initials calculation
  gitweb: Minify gitweb.js if JSMIN is defined
  gitweb: Create links leading to 'blame_incremental' using JavaScript
  gitweb: Colorize 'blame_incremental' view during processing
  gitweb: Incremental blame (using JavaScript)
  gitweb: Add optional "time to generate page" info in footer

Conflicts:
Makefile
gitweb/gitweb.css

14 years agogitweb: Add link to other blame implementation in blame views
Jakub Narebski [Tue, 1 Dec 2009 16:54:26 +0000 (17:54 +0100)]
gitweb: Add link to other blame implementation in blame views

Add link to 'blame_incremental' action (which requires JavaScript) in
'blame' view, and add link to 'blame' action in 'blame_incremental'
view.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitweb: Make linking to actions requiring JavaScript a feature
Jakub Narebski [Thu, 26 Nov 2009 20:12:15 +0000 (21:12 +0100)]
gitweb: Make linking to actions requiring JavaScript a feature

Let gitweb turn some links (like 'blame' links) into linking to actions
which require JavaScript (like 'blame_incremental' action) only if
'javascript-actions' feature is enabled.

This means that links to such actions would be present only if both
JavaScript is enabled and 'javascript-actions' feature is enabled.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'fc/maint-format-patch-pathspec-dashes'
Junio C Hamano [Mon, 30 Nov 2009 22:46:09 +0000 (14:46 -0800)]
Merge branch 'fc/maint-format-patch-pathspec-dashes'

Conflicts:
t/t4014-format-patch.sh

14 years agoMerge branch 'mm/maint-merge-ff-error-message-fix'
Junio C Hamano [Mon, 30 Nov 2009 22:45:08 +0000 (14:45 -0800)]
Merge branch 'mm/maint-merge-ff-error-message-fix'

Conflicts:
merge-recursive.c

14 years agoMerge branch 'ap/maint-merge-strategy-list-fix'
Junio C Hamano [Mon, 30 Nov 2009 22:44:43 +0000 (14:44 -0800)]
Merge branch 'ap/maint-merge-strategy-list-fix'

14 years agoMerge branch 'jc/pretty-lf'
Junio C Hamano [Mon, 30 Nov 2009 22:44:22 +0000 (14:44 -0800)]
Merge branch 'jc/pretty-lf'

Conflicts:
pretty.c
t/t6006-rev-list-format.sh

14 years agoMerge branch 'cc/bisect-doc'
Junio C Hamano [Mon, 30 Nov 2009 22:43:51 +0000 (14:43 -0800)]
Merge branch 'cc/bisect-doc'

14 years agoMerge branch 'em/commit-claim'
Junio C Hamano [Mon, 30 Nov 2009 22:43:26 +0000 (14:43 -0800)]
Merge branch 'em/commit-claim'

14 years agoMerge branch 'jc/mailinfo-remove-brackets'
Junio C Hamano [Mon, 30 Nov 2009 22:43:24 +0000 (14:43 -0800)]
Merge branch 'jc/mailinfo-remove-brackets'

Conflicts:
Documentation/git-mailinfo.txt
builtin-mailinfo.c

14 years agoMerge branch 'fc/send-email-envelope'
Junio C Hamano [Mon, 30 Nov 2009 22:42:50 +0000 (14:42 -0800)]
Merge branch 'fc/send-email-envelope'

14 years agoMerge branch 'uk/maint-shortlog-encoding'
Junio C Hamano [Mon, 30 Nov 2009 22:42:28 +0000 (14:42 -0800)]
Merge branch 'uk/maint-shortlog-encoding'

Conflicts:
builtin-shortlog.c

14 years agoMerge branch 'ns/send-email-no-chain-reply-to'
Junio C Hamano [Mon, 30 Nov 2009 22:35:18 +0000 (14:35 -0800)]
Merge branch 'ns/send-email-no-chain-reply-to'

14 years agoMerge branch 'jc/maint-am-keep'
Junio C Hamano [Mon, 30 Nov 2009 22:35:07 +0000 (14:35 -0800)]
Merge branch 'jc/maint-am-keep'

14 years agoMerge branch 'bw/diff-color-hunk-header'
Junio C Hamano [Mon, 30 Nov 2009 22:34:45 +0000 (14:34 -0800)]
Merge branch 'bw/diff-color-hunk-header'

14 years agoDocumentation: Document --branch option in git clone synopsis
David Soria Parra [Mon, 30 Nov 2009 13:27:52 +0000 (14:27 +0100)]
Documentation: Document --branch option in git clone synopsis

Document the --branch option as [-b <name>] in git clones synopsis.

Signed-off-by: David Soria Parra <dsp@php.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobuiltin-merge: show user-friendly error messages for fast-forward too.
Matthieu Moy [Sun, 29 Nov 2009 12:18:33 +0000 (13:18 +0100)]
builtin-merge: show user-friendly error messages for fast-forward too.

fadd069d03 (merge-recursive: give less scary messages when merge did not
start, Sep 7 2009) introduced some friendlier error message for merge
failure, but the messages were shown only for non-fast forward merges.
This patch uses the same for fast-forward.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agomerge-recursive: make the error-message generation an extern function
Matthieu Moy [Sun, 29 Nov 2009 12:18:32 +0000 (13:18 +0100)]
merge-recursive: make the error-message generation an extern function

The construction of the struct unpack_trees_error_msgs was done within
git_merge_trees(), which prevented using the same messages easily from
another function.

[jc: backported for 1.6.5 maint before advice_commit_before_merge]

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot/README: Document GIT_TEST_INSTALLED and GIT_TEST_EXEC_PATH
Matthew Ogilvie [Mon, 30 Nov 2009 06:19:28 +0000 (23:19 -0700)]
t/README: Document GIT_TEST_INSTALLED and GIT_TEST_EXEC_PATH

These were added without documentation in 2009-03-16 (6720721).

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot3409 t4107 t7406 t9150: use dashless commands
Matthew Ogilvie [Sat, 28 Nov 2009 18:38:55 +0000 (11:38 -0700)]
t3409 t4107 t7406 t9150: use dashless commands

This is needed to allow test suite to run against a standard
install bin directory instead of GIT_EXEC_PATH.

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobuiltin-merge.c: call exclude_cmds() correctly.
Avery Pennarun [Thu, 26 Nov 2009 02:23:54 +0000 (21:23 -0500)]
builtin-merge.c: call exclude_cmds() correctly.

We need to call exclude_cmds() after the loop, not during the loop, because
excluding a command from the array can change the indexes of objects in the
array.  The result is that, depending on file ordering, some commands
weren't excluded as they should have been.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agot2300: use documented technique to invoke git-sh-setup
Matthew Ogilvie [Sat, 28 Nov 2009 18:38:54 +0000 (11:38 -0700)]
t2300: use documented technique to invoke git-sh-setup

This is needed to allow the test suite to run against a standard
install bin directory instead of GIT_EXEC_PATH.

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoprepare send-email for smoother change of --chain-reply-to default
Nanako Shiraishi [Sun, 29 Nov 2009 03:24:48 +0000 (12:24 +0900)]
prepare send-email for smoother change of --chain-reply-to default

Give a warning message when send-email uses chain-reply-to to thread the
messages because of the current default, not because the user explicitly
asked to, either from the command line or from the configuration.

This way, by the time 1.7.0 switches the default, everybody will be ready.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoUpdate draft release notes to 1.6.6 before merging topics for -rc1
Junio C Hamano [Sat, 28 Nov 2009 19:13:59 +0000 (11:13 -0800)]
Update draft release notes to 1.6.6 before merging topics for -rc1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMakefile: do not clean arm directory
Jonathan Nieder [Sat, 28 Nov 2009 11:41:28 +0000 (05:41 -0600)]
Makefile: do not clean arm directory

The ARM SHA-1 implementation was removed by commit 30ae47b
(remove ARM and Mozilla SHA1 implementations, 2009-08-17).  Prune
its directory from the list of object files to delete in 'make
clean'.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoGive the hunk comment its own color
Bert Wesarg [Fri, 27 Nov 2009 06:55:18 +0000 (07:55 +0100)]
Give the hunk comment its own color

Inspired by the coloring of quilt.

Introduce a separate color and paint the hunk comment part, i.e. the name
of the function, in a separate color "diff.func" (defaults to plain).

Whitespace between hunk header and hunk comment is printed in plain color.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agosend-email: automatic envelope sender
Felipe Contreras [Thu, 26 Nov 2009 19:04:29 +0000 (21:04 +0200)]
send-email: automatic envelope sender

This adds the option to specify the envelope sender as "auto" which
would pick the 'from' address. This is good because now we can specify
the address only in one place in $HOME/.gitconfig and change it easily.

[jc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoemit_line(): don't emit an empty <SET><RESET> followed by a newline
Junio C Hamano [Sat, 28 Nov 2009 06:04:10 +0000 (22:04 -0800)]
emit_line(): don't emit an empty <SET><RESET> followed by a newline

When emit_line() is called with an empty line (but non-zero length, as we
send line terminating LF or CRLF to the function), it used to emit
<SET><RESET> followed by a newline.  Stop the wastefulness.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoRemove dead code from "git am"
Junio C Hamano [Fri, 27 Nov 2009 23:06:37 +0000 (15:06 -0800)]
Remove dead code from "git am"

Ever since the initial implementation, "git am" had kept a dead code that
never triggered due to a typo in the variable name.  Worse yet, the code,
if it weren't for the typo, would have attempted to add "[PATCH] " at the
beginning of the Subject: header when "git am" is run with its "-k"
option.  However, because "git am -k" tells mailinfo to keep such prefix
when parsing the input, the "[PATCH] " added by this dead code would have
really been unnecessary duplicate.

Embarrassing is that we kept _maintaining_ the codepath without anybody
noticing for four years.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoMerge branch 'maint'
Junio C Hamano [Fri, 27 Nov 2009 08:56:05 +0000 (00:56 -0800)]
Merge branch 'maint'

* maint:
  builtin-apply.c: pay attention to -p<n> when determining the name

14 years agoAdd a notice that only certain functions can print color escape codes
Johannes Sixt [Fri, 27 Nov 2009 07:42:25 +0000 (08:42 +0100)]
Add a notice that only certain functions can print color escape codes

We emulate color escape codes on Windows by overriding printf, fprintf,
and fputs. Warn developers that these are the only functions that can be
used to print them.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoformat-patch: add test for parsing of "--"
Felipe Contreras [Thu, 26 Nov 2009 19:12:00 +0000 (21:12 +0200)]
format-patch: add test for parsing of "--"

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agoformat-patch: fix parsing of "--" on the command line
Felipe Contreras [Thu, 26 Nov 2009 19:11:59 +0000 (21:11 +0200)]
format-patch: fix parsing of "--" on the command line

When given a pathspec that does not match any path in the current work
tree with an explicit "--":

    git format-patch <commit> -- <path>

the command still complains that <path> does not exist in the current work
tree and the user needs to explicitly specify "--" and errors out.  This
is because it incorrectly removes "--" from the command line arguments
that is later passed to setup_revisions().

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agobuiltin-apply.c: pay attention to -p<n> when determining the name
Junio C Hamano [Wed, 25 Nov 2009 10:56:54 +0000 (02:56 -0800)]
builtin-apply.c: pay attention to -p<n> when determining the name

The patch structure has def_name component that is used to validate the
sanity of a "diff --git" patch by checking pathnames that appear on the
patch header lines for consistency.  The git_header_name() function is
used to compute this out of "diff --git a/... b/..." line, but the code
always stripped one level of prefix (i.e. "a/" and "b/"), without paying
attention to -p<n> option.  Code in find_name() function that parses other
lines in the patch header (e.g. "--- a/..." and "+++ b/..." lines) however
did strip the correct number of leading paths prefixes, and the sanity
check between these computed values failed.

Teach git_header_name() to honor -p<n> option like find_name() function
does.

Found and reported by Steven J. Murdoch who also wrote tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
14 years agogitworkflows: Consistently back-quote git commands
Björn Gustavsson [Thu, 26 Nov 2009 21:49:50 +0000 (22:49 +0100)]
gitworkflows: Consistently back-quote git commands

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoshortlog: respect commit encoding
Uwe Kleine-König [Wed, 25 Nov 2009 19:33:28 +0000 (20:33 +0100)]
shortlog: respect commit encoding

Don't take the author name information without re-encoding from the raw
commit object buffer.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Jiri Kosina <jkosina@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'rs/work-around-grep-opt-insanity'
Junio C Hamano [Wed, 25 Nov 2009 19:45:07 +0000 (11:45 -0800)]
Merge branch 'rs/work-around-grep-opt-insanity'

* rs/work-around-grep-opt-insanity:
  Protect scripted Porcelains from GREP_OPTIONS insanity
  mergetool--lib: simplify guess_merge_tool()

Conflicts:
git-instaweb.sh

15 years agoExplicitly truncate bswap operand to uint32_t
Benjamin Kramer [Wed, 18 Nov 2009 13:53:27 +0000 (14:53 +0100)]
Explicitly truncate bswap operand to uint32_t

There are some places in git where a long is passed to htonl/ntohl. llvm
doesn't support matching operands of different bitwidths intentionally.
This patch fixes the build with llvm-gcc (and clang) on x86_64.

Signed-off-by: Benjamin Kramer <benny.kra@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb.js: fix padLeftStr() and its usage
Stephen Boyd [Wed, 25 Nov 2009 03:51:40 +0000 (19:51 -0800)]
gitweb.js: fix padLeftStr() and its usage

It seems that in Firefox-3.5 inserting &nbsp; with javascript inserts the
literal &nbsp; instead of a space. Fix this by inserting the unicode
representation for &nbsp; instead.

Also fix the off-by-one error in the padding calculation that was
causing one less space to be inserted than was requested by the caller.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Cc: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agogitweb.js: Harden setting blamed commit info in incremental blame
Jakub Narebski [Wed, 25 Nov 2009 00:45:15 +0000 (01:45 +0100)]
gitweb.js: Harden setting blamed commit info in incremental blame

Internet Explorer 8 stops at beginning of blame filling with the
following bug:

  "firstChild is null or not an object"

at this line:

  a_sha1.firstChild.data = commit.sha1.substr(0, 8);

It is (probably) caused by the fact that while a_sha1 element, which
looks like this:

  <a href=""> </a>

It has a firstChild which is a text node containing only whitespace
(single space character) in other web browsers (Firefox 3.5, Opera 10,
Google Chrome 3.0), IE8 clobbers DOM, removing trailing/leading
whitespace.

Protect against this bug by creating text element if it does not
exist.

Found-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot1200: fix a timing dependent error
Nanako Shiraishi [Tue, 24 Nov 2009 23:08:08 +0000 (08:08 +0900)]
t1200: fix a timing dependent error

The fourth test of show-branch in t1200 test was failing but only
sometimes. It only failed when two commits created in an earlier
test had different timestamps. When they were created within the
same second, the actual output matched the expected output.

Fix this by using test_tick to force reliable timestamps and update
the expected output so it does not to depend on the commits made in
the same sacond.

Signed-off-by: Nanako Shiraishi <nanako3@lavabit.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'rj/maint-cygwin-count-objects'
Junio C Hamano [Tue, 24 Nov 2009 23:42:55 +0000 (15:42 -0800)]
Merge branch 'rj/maint-cygwin-count-objects'

* rj/maint-cygwin-count-objects:
  git-count-objects: Fix a disk-space under-estimate on Cygwin

15 years agoDocumentation: update descriptions of revision options related to '--bisect'
Christian Couder [Tue, 24 Nov 2009 06:54:44 +0000 (07:54 +0100)]
Documentation: update descriptions of revision options related to '--bisect'

In commit ad3f9a7 (Add '--bisect' revision machinery argument) the
'--bisect' option was added to easily pass bisection refs to commands
using the revision machinery.

This patch updates the documentation of the related options to describe
the new behavior.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoEnable support for IPv6 on MinGW
Martin Storsjö [Mon, 23 Nov 2009 22:55:50 +0000 (00:55 +0200)]
Enable support for IPv6 on MinGW

The IPv6 support functions are loaded dynamically, to maintain backwards
compatibility with versions of Windows prior to XP, and fallback wrappers
are provided, implemented in terms of gethostbyname and gethostbyaddr.

Signed-off-by: Martin Storsjo <martin@martin.st>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoRefactor winsock initialization into a separate function
Martin Storsjö [Mon, 23 Nov 2009 22:55:12 +0000 (00:55 +0200)]
Refactor winsock initialization into a separate function

The winsock library must be initialized. Since gethostbyname() is the
first function that calls into winsock, it was overridden to do the
initialization. This refactoring helps the next patch, where other
functions can be called earlier.

Signed-off-by: Martin Storsjo <martin@martin.st>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'rs/color-escape-has-zero-width'
Junio C Hamano [Tue, 24 Nov 2009 06:33:30 +0000 (22:33 -0800)]
Merge branch 'rs/color-escape-has-zero-width'

* rs/color-escape-has-zero-width:
  strbuf_add_wrapped_text(): skip over colour codes

15 years agoMerge branch 'bg/apply-doc'
Junio C Hamano [Tue, 24 Nov 2009 06:32:39 +0000 (22:32 -0800)]
Merge branch 'bg/apply-doc'

* bg/apply-doc:
  Fix over-simplified documentation for 'git log -z'
  apply: Use the term "working tree" consistently
  apply: Format all options using back-quotes
  apply: apply works outside a repository
  Clarify and correct -z

15 years agoMerge branch 'mm/maint-hint-failed-merge'
Junio C Hamano [Tue, 24 Nov 2009 06:31:51 +0000 (22:31 -0800)]
Merge branch 'mm/maint-hint-failed-merge'

* mm/maint-hint-failed-merge:
  user-manual: Document that "git merge" doesn't like uncommited changes.
  merge-recursive: point the user to commit when file would be overwritten.

15 years agoMerge branch 'jc/log-stdin'
Junio C Hamano [Tue, 24 Nov 2009 06:30:08 +0000 (22:30 -0800)]
Merge branch 'jc/log-stdin'

* jc/log-stdin:
  Add trivial tests for --stdin option to log family
  Make --stdin option to "log" family read also pathspecs
  setup_revisions(): do not call get_pathspec() too early
  Teach --stdin option to "log" family
  read_revision_from_stdin(): use strbuf

Conflicts:
revision.c

15 years agoMerge branch 'mr/gitweb-snapshot'
Junio C Hamano [Tue, 24 Nov 2009 06:28:31 +0000 (22:28 -0800)]
Merge branch 'mr/gitweb-snapshot'

* mr/gitweb-snapshot:
  t/gitweb-lib: Split HTTP response with non-GNU sed
  gitweb: Smarter snapshot names
  gitweb: Document current snapshot rules via new tests
  t/gitweb-lib.sh: Split gitweb output into headers and body
  gitweb: check given hash before trying to create snapshot

15 years agot/gitweb-lib: Split HTTP response with non-GNU sed
Brian Gernhardt [Mon, 23 Nov 2009 17:33:42 +0000 (12:33 -0500)]
t/gitweb-lib: Split HTTP response with non-GNU sed

Recognizing \r in a regex is something GNU sed will do, but other sed
implementation's won't (e.g. BSD sed on OS X).  Instead of two sed
invocations, use a single Perl script to split output into headers
and body.

Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'cc/replace'
Junio C Hamano [Tue, 24 Nov 2009 06:24:01 +0000 (22:24 -0800)]
Merge branch 'cc/replace'

* cc/replace:
  Documentation: talk a little bit about GIT_NO_REPLACE_OBJECTS
  Documentation: fix typos and spelling in replace documentation
  replace: use a GIT_NO_REPLACE_OBJECTS env variable

15 years agoMerge branch 'maint'
Junio C Hamano [Tue, 24 Nov 2009 05:54:39 +0000 (21:54 -0800)]
Merge branch 'maint'

* maint:
  pack-objects: split implications of --all-progress from progress activation
  instaweb: restart server if already running
  prune-packed: only show progress when stderr is a tty

Conflicts:
builtin-pack-objects.c

15 years agopack-objects: split implications of --all-progress from progress activation
Nicolas Pitre [Mon, 23 Nov 2009 17:43:50 +0000 (12:43 -0500)]
pack-objects: split implications of --all-progress from progress activation

Currently the --all-progress flag is used to use force progress display
during the writing object phase even if output goes to stdout which is
primarily the case during a push operation.  This has the unfortunate
side effect of forcing progress display even if stderr is not a
terminal.

Let's introduce the --all-progress-implied argument which has the same
intent except for actually forcing the activation of any progress
display.  With this, progress display will be automatically inhibited
whenever stderr is not a terminal, or full progress display will be
included otherwise.  This should let people use 'git push' within a cron
job without filling their logs with useless percentage displays.

Signed-off-by: Nicolas Pitre <nico@fluxnic.net>
Tested-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoinstaweb: restart server if already running
Stephen Boyd [Mon, 23 Nov 2009 07:09:12 +0000 (23:09 -0800)]
instaweb: restart server if already running

Running 'git instaweb' when an instaweb server is already running will
fail (at least when the port is the same) and overwrite the pid file
used to track the currently running server. This turns out to be
especially annoying when the user tries to stop the previously running
server with 'git instaweb --stop' and is instead greeted with an error
message because the pid file has been destroyed.

Instead of allowing a user to start two instaweb servers, stop the
currently running server first and then start the new one. This should
be fine because it was never really possible to start two instaweb
servers in the first place due to the pid file issue outlined above.

Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoprune-packed: only show progress when stderr is a tty
Jeff King [Tue, 24 Nov 2009 03:07:42 +0000 (22:07 -0500)]
prune-packed: only show progress when stderr is a tty

This matches the behavior of other git programs, and helps
keep cruft out of things like cron job output.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoremote-curl.c: fix rpc_out()
Tay Ray Chuan [Tue, 24 Nov 2009 02:31:30 +0000 (10:31 +0800)]
remote-curl.c: fix rpc_out()

Remove the extraneous semicolon (';') at the end of the if statement
that allowed the code in its block to execute regardless of the
condition.

This fixes pushing to a smart http backend with chunked encoding.

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoProtect scripted Porcelains from GREP_OPTIONS insanity
Junio C Hamano [Mon, 23 Nov 2009 23:56:32 +0000 (15:56 -0800)]
Protect scripted Porcelains from GREP_OPTIONS insanity

If the user has exported the GREP_OPTIONS environment variable, the output
from "grep" and "egrep" in scripted Porcelains may be different from what
they expect.  For example, we may want to count number of matching lines,
by "grep" piped to "wc -l", and GREP_OPTIONS=-C3 will break such use.

The approach taken by this change to address this issue is to protect only
our own use of grep/egrep.  Because we do not unset it at the beginning of
our scripts, hook scripts run from the scripted Porcelains are exposed to
the same insanity this environment variable causes when grep/egrep is used
to implement logic (e.g. "grep | wc -l"), and it is entirely up to the
hook scripts to protect themselves.

On the other hand, applypatch-msg hook may want to show offending words in
the proposed commit log message using grep to the end user, and the user
might want to set GREP_OPTIONS=--color to paint the match more visibly.
The approach to protect only our own use without unsetting the environment
variable globally will allow this use case.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agomergetool--lib: simplify guess_merge_tool()
René Scharfe [Mon, 23 Nov 2009 23:29:17 +0000 (00:29 +0100)]
mergetool--lib: simplify guess_merge_tool()

Use a case statement instead of calling grep to find out if the editor's
name contains the string "vim".  Remove the check for emacs, as this
branch did the same as the default one anyway.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agostrbuf_add_wrapped_text(): skip over colour codes
René Scharfe [Mon, 23 Nov 2009 22:40:03 +0000 (23:40 +0100)]
strbuf_add_wrapped_text(): skip over colour codes

Ignore display mode escape sequences (colour codes) for the purpose of
text wrapping because they don't have a visible width.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agot4014-format-patch: do not assume 'test' is available as non-builtin
Johannes Sixt [Mon, 23 Nov 2009 09:35:53 +0000 (10:35 +0100)]
t4014-format-patch: do not assume 'test' is available as non-builtin

One test case used 'xargs test', which assumes that 'test' is available
as external program. At least on MinGW it is not.

Moreover, 'git format-patch' was invoked in a pipeline, but not as the
last command. Rewrite the test case to catch breakage in 'git format-patch'
as well.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoFix over-simplified documentation for 'git log -z'
Björn Gustavsson [Mon, 23 Nov 2009 07:40:24 +0000 (08:40 +0100)]
Fix over-simplified documentation for 'git log -z'

In commit 64485b4a, the documentation for 'git log -z' was
simplified too much. The -z option actually changes the behavior
of 'git log' in two ways: commits will be ended with a NUL
instead of a LF (correctly documented) and the --raw and
--numstat will have NUL as field terminators (omitted in
the documentation for 'git log').

Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoAdd trivial tests for --stdin option to log family
Junio C Hamano [Mon, 23 Nov 2009 08:49:47 +0000 (00:49 -0800)]
Add trivial tests for --stdin option to log family

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'bg/fetch-multi'
Junio C Hamano [Mon, 23 Nov 2009 08:03:15 +0000 (00:03 -0800)]
Merge branch 'bg/fetch-multi'

* bg/fetch-multi:
  Re-implement 'git remote update' using 'git fetch'
  builtin-fetch: add --dry-run option
  builtin-fetch: add --prune option
  teach warn_dangling_symref to take a FILE argument
  remote: refactor some logic into get_stale_heads()
  Add missing test for 'git remote update --prune'
  Add the configuration option skipFetchAll
  Teach the --multiple option to 'git fetch'
  Teach the --all option to 'git fetch'

15 years agobisect: simplify calling visualizer using '--bisect' option
Christian Couder [Mon, 23 Nov 2009 04:16:14 +0000 (05:16 +0100)]
bisect: simplify calling visualizer using '--bisect' option

In commit ad3f9a7 (Add '--bisect' revision machinery argument) the
'--bisect' option was added to easily pass bisection refs to
commands using the revision machinery.

So it is now shorter and safer to use the new '--bisect' revision
machinery option, than to compute the refs that we must pass.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoDisable CURLOPT_NOBODY before enabling CURLOPT_PUT and CURLOPT_POST
Martin Storsjö [Mon, 23 Nov 2009 03:03:28 +0000 (11:03 +0800)]
Disable CURLOPT_NOBODY before enabling CURLOPT_PUT and CURLOPT_POST

This works around a bug in curl versions up to 7.19.4, where disabling the
CURLOPT_NOBODY option sets the internal state incorrectly considering that
CURLOPT_PUT was enabled earlier.

The bug is discussed at http://curl.haxx.se/bug/view.cgi?id=2727981 and is
corrected in the latest version of curl in CVS.

This bug usually has no impact on git, but may surface if using multi-pass
authentication methods.

Signed-off-by: Martin Storsjo <martin@martin.st>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoconfig documentation: some configs are auto-set by git-init
Matthew Ogilvie [Mon, 23 Nov 2009 02:07:30 +0000 (19:07 -0700)]
config documentation: some configs are auto-set by git-init

Add documentation for core.ignorecase, and mention git-init
in core.filemode and core.symlinks.

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agocvsserver doc: database generally can not be reproduced consistently
Matthew Ogilvie [Mon, 23 Nov 2009 02:07:29 +0000 (19:07 -0700)]
cvsserver doc: database generally can not be reproduced consistently

A regenerated git-cvsserver database is at risk of having different
CVS revision numbers from an incrementally updated database.  Mention
this in the the documentation, and remove an erroneous statement
to the contrary.

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoGit v1.6.6-rc0 v1.6.6-rc0
Junio C Hamano [Mon, 23 Nov 2009 03:16:01 +0000 (19:16 -0800)]
Git v1.6.6-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
15 years agoMerge branch 'maint'
Junio C Hamano [Mon, 23 Nov 2009 03:04:30 +0000 (19:04 -0800)]
Merge branch 'maint'

* maint:
  Documentation: undocument gc'd function graph_release()

15 years agoMerge git://git.bogomips.org/git-svn
Junio C Hamano [Mon, 23 Nov 2009 03:01:15 +0000 (19:01 -0800)]
Merge git://git.bogomips.org/git-svn

* git://git.bogomips.org/git-svn:
  git svn: strip leading path when making empty dirs
  git svn: always reuse existing remotes on fetch

15 years agogit svn: strip leading path when making empty dirs
Eric Wong [Mon, 23 Nov 2009 02:11:32 +0000 (18:11 -0800)]
git svn: strip leading path when making empty dirs

Since unhandled.log stores paths relative to the repository
root, we need to strip out leading path components if the
directories we're tracking are not the repository root.

Reported-by: Björn Steinbrink
Signed-off-by: Eric Wong <normalperson@yhbt.net>
15 years agoMerge branch 'th/maint-remote-update-help-string'
Junio C Hamano [Mon, 23 Nov 2009 00:41:54 +0000 (16:41 -0800)]
Merge branch 'th/maint-remote-update-help-string'

* th/maint-remote-update-help-string:
  Update 'git remote update' usage string to match man page.

15 years agoMerge branch 'jn/faster-completion-startup'
Junio C Hamano [Mon, 23 Nov 2009 00:41:43 +0000 (16:41 -0800)]
Merge branch 'jn/faster-completion-startup'

* jn/faster-completion-startup:
  Speed up bash completion loading

15 years agoMerge branch 'rj/maint-t9700'
Junio C Hamano [Mon, 23 Nov 2009 00:40:52 +0000 (16:40 -0800)]
Merge branch 'rj/maint-t9700'

* rj/maint-t9700:
  t9700-perl-git.sh: Fix a test failure on Cygwin

15 years agoMerge branch 'ls/maint-mailinfo-no-inbody'
Junio C Hamano [Mon, 23 Nov 2009 00:40:26 +0000 (16:40 -0800)]
Merge branch 'ls/maint-mailinfo-no-inbody'

* ls/maint-mailinfo-no-inbody:
  git am/mailinfo: Don't look at in-body headers when rebasing

15 years agoMerge branch 'mo/maint-crlf-doc'
Junio C Hamano [Mon, 23 Nov 2009 00:29:57 +0000 (16:29 -0800)]
Merge branch 'mo/maint-crlf-doc'

* mo/maint-crlf-doc:
  core.autocrlf documentation: mention the crlf attribute