gitweb.git
Technical documentation of the run-command API.Johannes Sixt Mon, 18 Feb 2008 19:23:03 +0000 (20:23 +0100)

Technical documentation of the run-command API.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Correct git-pull documentationJay Soffian Tue, 19 Feb 2008 19:24:32 +0000 (14:24 -0500)

Correct git-pull documentation

The --rebase option was documented in the wrong place (under MERGE
STRATEGIES instead of OPTIONS). Noted the branch.<name>.rebase
option.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Fix bug in href(..., -replay=>1) when using... Jakub Narebski Thu, 14 Feb 2008 08:22:30 +0000 (09:22 +0100)

gitweb: Fix bug in href(..., -replay=>1) when using 'pathinfo' form

URLs generated by href(..., -replay=>1) (which includes 'next page'
links and alternate view links) didn't set project info correctly
when current page URL is in pathinfo form.

This resulted in broken links such like:

http://www.example.com/w/ARRAY(0x85a5318)?a=shortlog;pg=1

if the 'pathinfo' feature was used, or

http://www.example.com/w/?a=shortlog;pg=1

if it wasn't, instead of correct:

http://www.example.com/w/project.git?a=shortlog;pg=1

This was caused by the fact that href() always replays params in the
arrayref form, were they multivalued or singlevalued, and the code
dealing with 'pathinfo' feature couldn't deal with $params{'project'}
being arrayref.

Setting $params{'project'} is moved before replaying params; this
ensures that 'project' parameter is processed correctly.

Noticed-by: Peter Oberndorfer <kumbayo84@arcor.de>
Noticed-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: documentation update for the branch track changesJay Soffian Tue, 19 Feb 2008 16:24:38 +0000 (11:24 -0500)

doc: documentation update for the branch track changes

Documents the branch.autosetupmerge=always setting and usage of --track
when branching from a local branch.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch: optionally setup branch.*.merge from upstream... Jay Soffian Tue, 19 Feb 2008 16:24:37 +0000 (11:24 -0500)

branch: optionally setup branch.*.merge from upstream local branches

"git branch" and "git checkout -b" now honor --track option even when
the upstream branch is local. Previously --track was silently ignored
when forking from a local branch. Also the command did not error out
when --track was explicitly asked for but the forked point specified
was not an existing branch (i.e. when there is no way to set up the
tracking configuration), but now it correctly does.

The configuration setting branch.autosetupmerge can now be set to
"always", which is equivalent to using --track from the command line.
Setting branch.autosetupmerge to "true" will retain the former behavior
of only setting up branch.*.merge for remote upstream branches.

Includes test cases for the new functionality.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

push: document the status outputJeff King Tue, 19 Feb 2008 16:26:45 +0000 (11:26 -0500)

push: document the status output

The output was meant to be a balance of self-explanatory and
terse. In case we have erred too far on the terse side, it
doesn't hurt to explain in more detail what each line means.

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

Documentation/push: clarify matching refspec behaviorJeff King Tue, 19 Feb 2008 16:25:22 +0000 (11:25 -0500)

Documentation/push: clarify matching refspec behavior

The previous text was correct, but it was easy to miss the
fact that we are talking about "matching" refs. That is, the
text can be parsed as "we push the union of the sets
of remote and local heads" and not "we push the intersection
of the sets of remote and local heads". (The former actually
doesn't make sense if you think about it, since we don't
even _have_ some of those heads). A careful reading would
reveal the correct meaning, but it makes sense to be as
explicit as possible in documentation.

We also explicitly use and introduce the term "matching";
this is a term discussed on the list, and it seems useful
to for users to be able to refer to this behavior by name.

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

push: indicate partialness of error messageJeff King Tue, 19 Feb 2008 16:25:01 +0000 (11:25 -0500)

push: indicate partialness of error message

