Code

git.git
16 years agoMerge branch 'db/push-single-with-HEAD'
Junio C Hamano [Wed, 27 Feb 2008 19:54:28 +0000 (11:54 -0800)]
Merge branch 'db/push-single-with-HEAD'

* db/push-single-with-HEAD:
  Resolve value supplied for no-colon push refspecs

16 years agoMerge branch 'db/host-alias'
Junio C Hamano [Wed, 27 Feb 2008 19:54:13 +0000 (11:54 -0800)]
Merge branch 'db/host-alias'

* db/host-alias:
  url rewriting: take longest and first match
  Add support for url aliases in config files
  Use ALLOC_GROW in remote.{c,h}

16 years agoMerge branch 'ae/pack-autothread'
Junio C Hamano [Wed, 27 Feb 2008 19:54:03 +0000 (11:54 -0800)]
Merge branch 'ae/pack-autothread'

* ae/pack-autothread:
  Revert "pack-objects: Print a message describing the number of threads for packing"
  pack-objects: Print a message describing the number of threads for packing
  pack-objects: Add runtime detection of online CPU's

16 years agoMerge branch 'bc/reflog-fix'
Junio C Hamano [Wed, 27 Feb 2008 19:53:48 +0000 (11:53 -0800)]
Merge branch 'bc/reflog-fix'

* bc/reflog-fix:
  builtin-reflog.c: don't install new reflog on write failure

16 years agoMerge branch 'sp/describe'
Junio C Hamano [Wed, 27 Feb 2008 19:52:20 +0000 (11:52 -0800)]
Merge branch 'sp/describe'

* sp/describe:
  Use git-describe --exact-match in bash prompt on detached HEAD
  Teach git-describe --exact-match to avoid expensive tag searches
  Avoid accessing non-tag refs in git-describe unless --all is requested
  Teach git-describe to use peeled ref information when scanning tags
  Optimize peel_ref for the current ref of a for_each_ref callback

16 years agoAdd '--fixed-strings' option to "git log --grep" and friends
Jakub Narebski [Tue, 26 Feb 2008 12:22:05 +0000 (13:22 +0100)]
Add '--fixed-strings' option to "git log --grep" and friends

Add support for -F | --fixed-strings option to "git log --grep"
and friends: "git log --author", "git log --committer=<pattern>".
Code is based on implementation of this option in "git grep".

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRevert "pack-objects: Print a message describing the number of threads for packing"
Junio C Hamano [Wed, 27 Feb 2008 07:27:31 +0000 (23:27 -0800)]
Revert "pack-objects: Print a message describing the number of threads for packing"

This reverts commit 6c723f5e6bc579e06a904874f1ceeb8ff2b5a17c.
The additional message may be interesting for git developers,
but not useful for the end users, and clutters the output.

16 years agogit-apply --whitespace=fix: fix off by one thinko
Junio C Hamano [Tue, 26 Feb 2008 20:24:40 +0000 (12:24 -0800)]
git-apply --whitespace=fix: fix off by one thinko

When a patch adds a whitespace followed by end-of-line, the
trailing whitespace error was detected correctly but was not
fixed, due to misconversion in 42ab241 (builtin-apply.c: do not
feed copy_wsfix() leading '+').

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Tue, 26 Feb 2008 08:14:22 +0000 (00:14 -0800)]
Merge branch 'maint'

* maint:
  Documentation/git-am.txt: Pass -r in the example invocation of rm -f .dotest
  timezone_names[]: fixed the tz offset for New Zealand.
  filter-branch documentation: non-zero exit status in command abort the filter
  rev-parse: fix potential bus error with --parseopt option spec handling
  Use a single implementation and API for copy_file()
  Documentation/git-filter-branch: add a new msg-filter example
  Correct fast-export file mode strings to match fast-import standard

16 years agogitweb: Better cutting matched string and its context
Jakub Narebski [Mon, 25 Feb 2008 20:07:57 +0000 (21:07 +0100)]
gitweb: Better cutting matched string and its context

Improve look of commit search output ('search' view) by better cutting
of matched string and its context in match info, as suggested by Junio.
For example, if you are looking for "very long search string" in the
following line:

    Could somebody test this with very long search string, and see how

