gitweb.git
Fix name re-hashing semanticsLinus Torvalds Sat, 23 Feb 2008 04:37:40 +0000 (20:37 -0800)

Fix name re-hashing semantics

We handled the case of removing and re-inserting cache entries badly,
which is something that merging commonly needs to do (removing the
different stages, and then re-inserting one of them as the merged
state).

We even had a rather ugly special case for this failure case, where
replace_index_entry() basically turned itself into a no-op if the new
and the old entries were the same, exactly because the hash routines
didn't handle it on their own.

So what this patch does is to not just have the UNHASHED bit, but a
HASHED bit too, and when you insert an entry into the name hash, that
involves:

- clear the UNHASHED bit, because now it's valid again for lookup
(which is really all that UNHASHED meant)

- if we're being lazy, we're done here (but we still want to clear the
UNHASHED bit regardless of lazy mode, since we can become unlazy
later, and so we need the UNHASHED bit to always be set correctly,
even if we never actually insert the entry into the hash list)

- if it was already hashed, we just leave it on the list

- otherwise mark it HASHED and insert it into the list

this all means that unhashing and rehashing a name all just works
automatically. Obviously, you cannot change the name of an entry (that
would be a serious bug), but nothing can validly do that anyway (you'd
have to allocate a new struct cache_entry anyway since the name length
could change), so that's not a new limitation.

