Code

git.git
16 years agot3404: use configured shell instead of /bin/sh
Jeff 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>
16 years agogit_config_*: don't assume we are parsing a config file
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>
16 years agoprefix_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>
16 years agogit-clean: handle errors if removing files fails
Miklos 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>
16 years agoMerge 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

16 years agoMerge 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

16 years agoMerge 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

16 years agoMerge 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

16 years agoMerge 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

16 years agoMerge 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()

16 years agoMerge 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

16 years agoMerge 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()

16 years agoMerge 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 ""

16 years agoClarified the meaning of git-add -u in the documentation
Pekka 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>
16 years agogit-clone.sh: properly configure remote even if remote's head is dangling
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>
16 years agogit.el: Set process-environment instead of invoking env
David 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>
16 years agoDocumentation/git-stash: document options for git stash list
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>
16 years agosend-email: squelch warning due to comparing undefined $_ to ""
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>
16 years agoMerge 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

16 years agocvsexportcommit: be graceful when "cvs status" reorders the arguments
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>
16 years agoRename git-core rpm to just git and rename the meta-pacakge to git-all.
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>
16 years agoTechnical 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>
16 years agoCorrect git-pull documentation
Jay 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>
16 years agogitweb: Fix bug in href(..., -replay=>1) when using 'pathinfo' form
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>
16 years agopush: document the status output
Jeff 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>
16 years agoDocumentation/push: clarify matching refspec behavior
Jeff 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>
16 years agopush: indicate partialness of error message
Jeff 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>
16 years agoAPI documentation for remote.h
Daniel 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>
16 years agoSimplify setup of $GIT_DIR in git-sh-setup.sh
Lars 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>
16 years agoMerge 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

16 years agopeel_onion: handle NULL
Martin 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>
16 years agocheck return value from parse_commit() in various functions
Martin 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>
16 years agoparse_commit: don't fail, if object is NULL
Martin 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>
16 years agorevision.c: handle tag->tagged == NULL
Martin 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>
16 years agoreachable.c::process_tree/blob: check for NULL
Martin 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>
16 years agoprocess_tag: handle tag->tagged == NULL
Martin 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>
16 years agocheck results of parse_commit in merge_bases
Martin 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>
16 years agolist-objects.c::process_tree/blob: check for NULL
Martin 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>
16 years agoreachable.c::add_one_tree: handle NULL from lookup_tree
Martin 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>
16 years agomark_blob/tree_uninteresting: check for NULL
Martin 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>
16 years agoget_sha1_oneline: check return value of parse_object
Martin 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>
16 years agoread_object_with_reference: don't read beyond the buffer
Martin 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>
16 years agoAdd color.ui variable which globally enables colorization if set
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>
16 years agocheck return code of prepare_revision_walk
Martin 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>
16 years agoderef_tag: handle tag->tagged = NULL
Martin 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>
16 years agoderef_tag: handle return value NULL
Martin 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>
16 years agohelp.c: use 'git_config_string' to get 'help_default_format'.
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>
16 years agoMerge 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.

16 years agogitweb: Add new option -nohtml to quot_xxx subroutines
Jakub 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>
16 years agogitweb: Fix displaying unchopped argument in chop_and_escape_str
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>
16 years agobisect view: check for MinGW32 and MacOSX in addition to X11
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>
16 years agosending errors to stdout under $PAGER
Junio 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>
16 years agoSync with 1.5.4.2 and start 1.5.5 Release Notes
Junio 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>
16 years agoMerge 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

16 years agoGIT 1.5.4.2 v1.5.4.2
Junio 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>
16 years agoMerge 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

16 years agoMerge 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

16 years agoMerge 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

16 years agoMerge 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"

16 years agoMerge 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

16 years agoMerge 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

16 years agoMerge 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

16 years agoMerge git://repo.or.cz/git-gui
Junio 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

16 years agoMerge git://git.kernel.org/pub/scm/gitk/gitk
Junio 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

16 years agoMerge 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:

16 years agoDocumentation/SubmittingPatches - a suggested patch flow
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>
16 years agoDocumentation/git-reset: Add an example of resetting selected paths
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>
16 years agoDocumentation/git-reset: don't mention --mixed for selected-paths reset
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>
16 years agoDocumentation/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>
16 years agoadd--interactive: handle initial commit better
Jeff 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>
16 years agoUpdate fast-import documentation to discuss crash reports
Shawn 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>
16 years agoFinish current packfile during fast-import crash handler
Shawn 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>
16 years agoInclude the fast-import marks table in crash reports
Shawn 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>
16 years agoInclude annotated tags in fast-import crash reports
Shawn 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>
16 years agoDocumentation: add 'git-web--browse.txt' and simplify other docs.
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>
16 years agogit-help--browse: improve browser support under OS X
Jay 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>
16 years agoMerge 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

16 years agocommit: discard index after setting up partial commit
Jeff 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>
16 years agofilter-branch: handle filenames that need quoting
Junio 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>
16 years agohttp-push: avoid a needless goto
Johannes 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>
16 years agohttp-push: do not get confused by submodules
Johannes 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>
16 years agohttp-push: avoid invalid memory accesses
Johannes 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>
16 years agodiff: Fix miscounting of --check output
Junio 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>
16 years agohg-to-git: fix parent analysis
Stelian 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>
16 years agomailinfo: feed only one line to handle_filter() for QP input
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>
16 years agodiff.c: add "const" qualifier to "char *cmd" member of "struct ll_diff_driver"
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>
16 years agoAdd "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>
16 years agoAdd "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>
16 years agoAdd "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>
16 years agoconfig: add 'git_config_string' to refactor string config variables.
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>
16 years agodiff.c: remove useless check for value != NULL
Christian 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>
16 years agofast-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>
16 years agoValidate nicknames of remote branches to prohibit confusing ones
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>
16 years agodiff.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>
16 years agodiff.c: fixup garding of config parser from value=NULL
Junio 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>
16 years agogit-gui: Correct size of dictionary name widget in options dialog
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>
16 years agogit-gui: Paper bag fix bad string length call in spellchecker
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>
16 years agoAdd "--show-all" revision walker flag for debugging
Linus 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>
16 years ago[PATCH] gitk: Heed the lines of context in merge commits
Johannes 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>
16 years agoMerge 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"