you would now see:

    ...this with <<very long ... string>>, and see...

instead of:

    Could som... <<very long search...>>, and see...

(where <<something>> denotes emphasized / colored fragment; matched
fragment to be more exact).

For this feature, support for fourth [optional] parameter to chop_str
subroutine was added.  This fourth parameter is used to denote where
to cut string to make it shorter.  chop_str can now cut at the
beginning (from the _left_ side of the string), in the middle
(_center_ of the string), or at the end (from the _right_ side of
the string); cutting from right is the default:

  chop_str(somestring, len, slop, 'left')    ->  ' ...string'
  chop_str(somestring, len, slop, 'center')  ->  'som ... ing'
  chop_str(somestring, len, slop, 'right')   ->  'somestr... '

If you want to use default slop (default additional length), use undef
as value for third parameter to chop_str.

While at it, return from chop_str early if given string is so short
that chop_str couldn't shorten it.  Simplify also regexp used by
chop_str.  Make ellipsis (dots) stick to shortened fragment for
cutting at ends, to better see which part got shortened.

Simplify passing all arguments to chop_str in chop_and_escape_str
subroutine. This was needed to pass additional options to chop_str.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/git-am.txt: Pass -r in the example invocation of rm -f .dotest
Bryan Donlan [Mon, 25 Feb 2008 22:40:19 +0000 (17:40 -0500)]
Documentation/git-am.txt: Pass -r in the example invocation of rm -f .dotest

Signed-off-by: Bryan Donlan <bdonlan@fushizen.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agotimezone_names[]: fixed the tz offset for New Zealand.
Steven Drake [Tue, 26 Feb 2008 00:45:53 +0000 (13:45 +1300)]
timezone_names[]: fixed the tz offset for New Zealand.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofilter-branch documentation: non-zero exit status in command abort the filter
Caio Marcelo de Oliveira Filho [Tue, 26 Feb 2008 02:14:31 +0000 (23:14 -0300)]
filter-branch documentation: non-zero exit status in command abort the filter

Since commit 8c1ce0f46b85d40f215084eed7313896300082df filter-branch fails
when a <command> has a non-zero exit status. This commit makes it clear
in the documentation and also fixes the parent-filter example, that was
incorrectly returning non-zero when the commit being tested wasn't the
one to be rewritten.

Signed-off-by: Caio Marcelo de Oliveira Filho <cmarcelo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorev-parse: fix potential bus error with --parseopt option spec handling
Jay Soffian [Tue, 26 Feb 2008 04:07:39 +0000 (23:07 -0500)]
rev-parse: fix potential bus error with --parseopt option spec handling

A non-empty line containing no spaces should be treated by --parseopt as
an option group header, but was causing a bus error. Also added a test
script for rev-parse --parseopt.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd tests for filesystem challenges (case and unicode normalization)
Steffen Prohaska [Sun, 24 Feb 2008 17:19:09 +0000 (18:19 +0100)]
Add tests for filesystem challenges (case and unicode normalization)

Git has difficulties on file systems that do not properly
distinguish case or modify filenames in unexpected ways.  The two
major examples are Windows and Mac OS X.  Both systems preserve
case of file names but do not distinguish between filenames that
differ only by case.  Simple operations such as "git mv" or
"git merge" can fail unexpectedly.  In addition, Mac OS X normalizes
unicode, which make git's life even harder.

This commit adds tests that currently fail but should pass if
file system as decribed above are fully supported.  The test need
to be run on Windows and Mac X as they already pass on Linux.

Mitch Tishmack is the original author of the tests for unicode
normalization.

[jc: fixed-up so that it will use test_expect_success to test
on sanely behaving filesystems.]

Signed-off-by: Steffen Prohaska <prohaska@zib.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUse a single implementation and API for copy_file()
Daniel Barkalow [Mon, 25 Feb 2008 19:24:48 +0000 (14:24 -0500)]
Use a single implementation and API for copy_file()

Originally by Kristian Hï¿œgsberg; I fixed the conversion of rerere, which
had a different API.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/git-filter-branch: add a new msg-filter example
Miklos Vajna [Mon, 25 Feb 2008 14:43:53 +0000 (15:43 +0100)]
Documentation/git-filter-branch: add a new msg-filter example