The code actually gets simpler in many ways, although the lazy hashing
does mean that there are a few odd cases (ie something can be marked
unhashed even though it was never on the hash in the first place, and
isn't actually marked hashed!).

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

Avoid unnecessary "if-before-free" tests.Jim Meyering Thu, 31 Jan 2008 17:26:32 +0000 (18:26 +0100)

Avoid unnecessary "if-before-free" tests.

This change removes all obvious useless if-before-free tests.
E.g., it replaces code like this:

if (some_expression)
free (some_expression);

with the now-equivalent:

free (some_expression);

It is equivalent not just because POSIX has required free(NULL)
to work for a long time, but simply because it has worked for
so long that no reasonable porting target fails the test.
Here's some evidence from nearly 1.5 years ago:

http://www.winehq.org/pipermail/wine-patches/2006-October/031544.html

FYI, the change below was prepared by running the following:

git ls-files -z | xargs -0 \
perl -0x3b -pi -e \
's/\bif\s*\(\s*(\S+?)(?:\s*!=\s*NULL)?\s*\)\s+(free\s*\(\s*\1\s*\))/$2/s'

Note however, that it doesn't handle brace-enclosed blocks like
"if (x) { free (x); }". But that's ok, since there were none like
that in git sources.

Beware: if you do use the above snippet, note that it can
produce syntactically invalid C code. That happens when the
affected "if"-statement has a matching "else".
E.g., it would transform this

if (x)
free (x);
else
foo ();

into this:

free (x);
else
foo ();

There were none of those here, either.

If you're interested in automating detection of the useless
tests, you might like the useless-if-before-free script in gnulib:
[it *does* detect brace-enclosed free statements, and has a --name=S
option to make it detect free-like functions with different names]

http://git.sv.gnu.org/gitweb/?p=gnulib.git;a=blob;f=build-aux/useless-if-before-free

Addendum:
Remove one more (in imap-send.c), spotted by Jean-Luc Herren <jlh@gmx.ch>.

Signed-off-by: Jim Meyering <meyering@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Fri, 22 Feb 2008 22:01:43 +0000 (14:01 -0800)

Merge branch 'maint'

* maint:
hash: fix lookup_hash semantics

hash: fix lookup_hash semanticsJeff King Fri, 22 Feb 2008 19:47:27 +0000 (14:47 -0500)

hash: fix lookup_hash semantics

We were returning the _address of_ the stored item (or NULL)
instead of the item itself. While this sort of indirection
is useful for insertion (since you can lookup and then
modify), it is unnecessary for read-only lookup. Since the
hash code splits these functions between the internal
lookup_hash_entry function and the public lookup_hash
function, it makes sense for the latter to provide what
users of the library expect.

The result of this was that the index caching returned bogus
results on lookup. We unfortunately didn't catch this
because we were returning a "struct cache_entry **" as a
"void *", and accidentally assigning it to a "struct
cache_entry *".

As it happens, this actually _worked_ most of the time,
because the entries were defined as:

struct cache_entry {
struct cache_entry *next;
...
};

meaning that interpreting a "struct cache_entry **" as a
"struct cache_entry *" would yield an entry where all fields
were totally bogus _except_ for the next pointer, which
pointed to the actual cache entry. When walking the list, we
would look at the bogus "name" field, which was unlikely to
match our lookup, and then proceed to the "real" entry.

The reading of bogus data was silently ignored most of the
time, but could cause a segfault for some data (which seems
to be more common on OS X).

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

gitweb: Better chopping in commit search resultsJunio C Hamano Fri, 22 Feb 2008 16:33:47 +0000 (17:33 +0100)

gitweb: Better chopping in commit search results

When searching commit messages (commit search), if matched string is
too long, the generated HTML was munged leading to an ill-formed XHTML
document.

Now gitweb chop leading, trailing and matched parts, HTML escapes
those parts, then composes and marks up match info. HTML output is
never chopped. Limiting matched info to 80 columns (with slop) is now
done by dividing remaining characters after chopping match equally to
leading and trailing part, not by chopping composed and HTML marked
output.

Noticed-by: Jean-Baptiste Quenot <jbq@caraldi.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

hash-object: cleanup handling of command line optionsGerrit Pape Thu, 21 Feb 2008 10:06:47 +0000 (10:06 +0000)

hash-object: cleanup handling of command line options

git hash-object used to process the --stdin command line argument
before reading subsequent arguments. This caused 'git hash-object
--stdin -w' to fail to actually write the object into the
database, while '-w --stdin' properly did. Now git hash-object
first reads all arguments, and then processes them.

This regresses one insane use case. git hash-object used to allow
multiple --stdin arguments on the command line:

$ git hash-object --stdin --stdin
foo
^D
bar
^D

Now git hash-object errors out if --stdin is given more than once.

Reported by Josh Triplett through
http://bugs.debian.org/464432

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

builtin-tag.c: remove cruftGerrit Pape Fri, 22 Feb 2008 09:53:09 +0000 (09:53 +0000)

builtin-tag.c: remove cruft

After changing builtin-tag.c to use strbuf in fd17f5b (Replace all
read_fd use with strbuf_read, and get rid of it.), the last condition
in do_sign() will always be false, as it's checked already right
above. So let's remove the cruft.

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

git-merge-index documentation: clarify synopsisGerrit Pape Fri, 22 Feb 2008 08:55:29 +0000 (08:55 +0000)

git-merge-index documentation: clarify synopsis

The options following <merge-program> are not -a, --, or <file>...,
but either -a, or -- <file>..., while -- is optional.

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

git-gui: Focus insertion point at end of strings in... Shawn O. Pearce Mon, 11 Feb 2008 05:53:52 +0000 (00:53 -0500)

git-gui: Focus insertion point at end of strings in repository chooser

When selecting a local working directory for a new repository or a
location to clone an existing repository into we now set the insert
point at the end of the selected path, allowing the user to type in
any additional parts of the path if they so desire.

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

git-gui: Avoid hardcoded Windows paths in Cygwin packag... Shawn O. Pearce Fri, 22 Feb 2008 00:27:46 +0000 (19:27 -0500)

git-gui: Avoid hardcoded Windows paths in Cygwin package files

When we are being built by the Cygwin package maintainers we need to
embed the POSIX path to our library files and not the Windows path.
Embedding the Windows path means all end-users who install our Cygwin
package would be required to install Cygwin at the same Windows path
as the package maintainer had Cygwin installed to. This requirement
is simply not user-friendly and may be infeasible for a large number
of our users.

We now try to auto-detect if the Tcl/Tk binary we will use at runtime
is capable of translating POSIX paths into Windows paths the same way
that cygpath does the translations. If the Tcl/Tk binary gives us the
same results then it understands the Cygwin path translation process
and should be able to read our library files from a POSIX path name.

If it does not give us the same answer as cygpath then the Tcl/Tk
binary might actually be a native Win32 build (one that is not
linked against Cygwin) and thus requires the native Windows path
to our library files. We can assume this is not a Cygwin package
as the Cygwin maintainers do not currently ship a pure Win32 build
of Tcl/Tk.

Reported on the git mailing list by Jurko Gospodnetić.

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

git-gui: Default TCL_PATH to same location as TCLTK_PATHShawn O. Pearce Fri, 22 Feb 2008 00:17:27 +0000 (19:17 -0500)

git-gui: Default TCL_PATH to same location as TCLTK_PATH

Most users set TCLTK_PATH to tell git-gui where to find wish, but they
fail to set TCL_PATH to the same Tcl installation. We use the non-GUI
tclsh during builds so headless systems are still able to create an
index file and create message files without GNU msgfmt. So it matters
to us that we find a working TCL_PATH at build time.

If TCL_PATH hasn't been set yet we can take a better guess about what
tclsh executable to use by replacing 'wish' in the executable path with
'tclsh'. We only do this replacement on the filename part of the path,
just in case the string "wish" appears in the directory paths. Most of
the time the tclsh will be installed alongside wish so this replacement
is a sensible and safe default.

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

git-gui: Paper bag fix error dialogs opening over the... Shawn O. Pearce Thu, 21 Feb 2008 17:22:08 +0000 (12:22 -0500)

git-gui: Paper bag fix error dialogs opening over the main window

If the main window is the only toplevel we have open then we
don't have a valid grab right now, so we need to assume the
best toplevel to use for the parent is ".".

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

send-email: fix In-Reply-To regressionJay Soffian Fri, 22 Feb 2008 00:16:04 +0000 (19:16 -0500)

send-email: fix In-Reply-To regression

Fix a regression introduced by

1ca3d6e (send-email: squelch warning due to comparing undefined $_ to "")

where if the user was prompted for an initial In-Reply-To and didn't
provide one, messages would be sent out with an invalid In-Reply-To of
"<>"

Also add test cases for the regression and the fix. A small modification
was needed to allow send-email to take its replies from stdin if the
environment variable GIT_SEND_EMAIL_NOTTY is set.

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

checkout: updates to tracking reportJunio C Hamano Thu, 21 Feb 2008 03:42:53 +0000 (19:42 -0800)

checkout: updates to tracking report

Ask branch_get() for the new branch explicitly instead of
letting it return a potentially stale information.

Tighten the logic to find the tracking branch to deal better
with misconfigured repositories (i.e. branch.*.merge can exist
but it may not have a refspec that fetches to .it)

Also fixes grammar in a message, as pointed out by Jeff King.

The function is about reporting and not automatically
fast-forwarding to the upstream, so stop calling it
"adjust-to".

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

builtin-checkout.c: Remove unused prefix arguments... Daniel Barkalow Thu, 21 Feb 2008 15:50:42 +0000 (10:50 -0500)

builtin-checkout.c: Remove unused prefix arguments in switch_branches path

This path doesn't actually care where in the tree you started out,
since it must change the whole thing anyway. With the gratuitous bug
removed, the argument is unused.

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

git-reset --hard and git-read-tree --reset: fix read_ca... Junio C Hamano Thu, 21 Feb 2008 19:33:56 +0000 (11:33 -0800)

git-reset --hard and git-read-tree --reset: fix read_cache_unmerged()

When invalidating unmerged entries in the index, we used to set
their ce_mode to 0 to note the fact that they do not matter
anymore which also made sure that later unpack_trees() call
would not reuse them. Instead just remove them from the index.

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

git-gui: Ensure error dialogs always appear over all... Shawn O. Pearce Thu, 21 Feb 2008 04:37:07 +0000 (23:37 -0500)

git-gui: Ensure error dialogs always appear over all other windows

If we are opening an error dialog we want it to appear above all of
the other windows, even those that we may have opened with a grab
to make the window modal. Failure to do so may allow an error
dialog to open up (and grab focus!) under an existing toplevel,
making the user think git-gui has frozen up and is unresponsive,
as they cannot get to the dialog.

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

Teach git-grep --name-only as synonym for -lShawn O. Pearce Thu, 21 Feb 2008 04:28:07 +0000 (23:28 -0500)

Teach git-grep --name-only as synonym for -l

I expected git grep --name-only to give me only the file names,
much as git diff --name-only only generates filenames. Alas the
option is -l, which matches common external greps but doesn't match
other parts of the git UI.

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

diff: fix java funcname pattern for solarisJeff King Thu, 21 Feb 2008 00:01:16 +0000 (19:01 -0500)

diff: fix java funcname pattern for solaris

The Solaris regex library doesn't like having the '$' anchor
inside capture parentheses. It rejects the match, causing
t4018 to fail.

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

t3404: use configured shell instead of /bin/shJeff King Thu, 21 Feb 2008 00:00:44 +0000 (19:00 -0500)

t3404: use configured shell instead of /bin/sh

The fake-editor shell script invoked /bin/sh; normally this
is fine, unless the /bin/sh doesn't meet our compatibility
requirements, as is the case with Solaris. Specifically, the
$() syntax used by fake-editor is not understood.

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

git_config_*: don't assume we are parsing a config... Jeff King Thu, 21 Feb 2008 00:00:32 +0000 (19:00 -0500)

git_config_*: don't assume we are parsing a config file

These functions get called by other code, including parsing
config options from the command line. In that case,
config_file_name is NULL, leading to an ugly message or even
a segfault on some implementations of printf.

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

prefix_path: use is_absolute_path() instead of *orig... Johannes Sixt Tue, 19 Feb 2008 21:29:40 +0000 (22:29 +0100)

prefix_path: use is_absolute_path() instead of *orig == '/'

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

git-clean: handle errors if removing files failsMiklos Vajna Thu, 21 Feb 2008 01:44:46 +0000 (02:44 +0100)

git-clean: handle errors if removing files fails

git-clean simply ignored errors if removing a file or directory failed. This
patch makes it raise a warning and the exit code also greater than zero if
there are remaining files.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'mk/color'Junio C Hamano Thu, 21 Feb 2008 00:13:56 +0000 (16:13 -0800)

Merge branch 'mk/color'

* mk/color:
Add color.ui variable which globally enables colorization if set

Merge branch 'js/maint-cvsexport'Junio C Hamano Thu, 21 Feb 2008 00:13:52 +0000 (16:13 -0800)

Merge branch 'js/maint-cvsexport'

* js/maint-cvsexport:
cvsexportcommit: be graceful when "cvs status" reorders the arguments

Conflicts:

t/t9200-git-cvsexportcommit.sh

Merge branch 'js/maint-http-push'Junio C Hamano Thu, 21 Feb 2008 00:13:32 +0000 (16:13 -0800)

Merge branch 'js/maint-http-push'

* js/maint-http-push:
http-push: avoid a needless goto
http-push: do not get confused by submodules
http-push: avoid invalid memory accesses

Merge branch 'jk/empty-tree'Junio C Hamano Thu, 21 Feb 2008 00:13:28 +0000 (16:13 -0800)

Merge branch 'jk/empty-tree'

* jk/empty-tree:
add--interactive: handle initial commit better
hard-code the empty tree object

Merge branch 'lt/revision-walker'Junio C Hamano Thu, 21 Feb 2008 00:13:24 +0000 (16:13 -0800)

Merge branch 'lt/revision-walker'

* lt/revision-walker:
Add "--show-all" revision walker flag for debugging

Merge branch 'mc/prefix'Junio C Hamano Thu, 21 Feb 2008 00:13:22 +0000 (16:13 -0800)

Merge branch 'mc/prefix'

* mc/prefix:
Avoid a useless prefix lookup in strbuf_expand()

Merge branch 'bc/fopen'Junio C Hamano Thu, 21 Feb 2008 00:13:19 +0000 (16:13 -0800)

Merge branch 'bc/fopen'

* bc/fopen:
Add compat/fopen.c which returns NULL on attempt to open directory

Merge branch 'jc/setup'Junio C Hamano Thu, 21 Feb 2008 00:13:16 +0000 (16:13 -0800)

Merge branch 'jc/setup'

* jc/setup:
builtin-mv: minimum fix to avoid losing files
git-add: adjust to the get_pathspec() changes.
Make blame accept absolute paths
setup: sanitize absolute and funny paths in get_pathspec()

Merge branch 'maint'Junio C Hamano Thu, 21 Feb 2008 00:13:13 +0000 (16:13 -0800)

Merge branch 'maint'

* maint:
Clarified the meaning of git-add -u in the documentation
git-clone.sh: properly configure remote even if remote's head is dangling
Documentation/git-stash: document options for git stash list
send-email: squelch warning due to comparing undefined $_ to ""

Clarified the meaning of git-add -u in the documentationPekka Kaitaniemi Wed, 20 Feb 2008 22:29:39 +0000 (00:29 +0200)

Clarified the meaning of git-add -u in the documentation

The git-add documentation did not state clearly that the -u switch
updates only the tracked files that are in the current directory and
its subdirectories.

Signed-off-by: Pekka Kaitaniemi <kaitanie@cc.helsinki.fi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

checkout: work from a subdirectoryJunio C Hamano Wed, 20 Feb 2008 23:54:54 +0000 (15:54 -0800)

checkout: work from a subdirectory

When switching branches from a subdirectory, checkout rewritten
in C extracted the toplevel of the tree in there.

This should fix it.

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

checkout: tone down the "forked status" diagnostic... Junio C Hamano Wed, 20 Feb 2008 23:05:23 +0000 (15:05 -0800)

checkout: tone down the "forked status" diagnostic messages

When checking out a branch that is behind or forked from a
branch you are building on top of, we used to show full
left-right log but if you already _know_ you have long history
since you forked, it is a bit too much.

This tones down the message quite a bit, by only showing the
number of commits each side has since they diverged. Also the
message is not shown at all under --quiet.

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

git-clone.sh: properly configure remote even if remote... Gerrit Pape Wed, 20 Feb 2008 15:10:17 +0000 (15:10 +0000)

git-clone.sh: properly configure remote even if remote's head is dangling

When cloning a remote repository which's HEAD refers to a nonexistent
ref, git-clone cloned all existing refs, but failed to write the
configuration for 'remote'. Now it detects the dangling remote HEAD,
refuses to checkout any local branch since HEAD refers to nowhere, but
properly writes the configuration for 'remote', so that subsequent
'git fetch's don't fail.

The problem was reported by Daniel Jacobowitz through
http://bugs.debian.org/466581

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

git.el: Set process-environment instead of invoking envDavid Kågedal Tue, 19 Feb 2008 14:01:53 +0000 (15:01 +0100)

git.el: Set process-environment instead of invoking env

This will make it a little less posix-dependent, and more efficient.

Included is also a minor doc improvement.

Signed-off-by: David Kågedal <davidk@lysator.liu.se>
Acked-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation/git-stash: document options for git stash... Miklos Vajna Wed, 20 Feb 2008 11:31:35 +0000 (12:31 +0100)

Documentation/git-stash: document options for git stash list

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Resolve value supplied for no-colon push refspecsDaniel Barkalow Wed, 20 Feb 2008 17:54:05 +0000 (12:54 -0500)

Resolve value supplied for no-colon push refspecs

When pushing a refspec like "HEAD", we used to treat it as
"HEAD:HEAD", which didn't work without rewriting. Instead, we should
resolve the ref. If it's a symref, further require it to point to a
branch, to avoid doing anything especially unexpected. Also remove the
rewriting previously added in builtin-push.

Since the code for "HEAD" uses the regular refspec parsing, it
automatically handles "+HEAD" without anything special.

[jc: added a further test to make sure that "remote.*.push = HEAD" works]

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

send-email: squelch warning due to comparing undefined... Jay Soffian Wed, 20 Feb 2008 05:55:07 +0000 (00:55 -0500)

send-email: squelch warning due to comparing undefined $_ to ""

The check to see if initial_reply_to is defined was also comparing $_ to
"" for a reason I cannot ascertain (looking at the commit which made the
change didn't provide enlightenment), but if $_ is undefined, perl
generates a warning.

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

Merge branch 'maint'Junio C Hamano Wed, 20 Feb 2008 08:54:24 +0000 (00:54 -0800)

Merge branch 'maint'

* maint:
Rename git-core rpm to just git and rename the meta-pacakge to git-all.
push: document the status output
Documentation/push: clarify matching refspec behavior
push: indicate partialness of error message

cvsexportcommit: be graceful when "cvs status" reorders... Johannes Schindelin Mon, 18 Feb 2008 17:55:22 +0000 (17:55 +0000)

cvsexportcommit: be graceful when "cvs status" reorders the arguments

In my use cases, "cvs status" sometimes reordered the passed filenames,
which often led to a misdetection of a dirty state (when it was in
reality a clean state).

I finally tracked it down to two filenames having the same basename.

So no longer trust the order of the results blindly, but actually check
the file name.

Since "cvs status" only returns the basename (and the complete path on the
server which is useless for our purposes), run "cvs status" several times
with lists consisting of files with unique (chomped) basenames.

Be a bit clever about new files: these are reported as "no file <blabla>",
so in order to discern it from existing files, prepend "no file " to the
basename.

In other words, one call to "cvs status" will not ask for two files
"blabla" (which does not yet exist) and "no file blabla" (which exists).

This patch makes cvsexportcommit slightly slower, when the list of changed
files has non-unique basenames, but at least it is accurate now.

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

Rename git-core rpm to just git and rename the meta... Kristian Høgsberg Mon, 18 Feb 2008 23:11:21 +0000 (18:11 -0500)

Rename git-core rpm to just git and rename the meta-pacakge to git-all.

This fixes my favorite annoyance with the git rpm packaging: don't pull
in tla when I say yum install git! You wouldn't expect yum install gcc
to pull in gcc-gfortran, right?

With this change, and blanket 'yum update' will automatically pull in the
new 'git' package and push out the old 'git-core', and if the old 'git'
package was installed 'git-all' will be pulled in instead. A couple of
things do break though: 'yum update git-core', because yum behaves
differently when given a specific package name - it doesn't follow obsoletes.

Instead, 'yum install git' will pull in the new git rpm, which will then
push out the old 'git-core'. Similarly, to get the newest version of
the meta package, 'yum install git-all' will install git-all, which then
pushes out the old 'git' meta package.

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Support a --cc=<email> option in format-patchDaniel Barkalow Tue, 19 Feb 2008 07:40:35 +0000 (02:40 -0500)

Support a --cc=<email> option in format-patch

When you have particular reviewers you want to sent particular series
to, it's nice to be able to generate the whole series with them as
additional recipients, without configuring them into your general
headers or adding them by hand afterwards.

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

Combine To: and Cc: headersDaniel Barkalow Tue, 19 Feb 2008 07:40:33 +0000 (02:40 -0500)

Combine To: and Cc: headers

RFC 2822 only permits a single To: header and a single Cc: header, so
we need to turn multiple values of each of these into a list. This
will be particularly significant with a command-line option to add Cc:
headers, where the user can't make sure to configure valid header sets
in any easy way.

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

Fix format.headers not ending with a newlineDaniel Barkalow Tue, 19 Feb 2008 07:40:31 +0000 (02:40 -0500)

Fix format.headers not ending with a newline

Now each value of format.headers will always be treated as a single
valid header, and newlines will be inserted between them as needed.

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

Add tests for extra headers in format-patchDaniel Barkalow Tue, 19 Feb 2008 07:40:28 +0000 (02:40 -0500)

Add tests for extra headers in format-patch

Presently, it works with each header ending with a newline, but not
without the newlines.

Also add a test to see that multiple "To:" headers get combined.

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

Add a --cover-letter option to format-patchDaniel Barkalow Tue, 19 Feb 2008 03:56:13 +0000 (22:56 -0500)

Add a --cover-letter option to format-patch

If --cover-letter is provided, generate a cover letter message before
the patches, numbered 0.

Original patch thanks to Johannes Schindelin

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

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>

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>

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