The existing message indicates that an error occured during
push, but it is unclear whether _any_ refs were actually
pushed (even though the status table above shows which were
pushed successfully and which were not, the message "failed
to push" implies a total failure). By indicating that "some
refs" failed, we hopefully indicate to the user that the
table above contains the details.

We could also put in an explicit "see above for details"
message, but it seemed to clutter the output quite a bit
(both on a line of its own, or at the end of the error line,
which inevitably wraps).

This could also be made more fancy if the transport
mechanism passed back more details on how many refs
succeeded and failed:

error: failed to push %d out of %d refs to '%s'

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

git-gui: relax "dirty" version detectionWincent Colaiuta Mon, 18 Feb 2008 08:36:33 +0000 (09:36 +0100)

git-gui: relax "dirty" version detection

"git gui" would complain at launch if the local version of Git was
"1.5.4.2.dirty". Loosen the regular expression to look for either
"-dirty" or ".dirty", thus eliminating spurious warnings.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Use ALLOC_GROW in remote.{c,h}Daniel Barkalow Tue, 19 Feb 2008 04:41:41 +0000 (23:41 -0500)

Use ALLOC_GROW in remote.{c,h}

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Export some email and pretty-printing functionsDaniel Barkalow Tue, 19 Feb 2008 03:56:08 +0000 (22:56 -0500)

Export some email and pretty-printing functions

These will be used for generating the cover letter in addition to the
patch emails.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Improve message-id generation flow control for format... Daniel Barkalow Tue, 19 Feb 2008 03:56:06 +0000 (22:56 -0500)

Improve message-id generation flow control for format-patch

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add more tests for format-patchDaniel Barkalow Tue, 19 Feb 2008 03:56:02 +0000 (22:56 -0500)

Add more tests for format-patch

Tests -o, and an excessively long subject, and --thread, with and
without --in-reply-to=

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

API documentation for remote.hDaniel Barkalow Tue, 19 Feb 2008 07:52:11 +0000 (02:52 -0500)

API documentation for remote.h

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Clean up reporting differences on branch switchDaniel Barkalow Tue, 19 Feb 2008 07:52:14 +0000 (02:52 -0500)

Clean up reporting differences on branch switch

This also changes it such that:

$ git checkout

will give the same information without changing branches. This is good
for finding out if the fetch you did recently had anything to say
about the branch you've been on, whose name you don't remember at the
moment.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Simplify setup of $GIT_DIR in git-sh-setup.shLars Hjemli Mon, 18 Feb 2008 10:44:19 +0000 (11:44 +0100)

Simplify setup of $GIT_DIR in git-sh-setup.sh

Using 'git rev-parse --git-dir' makes the code shorter and more future-
proof.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'mk/maint-parse-careful'Junio C Hamano Tue, 19 Feb 2008 04:56:01 +0000 (20:56 -0800)

Merge branch 'mk/maint-parse-careful'

* mk/maint-parse-careful:
peel_onion: handle NULL
check return value from parse_commit() in various functions
parse_commit: don't fail, if object is NULL
revision.c: handle tag->tagged == NULL
reachable.c::process_tree/blob: check for NULL
process_tag: handle tag->tagged == NULL
check results of parse_commit in merge_bases
list-objects.c::process_tree/blob: check for NULL
reachable.c::add_one_tree: handle NULL from lookup_tree
mark_blob/tree_uninteresting: check for NULL
get_sha1_oneline: check return value of parse_object
read_object_with_reference: don't read beyond the buffer

peel_onion: handle NULLMartin Koegler Mon, 18 Feb 2008 20:47:58 +0000 (21:47 +0100)

peel_onion: handle NULL

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

check return value from parse_commit() in various functionsMartin Koegler Mon, 18 Feb 2008 20:48:03 +0000 (21:48 +0100)

check return value from parse_commit() in various functions

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

parse_commit: don't fail, if object is NULLMartin Koegler Mon, 18 Feb 2008 20:48:02 +0000 (21:48 +0100)

parse_commit: don't fail, if object is NULL

Some codepaths (eg. builtin-rev-parse -> get_merge_bases -> parse_commit)
can pass NULL.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

revision.c: handle tag->tagged == NULLMartin Koegler Mon, 18 Feb 2008 20:48:01 +0000 (21:48 +0100)

revision.c: handle tag->tagged == NULL

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reachable.c::process_tree/blob: check for NULLMartin Koegler Mon, 18 Feb 2008 20:48:00 +0000 (21:48 +0100)

reachable.c::process_tree/blob: check for NULL

As these functions are directly called with the result
from lookup_tree/blob, they must handle NULL.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

process_tag: handle tag->tagged == NULLMartin Koegler Mon, 18 Feb 2008 20:47:59 +0000 (21:47 +0100)

process_tag: handle tag->tagged == NULL

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

check results of parse_commit in merge_basesMartin Koegler Mon, 18 Feb 2008 20:47:57 +0000 (21:47 +0100)

check results of parse_commit in merge_bases

An error is signaled by returning NULL.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

list-objects.c::process_tree/blob: check for NULLMartin Koegler Mon, 18 Feb 2008 20:47:56 +0000 (21:47 +0100)

list-objects.c::process_tree/blob: check for NULL

As these functions are directly called with the result
from lookup_tree/blob, they must handle NULL.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reachable.c::add_one_tree: handle NULL from lookup_treeMartin Koegler Mon, 18 Feb 2008 20:47:55 +0000 (21:47 +0100)

reachable.c::add_one_tree: handle NULL from lookup_tree

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mark_blob/tree_uninteresting: check for NULLMartin Koegler Mon, 18 Feb 2008 20:47:54 +0000 (21:47 +0100)

mark_blob/tree_uninteresting: check for NULL

As these functions are directly called with the result
from lookup_tree/blob, they must handle NULL.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

get_sha1_oneline: check return value of parse_objectMartin Koegler Mon, 18 Feb 2008 20:47:53 +0000 (21:47 +0100)

get_sha1_oneline: check return value of parse_object

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_object_with_reference: don't read beyond the bufferMartin Koegler Mon, 18 Feb 2008 20:47:52 +0000 (21:47 +0100)

read_object_with_reference: don't read beyond the buffer

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin-checkout.c: fix possible usage segfaultJay Soffian Mon, 18 Feb 2008 10:20:20 +0000 (05:20 -0500)

builtin-checkout.c: fix possible usage segfault

Not terminating the options[] array with OPT_END can cause
usage ("git checkout -h") output to segfault.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

expose a helper function peel_to_type().Junio C Hamano Mon, 24 Dec 2007 08:51:01 +0000 (00:51 -0800)

expose a helper function peel_to_type().

This helper function is the core of "$object^{type}" parser.
Now it is made available to callers outside sha1_name.c

merge-recursive: split low-level merge functions out.Junio C Hamano Mon, 24 Dec 2007 08:36:00 +0000 (00:36 -0800)

merge-recursive: split low-level merge functions out.

This moves low-level merge functions out of merge-recursive.c and
places them in a new separate file, ll-merge.c

Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdl_merge(): introduce XDL_MERGE_ZEALOUS_ALNUMJohannes Schindelin Sun, 17 Feb 2008 19:07:40 +0000 (19:07 +0000)

xdl_merge(): introduce XDL_MERGE_ZEALOUS_ALNUM

When a merge conflicts, there are often common lines that are not really
common, such as empty lines or lines containing a single curly bracket.

With XDL_MERGE_ZEALOUS_ALNUM, we use the following heuristics: when a
hunk does not contain any letters or digits, it is treated as conflicting.

In other words, a conflict which used to look like this:

<<<<<<<
a = 1;
=======
output();
>>>>>>>
}
}
}