There were no example on how to edit commit messages, so add an msg-filter
example.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agourl rewriting: take longest and first match
Junio C Hamano [Mon, 25 Feb 2008 06:25:04 +0000 (22:25 -0800)]
url rewriting: take longest and first match

Earlier we had a cop-out in the documentation to make the
behaviour "undefined" if configuration had more than one
insteadOf that would match the target URL, like this:

    [url "git://git.or.cz/"]
insteadOf = "git.or.cz:"       ; (1)
insteadOf = "repo.or.cz:"      ; (2)
    [url "/local/mirror/"]
insteadOf = "git.or.cz:myrepo" ; (3)
insteadOf = "repo.or.cz:"      ; (4)

It would be most natural to take the longest and first match, i.e.

 - rewrite "git.or.cz:frotz" to "git://git.or.cz/frotz" by using
   (1),

 - rewrite "git.or.cz:myrepo/xyzzy" to "/local/mirror/xyzzy" by favoring
   (3) over (1), and

 - rewrite "repo.or.cz:frotz" to "git://git.or.cz/frotz" by
   favoring (2) over (4).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoCorrect fast-export file mode strings to match fast-import standard
Shawn O. Pearce [Mon, 25 Feb 2008 03:57:29 +0000 (22:57 -0500)]
Correct fast-export file mode strings to match fast-import standard

The fast-import file format does not expect leading '0' in front
of a file mode; that is we want '100644' and '0100644'.

Thanks to Ian Clatworthy of the Bazaar project for noticing the
difference in output/input.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAdd support for url aliases in config files
Daniel Barkalow [Wed, 20 Feb 2008 18:43:53 +0000 (13:43 -0500)]
Add support for url aliases in config files

This allows users with different preferences for access methods to the
same remote repositories to rewrite each other's URLs by pattern
matching across a large set of similiarly set up repositories to each
get the desired access.

For example, if you don't have a kernel.org account, you might want
settings like:

[url "git://git.kernel.org/pub/"]
      insteadOf = master.kernel.org:/pub

Then, if you give git a URL like:

  master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-2.6.git

it will act like you gave it:

  git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-2.6.git

and you can cut-and-paste pull requests in email without fixing them
by hand, for example.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-bundle.txt: Add different strategies to create the bundle
Santi Béjar [Sun, 24 Feb 2008 13:42:40 +0000 (14:42 +0100)]
git-bundle.txt: Add different strategies to create the bundle

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-for-each-ref.c: fix typo in error message
Michele Ballabio [Sun, 24 Feb 2008 23:16:04 +0000 (00:16 +0100)]
builtin-for-each-ref.c: fix typo in error message

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosend-email: test compose functionality
Jeff King [Sun, 24 Feb 2008 21:04:14 +0000 (16:04 -0500)]
send-email: test compose functionality

This is just a basic sanity check that --compose works at
all.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot9001: enhance fake sendmail test harness
Jeff King [Sun, 24 Feb 2008 21:03:52 +0000 (16:03 -0500)]
t9001: enhance fake sendmail test harness

Previously, the fake.sendmail test harness would write its
output to a hardcoded file, allowing only a single message
to be tested. Instead, let's have it save the messages for
all of its invocations so that we can see which messages
were sent, and in which order.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'lt/dirstat'
Junio C Hamano [Mon, 25 Feb 2008 02:14:53 +0000 (18:14 -0800)]
Merge branch 'lt/dirstat'

* lt/dirstat:
  diff --dirstat: saner handling of binary and unmerged files
  Add "--dirstat" for some directory statistics

16 years agodiff --dirstat: saner handling of binary and unmerged files
Junio C Hamano [Mon, 25 Feb 2008 01:37:15 +0000 (17:37 -0800)]
diff --dirstat: saner handling of binary and unmerged files

We do not account binary nor unmerged files when --shortstat is
asked for (or the summary stat at the end of --stat).

The new option --dirstat should work the same way as it is about
summarizing the changes of multiple files by adding them up.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'jc/apply-whitespace'
Junio C Hamano [Mon, 25 Feb 2008 01:23:17 +0000 (17:23 -0800)]
Merge branch 'jc/apply-whitespace'