<<<<<<<
output();
=======
b = 1;
>>>>>>>

will look like this with ZEALOUS_ALNUM:

<<<<<<<
a = 1;
}
}
}

output();
=======
output();
}
}
}

b = 1;
>>>>>>>

To demonstrate this, git-merge-file has been switched from
XDL_MERGE_ZEALOUS to XDL_MERGE_ZEALOUS_ALNUM.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdl_merge(): make XDL_MERGE_ZEALOUS output simplerJohannes Schindelin Sun, 17 Feb 2008 19:07:19 +0000 (19:07 +0000)

xdl_merge(): make XDL_MERGE_ZEALOUS output simpler

When a merge conflicts, there are often less than three common lines
between two conflicting regions.

Since a conflict takes up as many lines as are conflicting, plus three
lines for the commit markers, the output will be shorter (and thus,
simpler) in this case, if the common lines will be merged into the
conflicting regions.

This patch merges up to three common lines into the conflicts.

For example, what looked like this before this patch:

<<<<<<<
if (a == 1)
=======
if (a != 0)
>>>>>>>
{
int i;
<<<<<<<
a = 0;
=======
a = !a;
>>>>>>>

will now look like this:

<<<<<<<
if (a == 1)
{
int i;
a = 0;
=======
if (a != 0)
{
int i;
a = !a;
>>>>>>>

Suggested Linus (based on ideas by "Voltage Spike" -- if that name is
real, it is mighty cool).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add color.ui variable which globally enables colorizati... Matthias Kestenholz Mon, 18 Feb 2008 07:26:03 +0000 (08:26 +0100)

Add color.ui variable which globally enables colorization if set

Signed-off-by: Matthias Kestenholz <mk@spinlock.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

check return code of prepare_revision_walkMartin Koegler Mon, 18 Feb 2008 07:31:56 +0000 (08:31 +0100)

check return code of prepare_revision_walk

A failure in prepare_revision_walk can be caused by
a not parseable object.

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

deref_tag: handle tag->tagged = NULLMartin Koegler Mon, 18 Feb 2008 07:31:55 +0000 (08:31 +0100)

deref_tag: handle tag->tagged = NULL

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

deref_tag: handle return value NULLMartin Koegler Mon, 18 Feb 2008 07:31:54 +0000 (08:31 +0100)

deref_tag: handle return value NULL

Signed-off-by: Martin Koegler <mkoegler@auto.tuwien.ac.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

help.c: use 'git_config_string' to get 'help_default_fo... Christian Couder Sun, 17 Feb 2008 19:52:50 +0000 (20:52 +0100)

help.c: use 'git_config_string' to get 'help_default_format'.

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

Merge branch 'br/gitweb'Junio C Hamano Mon, 18 Feb 2008 03:31:18 +0000 (19:31 -0800)

Merge branch 'br/gitweb'

* br/gitweb:
gitweb: Use the config file to set repository owner's name.

gitweb: Add new option -nohtml to quot_xxx subroutinesJakub Narebski Sun, 17 Feb 2008 17:48:13 +0000 (18:48 +0100)

gitweb: Add new option -nohtml to quot_xxx subroutines

Add support for new option -nohtml to quot_cec and quot_upr
subroutines, to have output not wrapped in HTML tags. This makes
those subroutines suitable to quoting attributes values, and for plain
text output quoting. Currently this API is not used yet.

While at it fix whitespace, and use ';' as delimiter, not separator.

The option to not wrap quot_cec output in HTML tag were proposed
originally in patch:
"Don't open a XML tag while another one is already open"
Message-ID: <20080216191628.GK30676@schiele.dyndns.org>
by Robert Schiele. Originally the parameter was named '-notag', was
also supportted by esc_html (but not esc_path) which passed it down to
quot_cec. Mentioned patch was meant to fix the bug Martin Koegler
reported in his mail
"Invalid html output repo.or.cz (alt-git.git)"
Message-ID: <20080216130037.GA14571@auto.tuwien.ac.at>
which was fixed in different way (do not use esc_html to escape and
quote HTML attributes).

Signed-off-by: Robert Schiele <rschiele@gmail.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Fix displaying unchopped argument in chop_and_e... Jakub Narebski Sat, 16 Feb 2008 22:07:46 +0000 (23:07 +0100)

gitweb: Fix displaying unchopped argument in chop_and_escape_str

Do not use esc_html to escape [title] _attribute_ of a HTML element,
and quote unprintable characters. Replace unprintable characters by
'?' and use CGI method to generate HTML element and do the escaping.

This caused bug noticed by Martin Koegler,
Message-ID: <20080216130037.GA14571@auto.tuwien.ac.at>
that for bad commit encoding in author name, the title attribute (here
to show full, not shortened name) had embedded HTML code in it, result
of quoting unprintable characters the gitweb/HTML way. This of course
broke the HTML, causing page being not displayed in XML validating web
browsers.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect view: check for MinGW32 and MacOSX in addition... Johannes Schindelin Thu, 14 Feb 2008 12:29:58 +0000 (12:29 +0000)

bisect view: check for MinGW32 and MacOSX in addition to X11

When deciding if gitk or git-log should be used to visualize the current
state, the environment variable DISPLAY was checked. Now, we check
MSYSTEM (for MinGW32/MSys) and SECURITYSESSIONID (for MacOSX) in addition.

Note that there is currently no way to ssh into MinGW32, and that
SECURITYSESSIONID is not set automatically on MacOSX when ssh'ing into it.
So this patch should be safe.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sending errors to stdout under $PAGERJunio C Hamano Sat, 16 Feb 2008 19:15:41 +0000 (11:15 -0800)

sending errors to stdout under $PAGER

If you do this (and you are not an Emacs user who uses PAGER=cat
in your *shell* buffer):

$ git init
Initialized empty Git repository in .git/
$ echo hello world >foo
$ H=$(git hash-object -w foo)
$ git tag -a foo-tag -m "Tags $H" $H
$ echo $H
3b18e512dba79e4c8300dd08aeb37f8e728b8dad
$ rm -f .git/objects/3b/18e5*
$ git show foo-tag
tag foo-tag
Tagger: Junio C Hamano <gitster@pobox.com>
Date: Sat Feb 16 10:43:23 2008 -0800

Tags 3b18e512dba79e4c8300dd08aeb37f8e728b8dad

you do not get any indication of error. If you are careful, you
would notice that no contents from the tagged object is
displayed, but that is about it. If you run the "show" command
without pager, however, you will see the error:

$ git --no-pager show foo-tag
tag foo-tag
Tagger: Junio C Hamano <gitster@pobox.com>
Date: Sat Feb 16 10:43:23 2008 -0800

Tags 3b18e512dba79e4c8300dd08aeb37f8e728b8dad
error: Could not read object 3b18e512dba79e4c8300dd08aeb37f8e728b8dad

Because we spawn the pager as the foreground process and feed
its input via pipe from the real command, we cannot affect the
exit status the shell sees from git command when the pager is in
use (I think there is not much gain we can have by working it
around, though). But at least it may make sense to show the
error message to the user sitting in front of the pager.

[jc: Edgar Toernig suggested a much nicer implementation than
what I originally posted, which I took.]

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 1.5.4.2 and start 1.5.5 Release NotesJunio C Hamano Sun, 17 Feb 2008 09:18:54 +0000 (01:18 -0800)

Sync with 1.5.4.2 and start 1.5.5 Release Notes

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Sun, 17 Feb 2008 09:16:44 +0000 (01:16 -0800)

Merge branch 'maint'

* maint:
GIT 1.5.4.2

GIT 1.5.4.2 v1.5.4.2Junio C Hamano Sun, 17 Feb 2008 06:44:31 +0000 (22:44 -0800)

GIT 1.5.4.2

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-gui: Update German translation.Christian Stimming Sat, 16 Feb 2008 20:53:23 +0000 (21:53 +0100)

git-gui: Update German translation.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: (i18n) Add newly added translation strings... Christian Stimming Sat, 16 Feb 2008 20:56:22 +0000 (21:56 +0100)

git-gui: (i18n) Add newly added translation strings to template.

And markup one missing string for translation.

Signed-off-by: Christian Stimming <stimming@tuhh.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Merge branch 'bd/qsort'Junio C Hamano Sun, 17 Feb 2008 02:11:10 +0000 (18:11 -0800)

Merge branch 'bd/qsort'

* bd/qsort:
compat: Add simplified merge sort implementation from glibc

Merge branch 'sp/safecrlf'Junio C Hamano Sun, 17 Feb 2008 01:59:20 +0000 (17:59 -0800)

Merge branch 'sp/safecrlf'

* sp/safecrlf:
safecrlf: Add mechanism to warn about irreversible crlf conversions

Merge branch 'cc/browser'Junio C Hamano Sun, 17 Feb 2008 01:57:47 +0000 (17:57 -0800)

Merge branch 'cc/browser'

* cc/browser:
Documentation: add 'git-web--browse.txt' and simplify other docs.
git-web--browse: fix misplaced quote in init_browser_path()
web--browse: Add a few quotes in 'init_browser_path'.
Documentation: instaweb: add 'git-web--browse' information.
Adjust .gitignore for 5884f1(Rename 'git-help--browse.sh'...)
git-web--browse: do not start the browser with nohup
instaweb: use 'git-web--browse' to launch browser.
Rename 'git-help--browse.sh' to 'git-web--browse.sh'.
help--browse: add '--config' option to check a config option for a browser.
help: make 'git-help--browse' usable outside 'git-help'.

Conflicts:

git-web--browse.sh

Merge branch 'jc/gitignore-ends-with-slash'Junio C Hamano Sun, 17 Feb 2008 01:57:06 +0000 (17:57 -0800)

Merge branch 'jc/gitignore-ends-with-slash'

* jc/gitignore-ends-with-slash:
gitignore: lazily find dtype
gitignore(5): Allow "foo/" in ignore list to match directory "foo"

Merge branch 'pb/prepare-commit-msg'Junio C Hamano Sun, 17 Feb 2008 01:56:59 +0000 (17:56 -0800)

Merge branch 'pb/prepare-commit-msg'

* pb/prepare-commit-msg:
git-commit: add a prepare-commit-msg hook
git-commit: Refactor creation of log message.
git-commit: set GIT_EDITOR=: if editor will not be launched
git-commit: support variable number of hook arguments

Merge branch 'jk/noetcconfig'Junio C Hamano Sun, 17 Feb 2008 01:56:51 +0000 (17:56 -0800)

Merge branch 'jk/noetcconfig'

* jk/noetcconfig:
fix config reading in tests
allow suppressing of global and system config

Conflicts:

cache.h

Merge branch 'jc/submittingpatches'Junio C Hamano Sun, 17 Feb 2008 01:43:25 +0000 (17:43 -0800)

Merge branch 'jc/submittingpatches'

* jc/submittingpatches:
Documentation/SubmittingPatches - a suggested patch flow
Documentation/SubmittingPatches: What's Acked-by and Tested-by?
Documentation/SubmittingPatches: discuss first then submit
Documentation/SubmittingPatches: Instruct how to use [PATCH] Subject header

Merge git://repo.or.cz/git-guiJunio C Hamano Sun, 17 Feb 2008 01:42:49 +0000 (17:42 -0800)

Merge git://repo.or.cz/git-gui

* git://repo.or.cz/git-gui:
git-gui: Correct size of dictionary name widget in options dialog
git-gui: Paper bag fix bad string length call in spellchecker

Merge git://git.kernel.org/pub/scm/gitk/gitkJunio C Hamano Sun, 17 Feb 2008 01:41:38 +0000 (17:41 -0800)

Merge git://git.kernel.org/pub/scm/gitk/gitk

* git://git.kernel.org/pub/scm/gitk/gitk:
[PATCH] gitk: Heed the lines of context in merge commits

Merge branch 'maint'Junio C Hamano Sun, 17 Feb 2008 01:41:23 +0000 (17:41 -0800)

Merge branch 'maint'

* maint:
Documentation/git-reset: Add an example of resetting selected paths
Documentation/git-reset: don't mention --mixed for selected-paths reset
Documentation/git-reset:

Documentation/SubmittingPatches - a suggested patch... Junio C Hamano Sun, 10 Feb 2008 22:09:52 +0000 (14:09 -0800)

Documentation/SubmittingPatches - a suggested patch flow

Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout: notice when the switched branch is behind... Junio C Hamano Sun, 17 Feb 2008 01:17:09 +0000 (17:17 -0800)

checkout: notice when the switched branch is behind or forked

When you are switching to a branch that is marked to merge from
somewhere else, e.g. when you have:

[branch "next"]
remote = upstream
merge = refs/heads/next
[remote "upstream"]
url = ...
fetch = refs/heads/*:refs/remotes/linus/*

and you say "git checkout next", the branch you checked out
may be behind, and you may want to update from the upstream
before continuing to work.

This patch makes the command to check the upstream (in this
example, "refs/remotes/linus/next") and our branch "next", and:

(1) if they match, nothing happens;

(2) if you are ahead (i.e. the upstream is a strict ancestor
of you), one line message tells you so;

(3) otherwise, you are either behind or you and the upstream
have forked. One line message will tell you which and
then you will see a "log --pretty=oneline --left-right".

We could enhance this with an option that tells the command to
check if there is no local change, and automatically fast
forward when you are truly behind. But I ripped out that change
because I was unsure what the right way should be to allow users
to control it (issues include that checkout should not become
automatically interactive).

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Build in checkoutDaniel Barkalow Thu, 7 Feb 2008 16:40:23 +0000 (11:40 -0500)

Build in checkout

The only differences in behavior should be:

- git checkout -m with non-trivial merging won't print out
merge-recursive messages (see the change in t7201-co.sh)

- git checkout -- paths... will give a sensible error message if
HEAD is invalid as a commit.

- some intermediate states which were written to disk in the shell
version (in particular, index states) are only kept in memory in
this version, and therefore these can no longer be revealed by
later write operations becoming impossible.

- when we change branches, we discard MERGE_MSG, SQUASH_MSG, and
rr-cache/MERGE_RR, like reset always has.

I'm not 100% sure I got the merge recursive setup exactly right; the
base for a non-trivial merge in the shell code doesn't seem
theoretically justified to me, but I tried to match it anyway, and the
tests all pass this way.

Other than these items, the results should be identical to the shell
version, so far as I can tell.

[jc: squashed lock-file fix from Dscho in]

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-reset: Add an example of resetting... Pieter de Bie Sat, 16 Feb 2008 16:48:46 +0000 (17:48 +0100)

Documentation/git-reset: Add an example of resetting selected paths

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-reset: don't mention --mixed for... Pieter de Bie Sat, 16 Feb 2008 16:48:45 +0000 (17:48 +0100)

Documentation/git-reset: don't mention --mixed for selected-paths reset

The option is accepted, but that is the only form selected-paths
variant of the reset command takes, so there is no point mentioning it.
And while we're at it, use the dashless git call.

Signed-off-by: Pieter de Bie <pdebie@ai.rug.nl>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-reset:Junio C Hamano Sat, 16 Feb 2008 18:38:12 +0000 (10:38 -0800)

Documentation/git-reset:

Since 3368d11 (Remove unnecessary git-rm --cached reference from
status output), the status output marks the "Added but not yet
committed" section as "Changes to be committed".

Signed-off-by: Junio C Hamano <gitster@pobox.com>

add--interactive: handle initial commit betterJeff King Wed, 13 Feb 2008 10:50:51 +0000 (05:50 -0500)

add--interactive: handle initial commit better

There were several points where we looked at the HEAD
commit; for initial commits, this is meaningless. So instead
we:

- show staged status data as a diff against the empty tree
instead of HEAD
- show file diffs as creation events
- use "git rm --cached" to revert instead of going back to
the HEAD commit

We magically reference the empty tree to implement this.

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

Update fast-import documentation to discuss crash reportsShawn O. Pearce Thu, 14 Feb 2008 06:34:46 +0000 (01:34 -0500)

Update fast-import documentation to discuss crash reports

Recent versions of fast-import will now dump information out upon
crashing, making it possible for the frontend developer to review
some state information and possibly restart the import from the
point where it crashed.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Finish current packfile during fast-import crash handlerShawn O. Pearce Thu, 14 Feb 2008 06:34:43 +0000 (01:34 -0500)

Finish current packfile during fast-import crash handler

If fast-import is in the middle of crashing due to a protocol error
or something like that then it can be very useful to have the mark
table and all objects up until that point be available for a new
import to resume from.

Currently we just close the active packfile, unkeep all of our
newly created packfiles (so they can be deleted), and dump the
marks table to a temporary file.

We don't attempt to update the refs/tags that the process has in
memory as much of that data can be found in the crash report and I'm
not sure it would be the right thing to do under every type of crash.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Include the fast-import marks table in crash reportsShawn O. Pearce Thu, 14 Feb 2008 06:34:40 +0000 (01:34 -0500)

Include the fast-import marks table in crash reports

If fast-import was not run with --export-marks but we are crashing
the frontend application developer may still benefit from having
that information available to them. We now include the marks table
as part of the crash report if --export-marks was not supplied on
the command line.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Include annotated tags in fast-import crash reportsShawn O. Pearce Thu, 14 Feb 2008 06:34:36 +0000 (01:34 -0500)

Include annotated tags in fast-import crash reports

If annotated tags were created they exist in a different namespace
within the fast-import process' internal memory tables so we did
not export them in the inactive branch table. Now they are written
out after the branches, in the order that they were defined by the
frontend process.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: add 'git-web--browse.txt' and simplify... Christian Couder Thu, 14 Feb 2008 07:01:23 +0000 (08:01 +0100)

Documentation: add 'git-web--browse.txt' and simplify other docs.

'git-help.txt' and 'git-instaweb.txt' contained duplicated
information about 'git-web--browse'.

This patch puts this information where it belongs.

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

git-help--browse: improve browser support under OS XJay Soffian Thu, 14 Feb 2008 08:36:14 +0000 (03:36 -0500)

git-help--browse: improve browser support under OS X

/usr/bin/open <document> is used under OS X to open a document as if the
user had double-clicked on the file's icon (i.e. HTML files are opened
w/the user's default browser).

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

Merge branch 'maint'Junio C Hamano Sat, 16 Feb 2008 08:20:37 +0000 (00:20 -0800)

Merge branch 'maint'

* maint:
commit: discard index after setting up partial commit
filter-branch: handle filenames that need quoting
diff: Fix miscounting of --check output
hg-to-git: fix parent analysis
mailinfo: feed only one line to handle_filter() for QP input
diff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver"
Add "const" qualifier to "char *excludes_file".
Add "const" qualifier to "char *editor_program".
Add "const" qualifier to "char *pager_program".
config: add 'git_config_string' to refactor string config variables.
diff.c: remove useless check for value != NULL
fast-import: check return value from unpack_entry()
Validate nicknames of remote branches to prohibit confusing ones
diff.c: replace a 'strdup' with 'xstrdup'.
diff.c: fixup garding of config parser from value=NULL

commit: discard index after setting up partial commitJeff King Thu, 14 Feb 2008 17:18:23 +0000 (12:18 -0500)

commit: discard index after setting up partial commit

There may still be some entries from the original index that
should be discarded before we show the status. In
particular, if a file was added in the index but not
included in the partial commit, it would still show up in
the status listing as staged for commit.

Ultimately the correct fix is to keep the two states in
separate index_state variables. Then we can avoid having
to reload the cache from the temporary file altogether, and
just point wt_status_print at the correct index.

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

filter-branch: handle filenames that need quotingJunio C Hamano Sat, 16 Feb 2008 07:57:26 +0000 (23:57 -0800)

filter-branch: handle filenames that need quoting

The command used a very old fashioned construct to extract
filenames out of diff-index and ended up corrupting the output.
We can simply use --name-only and pipe into --stdin mode of
update-index. It's been like that for the past 2 years or so
since a94d994 (update-index: work with c-quoted name).

Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push: avoid a needless gotoJohannes Schindelin Thu, 14 Feb 2008 23:26:12 +0000 (23:26 +0000)

http-push: avoid a needless goto

There was a goto, and while it is not half as harmful as some people
believe, it was unnecessary here. So remove it for readability.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push: do not get confused by submodulesJohannes Schindelin Thu, 14 Feb 2008 23:32:32 +0000 (23:32 +0000)

http-push: do not get confused by submodules

When encountering submodules in a tree, http-push should not try sending
the respective object. Instead, it should ignore it.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push: avoid invalid memory accessesJohannes Schindelin Thu, 14 Feb 2008 23:25:33 +0000 (23:25 +0000)

http-push: avoid invalid memory accesses

Before objects are sent, the respective ref is locked. However,
without this patch, the lock is lifted before the last object for
that ref was sent. As a consequence, the lock data was accessed
after the lock structure was free()d.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: Fix miscounting of --check outputJunio C Hamano Sat, 16 Feb 2008 04:30:05 +0000 (20:30 -0800)

diff: Fix miscounting of --check output

c1795bb (Unify whitespace checking) incorrectly made the
checking function return without incrementing the line numbers
when there is no whitespace problem is found on a '+' line.

This resurrects the earlier behaviour.

Noticed and reported by Jay Soffian. The test script was stolen
from Jay's independent fix.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

hg-to-git: fix parent analysisStelian Pop Fri, 15 Feb 2008 21:20:44 +0000 (22:20 +0100)

hg-to-git: fix parent analysis

Fix a bug in the hg-to-git convertor introduced by commit
1bc7c13af9f936aa80893100120b542338a10bf4: when searching the changeset
parents, 'hg log' returns an extra space at the end of the line, which
confuses the .split(' ') based tokenizer:

Traceback (most recent call last):
File "hg-to-git.py", line 123, in <module>
hgchildren[mparent] += ( str(cset), )
KeyError: ''

Signed-off-by: Stelian Pop <stelian@popies.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailinfo: feed only one line to handle_filter() for... Jay Soffian Fri, 15 Feb 2008 21:53:36 +0000 (16:53 -0500)

mailinfo: feed only one line to handle_filter() for QP input

The function is intended to be fed one logical line at a time to
inspect, but a QP encoded raw input line can have more than one
lines, just like BASE64 encoded one.

Quoting LF as =0A may be unusual but RFC2045 allows it.

The issue was noticed and fixed by Jay Soffian. JC added a test
to protect the fix from regressing later.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: add "const" qualifier to "char *cmd" member... Christian Couder Sat, 16 Feb 2008 05:02:17 +0000 (06:02 +0100)

diff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver"

Also use "git_config_string" to simplify code where "cmd" is set.

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

Add "const" qualifier to "char *excludes_file".Christian Couder Sat, 16 Feb 2008 05:01:59 +0000 (06:01 +0100)

Add "const" qualifier to "char *excludes_file".

Also use "git_config_string" to simplify "config.c" code
where "excludes_file" is set.

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

Add "const" qualifier to "char *editor_program".Christian Couder Sat, 16 Feb 2008 05:01:41 +0000 (06:01 +0100)

Add "const" qualifier to "char *editor_program".

Also use "git_config_string" to simplify "config.c" code
where "editor_program" is set.

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

Add "const" qualifier to "char *pager_program".Christian Couder Sat, 16 Feb 2008 05:01:11 +0000 (06:01 +0100)

Add "const" qualifier to "char *pager_program".

Also use "git_config_string" to simplify "config.c" code
where "pager_program" is set.

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

config: add 'git_config_string' to refactor string... Christian Couder Sat, 16 Feb 2008 05:00:24 +0000 (06:00 +0100)

config: add 'git_config_string' to refactor string config variables.

In many places we just check if a value from the config file is not
NULL, then we duplicate it and return 0. This patch introduces the new
'git_config_string' function to do that.

This function is also used to refactor some code in 'config.c'.
Refactoring other files is left for other patches.

Also not all the code in "config.c" is refactored, because the function
takes a "const char **" as its first parameter, but in many places a
"char *" is used instead of a "const char *". (And C does not allow
using a "char **" instead of a "const char **" without a warning.)

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

diff.c: remove useless check for value != NULLChristian Couder Sat, 16 Feb 2008 04:59:53 +0000 (05:59 +0100)

diff.c: remove useless check for value != NULL

It is not necessary to check if value != NULL before calling
'parse_lldiff_command' as there is already a check inside this
function.

By the way this patch also improves the existing check inside
'parse_lldiff_command' by using:
return config_error_nonbool(var);
instead of:
return error("%s: lacks value", var);

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

fast-import: check return value from unpack_entry()Shawn O. Pearce Thu, 14 Feb 2008 06:34:34 +0000 (01:34 -0500)

fast-import: check return value from unpack_entry()

If the tree object we have asked for is deltafied in the packfile and
the delta did not apply correctly or was not able to be decompressed
from the packfile then we can get back NULL instead of the tree data.
This is (part of) the reason why read_sha1_file() can return NULL, so
we need to also handle it the same way.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Validate nicknames of remote branches to prohibit confu... Daniel Barkalow Fri, 15 Feb 2008 19:14:18 +0000 (14:14 -0500)

Validate nicknames of remote branches to prohibit confusing ones

The original problem was that the parsers for configuration files were
getting confused by seeing as nicknames remotes that involved
directory-changing characters. In particular, the branches config file
for ".." was particularly mystifying on platforms that can open
directories and read odd data from them.

The validation function was written by Junio Hamano (with a typo
corrected).

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: replace a 'strdup' with 'xstrdup'.Christian Couder Thu, 14 Feb 2008 05:50:00 +0000 (06:50 +0100)

diff.c: replace a 'strdup' with 'xstrdup'.

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

diff.c: fixup garding of config parser from value=NULLJunio C Hamano Fri, 15 Feb 2008 17:37:54 +0000 (09:37 -0800)

diff.c: fixup garding of config parser from value=NULL

Christian Couder noticed that there still were a handcrafted error()
call that we should have converted to config_error_nonbool() where
parse_lldiff_command() parses the configuration file.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-gui: Correct size of dictionary name widget in... Shawn O. Pearce Thu, 14 Feb 2008 06:07:39 +0000 (01:07 -0500)

git-gui: Correct size of dictionary name widget in options dialog

We don't need to fill this entire horizontal cavity, it looks really
bad on some platforms to stretch the widget out to fill the window.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

git-gui: Paper bag fix bad string length call in spellc... Shawn O. Pearce Thu, 14 Feb 2008 06:05:04 +0000 (01:05 -0500)

git-gui: Paper bag fix bad string length call in spellchecker

We don't want the list length, we need the string length.

Found due to a bad " character discovered in the text and
Tcl throwing 'unmatched open quote in list'.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Add "--show-all" revision walker flag for debuggingLinus Torvalds Sat, 9 Feb 2008 22:02:07 +0000 (14:02 -0800)

Add "--show-all" revision walker flag for debugging

It's really not very easy to visualize the commit walker, because - on
purpose - it obvously doesn't show the uninteresting commits!

This adds a "--show-all" flag to the revision walker, which will make
it show uninteresting commits too, and they'll have a '^' in front of
them (it also fixes a logic error for !verbose_header for boundary
commits - we should show the '-' even if left_right isn't shown).

A separate patch to gitk to teach it the new '^' was sent
to paulus. With the change in place, it actually is interesting
even for the cases that git doesn't have any problems with, ie
for the kernel you can do:

gitk -d --show-all v2.6.24..

and you see just how far down it has to parse things to see it all. The
use of "-d" is a good idea, since the date-ordered toposort is much better
at showing why it goes deep down (ie the date of some of those commits
after 2.6.24 is much older, because they were merged from trees that
weren't rebased).

So I think this is a useful feature even for non-debugging - just to
visualize what git does internally more.

When it actually breaks out due to the "everybody_uninteresting()"
case, it adds the uninteresting commits (both the one it's looking at
now, and the list of pending ones) to the list

This way, we really list *all* the commits we've looked at.

Because we now end up listing commits we may not even have been parsed
at all "show_log" and "show_commit" need to protect against commits
that don't have a commit buffer entry.

That second part is debatable just how it should work. Maybe we shouldn't
show such entries at all (with this patch those entries do get shown, they
just don't get any message shown with them). But I think this is a useful
case.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

[PATCH] gitk: Heed the lines of context in merge commitsJohannes Sixt Wed, 13 Feb 2008 16:27:30 +0000 (17:27 +0100)

[PATCH] gitk: Heed the lines of context in merge commits

There is an edit box where the number of context lines can be chosen.
But it was only used when regular diffs were displayed, not for
merge commits. This fixes it.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Paul Mackerras <paulus@samba.org>

diff --relative: help working in a bare repositoryJunio C Hamano Wed, 13 Feb 2008 08:34:39 +0000 (00:34 -0800)

diff --relative: help working in a bare repository

This allows the --relative option to say which subdirectory to
pretend to be in, so that in a bare repository, you can say:

$ git log --relative=drivers/ v2.6.20..v2.6.22 -- drivers/scsi/

Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff --relative: output paths as relative to the curren... Junio C Hamano Tue, 12 Feb 2008 22:26:02 +0000 (14:26 -0800)

diff --relative: output paths as relative to the current subdirectory

This adds --relative option to the diff family. When you start
from a subdirectory:

$ git diff --relative

shows only the diff that is inside your current subdirectory,
and without $prefix part. People who usually live in
subdirectories may like it.

There are a few things I should also mention about the change:

- This works not just with diff but also works with the log
family of commands, but the history pruning is not affected.

In other words, if you go to a subdirectory, you can say:

$ git log --relative -p

but it will show the log message even for commits that do not
touch the current directory. You can limit it by giving
pathspec yourself:

$ git log --relative -p .

This originally was not a conscious design choice, but we
have a way to affect diff pathspec and pruning pathspec
independently. IOW "git log --full-diff -p ." tells it to
prune history to commits that affect the current subdirectory
but show the changes with full context. I think it makes
more sense to leave pruning independent from --relative than
the obvious alternative of always pruning with the current
subdirectory, which would break the symmetry.

- Because this works also with the log family, you could
format-patch a single change, limiting the effect to your
subdirectory, like so:

$ cd gitk-git
$ git format-patch -1 --relative 911f1eb

But because that is a special purpose usage, this option will
never become the default, with or without repository or user
preference configuration. The risk of producing a partial
patch and sending it out by mistake is too great if we did
so.

- This is inherently incompatible with --no-index, which is a
bolted-on hack that does not have much to do with git
itself. I didn't bother checking and erroring out on the
combined use of the options, but probably I should.

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 13 Feb 2008 22:33:19 +0000 (14:33 -0800)

Merge branch 'maint'

* maint:
config: add test cases for empty value and no value config variables.
cvsimport: have default merge regex also match beginning of commit message
git clone -s documentation: force a new paragraph for the NOTE
status: suggest "git rm --cached" to unstage for initial commit
Protect get_author_ident_from_commit() from filenames in work tree
upload-pack: Initialize the exec-path.
bisect: use verbatim commit subject in the bisect log
git-cvsimport.txt: fix '-M' description.
Revert "pack-objects: only throw away data during memory pressure"

config: add test cases for empty value and no value... Christian Couder Thu, 7 Feb 2008 05:23:46 +0000 (06:23 +0100)

config: add test cases for empty value and no value config variables.

The tests in 't1300-repo-config.sh' did not check what happens when
an empty value like the following is used in the config file:

[emptyvalue]
variable =

Also it was not checked that a variable with no value like the
following:

[novalue]
variable

gives a boolean "true" value, while an ampty value gives a boolean
"false" value.

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

cvsimport: have default merge regex also match beginnin... Gerrit Pape Thu, 7 Feb 2008 09:36:10 +0000 (09:36 +0000)

cvsimport: have default merge regex also match beginning of commit message

The default value of @mergerx uses \W, which matches a non-word
character; this means that commit messages like "Merging FOO" are not
matched by default; using \b, which matches a word boundary, instead of
\W fixes that.

This change was suggested by Frédéric Brière through
http://bugs.debian.org/463468

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>