* jc/apply-whitespace:
  ws_fix_copy(): move the whitespace fixing function to ws.c
  apply: do not barf on patch with too large an offset
  core.whitespace: cr-at-eol
  git-apply --whitespace=fix: fix whitespace fuzz introduced by previous run
  builtin-apply.c: pass ws_rule down to match_fragment()
  builtin-apply.c: move copy_wsfix() function a bit higher.
  builtin-apply.c: do not feed copy_wsfix() leading '+'
  builtin-apply.c: simplify calling site to apply_line()
  builtin-apply.c: clean-up apply_one_fragment()
  builtin-apply.c: mark common context lines in lineinfo structure.
  builtin-apply.c: optimize match_beginning/end processing a bit.
  builtin-apply.c: make it more line oriented
  builtin-apply.c: push match-beginning/end logic down
  builtin-apply.c: restructure "offset" matching
  builtin-apply.c: refactor small part that matches context

16 years agoUse git-describe --exact-match in bash prompt on detached HEAD
Shawn O. Pearce [Sun, 24 Feb 2008 08:07:33 +0000 (03:07 -0500)]
Use git-describe --exact-match in bash prompt on detached HEAD

Most of the time when I am on a detached HEAD and I am not doing
a rebase or bisect operation the working directory is sitting on a
tagged release of the repository.  Showing the tag name instead of
the commit SHA-1 is much more descriptive and a much better reminder
of the state of this working directory.

Now that git-describe --exact-match is available as a cheap means
of obtaining the exact annotated tag or nothing at all, we can
favor the annotated tag name over the abbreviated commit SHA-1.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTeach git-describe --exact-match to avoid expensive tag searches
Shawn O. Pearce [Sun, 24 Feb 2008 08:07:31 +0000 (03:07 -0500)]
Teach git-describe --exact-match to avoid expensive tag searches

Sometimes scripts want (or need) the annotated tag name that exactly
matches a specific commit, or no tag at all.  In such cases it can be
difficult to determine if the output of `git describe $commit` is a
real tag name or a tag+abbreviated commit.  A common idiom is to run
git-describe twice:

  if test $(git describe $commit) = $(git describe --abbrev=0 $commit)
  ...

but this is a huge waste of time if the caller is just going to pick a
different method to describe $commit or abort because it is not exactly
an annotated tag.

Setting the maximum number of candidates to 0 allows the caller to ask
for only a tag that directly points at the supplied commit, or to have
git-describe abort if no such item exists.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoAvoid accessing non-tag refs in git-describe unless --all is requested
Shawn O. Pearce [Sun, 24 Feb 2008 08:07:28 +0000 (03:07 -0500)]
Avoid accessing non-tag refs in git-describe unless --all is requested

If we aren't going to use a ref there is no reason for us to open
its object from the object database.  This avoids opening any of
the head commits reachable from refs/heads/ unless they are also
reachable through the commit we have been asked to describe and
we need to walk through it to find a tag.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTeach git-describe to use peeled ref information when scanning tags
Shawn O. Pearce [Sun, 24 Feb 2008 08:07:25 +0000 (03:07 -0500)]
Teach git-describe to use peeled ref information when scanning tags

By using the peeled ref information inside of the packed-refs file we
can avoid opening tag objects to obtain the commits they reference.
This speeds up git-describe when there are a large number of tags
in the repository as we have less objects to parse before we can
start commit matching.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoOptimize peel_ref for the current ref of a for_each_ref callback
Shawn O. Pearce [Sun, 24 Feb 2008 08:07:22 +0000 (03:07 -0500)]
Optimize peel_ref for the current ref of a for_each_ref callback

Currently the only caller of peel_ref is show-ref, which is using
this function to show the peeled tag information if it is available
from an existing packed-refs file.  The call happens during the
for_each_ref callback function, so we have the proper struct ref_list
already on the call stack but it is not easily available to return
the peeled information to the caller.

We now save the current struct ref_list item before calling back
into the callback function so that future calls to peel_ref from
within the callback function can quickly access the current ref.
Doing so will save us an lstat() per ref processed as we no longer
have to check the filesystem to see if the ref exists as a loose
file or is packed.  This current ref caching also saves a linear
scan of the cached packed refs list.

As a micro-optimization we test the address of the passed ref name
against the current_ref->name before we go into the much more costly
strcmp().  Nearly any caller of peel_ref will be passing us the same
string do_for_each_ref passed them, which is current_ref->name.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint'
Junio C Hamano [Sun, 24 Feb 2008 18:01:19 +0000 (10:01 -0800)]
Merge branch 'maint'

* maint:
  Protect peel_ref fallback case from NULL parse_object result
  Ensure 'make dist' compiles git-archive.exe on Cygwin

16 years agoBe more verbose when checkout takes a long time
Linus Torvalds [Sat, 23 Feb 2008 21:36:08 +0000 (13:36 -0800)]
Be more verbose when checkout takes a long time

So I find it irritating when git thinks for a long time without telling me
what's taking so long. And by "long time" I definitely mean less than two
seconds, which is already way too long for me.

This hits me when doing a large pull and the checkout takes a long time,
or when just switching to another branch that is old and again checkout
takes a while.

Now, git read-tree already had support for the "-v" flag that does nice
updates about what's going on, but it was delayed by two seconds, and if
the thing had already done more than half by then it would be quiet even
after that, so in practice it meant that we migth be quiet for up to four
seconds. Much too long.

So this patch changes the timeout to just one second, which makes it much
more palatable to me.

The other thing this patch does is that "git checkout" now doesn't disable
the "-v" flag when doing its thing, and only disables the output when
given the -q flag.  When allowing "checkout -m" to fall back to a 3-way
merge, the users will see the error message from straight "checkout",
so we will tell them that we do fall back to make them look less scary.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoProtect peel_ref fallback case from NULL parse_object result
Shawn O. Pearce [Sun, 24 Feb 2008 08:07:19 +0000 (03:07 -0500)]
Protect peel_ref fallback case from NULL parse_object result

If the SHA-1 we are requesting the object for does not exist in
the object database we get a NULL back.  Accessing the type from
that is not likely to succeed on any system.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoEnsure 'make dist' compiles git-archive.exe on Cygwin
Shawn O. Pearce [Sun, 24 Feb 2008 05:38:04 +0000 (00:38 -0500)]
Ensure 'make dist' compiles git-archive.exe on Cygwin

On Cygwin we have to use git-archive.exe as the target, otherwise
running 'make dist' does not compile git-archive in the current
directory.  That may cause 'make dist' to fail on a clean source
tree that has never been built before.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agows_fix_copy(): move the whitespace fixing function to ws.c
Junio C Hamano [Sun, 24 Feb 2008 00:59:16 +0000 (16:59 -0800)]
ws_fix_copy(): move the whitespace fixing function to ws.c

This is used by git-apply but we can use it elsewhere by slightly
generalizing it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitweb: Fix bugs in git_search_grep_body: it's length(), not len()
Jakub Narebski [Sat, 23 Feb 2008 21:37:08 +0000 (22:37 +0100)]
gitweb: Fix bugs in git_search_grep_body: it's length(), not len()

Use int(<expr>/2) to get integer value for a substring length.

Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopack-objects: Print a message describing the number of threads for packing
Brandon Casey [Sat, 23 Feb 2008 02:12:58 +0000 (20:12 -0600)]
pack-objects: Print a message describing the number of threads for packing

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopack-objects: Add runtime detection of online CPU's
Andreas Ericsson [Sat, 23 Feb 2008 02:11:56 +0000 (20:11 -0600)]
pack-objects: Add runtime detection of online CPU's

Packing objects can be done in parallell nowadays, but it's
only done if the config option pack.threads is set to a value
above 1. Because of that, the code-path used is often not the
most optimal one.

This patch adds a routine to detect the number of online CPU's
at runtime (online_cpus()). When pack.threads (or --threads=) is
given a value of 0, the number of threads is set to the number of
online CPU's. This feature is also documented.

As per Nicolas Pitre's recommendations, the default is still to
run pack-objects single-threaded unless explicitly activated,
either by configuration or by command line parameter.

The routine online_cpus() is a rework of "numcpus.c", written by
one Philip Willoughby <pgw99@doc.ic.ac.uk>. numcpus.c is in the
public domain and can presently be downloaded from
http://csgsoft.doc.ic.ac.uk/numcpus/

Signed-off-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoSync with 1.5.4.3
Junio C Hamano [Sat, 23 Feb 2008 19:49:34 +0000 (11:49 -0800)]
Sync with 1.5.4.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoGIT 1.5.4.3 v1.5.4.3
Junio C Hamano [Sat, 23 Feb 2008 19:31:04 +0000 (11:31 -0800)]
GIT 1.5.4.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'maint' of git://repo.or.cz/git-gui into maint
Junio C Hamano [Sat, 23 Feb 2008 19:23:59 +0000 (11:23 -0800)]
Merge branch 'maint' of git://repo.or.cz/git-gui into maint

* 'maint' of git://repo.or.cz/git-gui:
  git-gui: Focus insertion point at end of strings in repository chooser
  git-gui: Avoid hardcoded Windows paths in Cygwin package files
  git-gui: Default TCL_PATH to same location as TCLTK_PATH
  git-gui: Paper bag fix error dialogs opening over the main window
  git-gui: Ensure error dialogs always appear over all other windows
  git-gui: relax "dirty" version detection
  git-gui: support Git Gui.app under OS X 10.5

16 years agobuiltin-reflog.c: don't install new reflog on write failure
Brandon Casey [Fri, 22 Feb 2008 18:47:08 +0000 (12:47 -0600)]
builtin-reflog.c: don't install new reflog on write failure

When expiring reflog entries, a new temporary log is written which contains
only the entries to retain. After it is written, it is renamed to replace
the existing reflog. Currently, we check that writing of the new log is
successful and print a message on failure, but the original reflog is still
replaced with the new reflog even on failure. This patch causes the
original reflog to be retained if we fail when writing the new reflog.

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agopull: pass --strategy along to to rebase
Jay Soffian [Sat, 23 Feb 2008 00:52:29 +0000 (19:52 -0500)]
pull: pass --strategy along to to rebase

rebase supports --strategy, so pull should pass the option along to it.

Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUse helper function for copying index entry information
Linus Torvalds [Sat, 23 Feb 2008 04:41:17 +0000 (20:41 -0800)]
Use helper function for copying index entry information

We used to just memcpy() the index entry when we copied the stat() and
SHA1 hash information, which worked well enough back when the index
entry was just an exact bit-for-bit representation of the information on
disk.

However, these days we actually have various management information in
the cache entry too, and we should be careful to not overwrite it when
we copy the stat information from another index entry.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoName hash fixups: export (and rename) remove_hash_entry
Linus Torvalds [Sat, 23 Feb 2008 04:39:21 +0000 (20:39 -0800)]
Name hash fixups: export (and rename) remove_hash_entry

This makes the name hash removal function (which really just sets the
bit that disables lookups of it) available to external routines, and
makes read_cache_unmerged() use it when it drops an unmerged entry from
the index.

It's renamed to remove_index_entry(), and we drop the (unused) 'istate'
argument.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix name re-hashing semantics
Linus 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>
16 years agoMerge 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

16 years agohash: fix lookup_hash semantics
Jeff 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>
16 years agogitweb: Better chopping in commit search results
Junio 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>
16 years agobuiltin-tag.c: remove cruft
Gerrit 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>
16 years agogit-merge-index documentation: clarify synopsis
Gerrit 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>
16 years agogit-gui: Focus insertion point at end of strings in repository chooser
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>
16 years agogit-gui: Avoid hardcoded Windows paths in Cygwin package files
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>
16 years agogit-gui: Default TCL_PATH to same location as TCLTK_PATH
Shawn 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>
16 years agogit-gui: Paper bag fix error dialogs opening over the main window
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>
16 years agosend-email: fix In-Reply-To regression
Jay 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>
16 years agogit-reset --hard and git-read-tree --reset: fix read_cache_unmerged()
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>
16 years agogit-gui: Ensure error dialogs always appear over all other windows
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>
16 years agoTeach git-grep --name-only as synonym for -l
Shawn 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>
16 years agodiff: fix java funcname pattern for solaris
Jeff 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>
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 agoResolve value supplied for no-colon push refspecs
Daniel 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>
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 agogit-gui: relax "dirty" version detection
Wincent 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>
16 years agoUse 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>
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>