git
16 years agofilter-branch: Documentation fix.
Florian Ragwitz [Wed, 30 Apr 2008 07:47:43 +0000 (09:47 +0200)] 
filter-branch: Documentation fix.

It's --msg-filter, not --message-filter.

Signed-off-by: Florian Ragwitz <rafl@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocvsimport: always pass user data to "system" as a list
Jeff King [Wed, 30 Apr 2008 04:36:14 +0000 (00:36 -0400)] 
cvsimport: always pass user data to "system" as a list

This avoids invoking the shell. Not only is it faster, but
it prevents the possibility of interpreting our arguments in
the shell.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agofix reflog approxidate parsing bug
Jeff King [Wed, 30 Apr 2008 04:13:58 +0000 (00:13 -0400)] 
fix reflog approxidate parsing bug

In get_sha1_basic, we parse a string like

  HEAD@{10 seconds ago}:path/to/file

into its constituent ref, reflog date, and path components.
We never actually munge the string itself, but instead keep
offsets into the string with their associated lengths.

When we call approxidate on the contents inside braces,
however, we pass just a string without a length. This means
that approxidate could sometimes look past the closing brace
and (erroneously) interpret the rest of the string as part
of the date.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoRemove 'header' from --signoff option description
Dan McGee [Sun, 27 Apr 2008 00:43:20 +0000 (19:43 -0500)] 
Remove 'header' from --signoff option description

Signed-off-by: Dan McGee <dpmcgee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot5516: remove ambiguity test (1)
Jeff King [Wed, 23 Apr 2008 09:21:45 +0000 (05:21 -0400)] 
t5516: remove ambiguity test (1)

This test tried to push into a remote with ambiguous refs in
remotes/$x/master and remotes/$y/master. However, the remote
never actually tells us about the refs/remotes hierarchy, so
we don't even see this ambiguity.

The test happened to pass because we were simply looking for
failure, and the test fails for another reason: the dst
refspec does not exist and does not begin with refs/, making
it invalid.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoLinked glossary from cvs-migration page
Matt Graham [Wed, 23 Apr 2008 13:13:51 +0000 (09:13 -0400)] 
Linked glossary from cvs-migration page

Coming from CVS, I found the git glossary vital to learning git and learning
how terms in git correlate to the cvs terminology with which I am familiar.

This patch links the glossary from the cvs-migration page so cvs users will
be able to fine the glossary as soon as they start looking at git documents.

Signed-off-by: Matt Graham <mdg149@gmail.com>
Acked-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agowrite-tree: properly detect failure to write tree objects
Junio C Hamano [Wed, 23 Apr 2008 16:47:17 +0000 (09:47 -0700)] 
write-tree: properly detect failure to write tree objects

Tomasz Fortuna reported that "git commit" does not error out properly when
it cannot write tree objects out.  "git write-tree" shares the same issue,
as the failure to notice the error is deep in the logic to write tree
objects out recursively.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agosvn-git: Use binmode for reading/writing binary rev maps
Michael Weber [Fri, 18 Apr 2008 13:12:04 +0000 (15:12 +0200)] 
svn-git: Use binmode for reading/writing binary rev maps

Otherwise, there is a possible interaction with UTF-8 locales in
combination with PERL_UNICODE, resulting in "inconsistent size: 40" or
"read:"-type errors.

See also:
    perldoc -f binmode
    <http://perldoc.perl.org/perl581delta.html#UTF-8-no-longer-default-under-UTF-8-locales>

Signed-off-by: Michael Weber <michaelw@foldr.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agodiff options documentation: refer to --diff-filter in --name-status
Miklos Vajna [Tue, 22 Apr 2008 12:23:48 +0000 (14:23 +0200)] 
diff options documentation: refer to --diff-filter in --name-status

git diff --name-status outputs letters, but the meaning of those letters
is documented elsewhere. Add a note to make the manpage more intuitive.

Signed-off-by: Miklos Vajna <vmiklos@frugalware.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn bug with blank commits and author file
Thomas Guyot-Sionnest [Tue, 22 Apr 2008 10:07:47 +0000 (06:07 -0400)] 
git-svn bug with blank commits and author file

When trying to import from svn using an author file, git-svn bails out
if it encounters a blank author. The attached patch changes this
behavior and allow using the author file with blanks authors.

I came across this bug while importing from a cvs2svn repo where the
initial revision (1) has a blank author. This doesn't break the behavior
of bailing out when an unknown author is encountered.

Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoarchive.c: format_subst - fixed bogus argument to memchr
Ariel Badichi [Wed, 23 Apr 2008 01:06:27 +0000 (04:06 +0300)] 
archive.c: format_subst - fixed bogus argument to memchr

Also removed a superfluous test.

Signed-off-by: Ariel Badichi <abadichi@bezeqint.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocopy.c: copy_fd - correctly report write errors
Ariel Badichi [Wed, 23 Apr 2008 01:05:29 +0000 (04:05 +0300)] 
copy.c: copy_fd - correctly report write errors

Previously, the errno could have been lost due to an intervening
close() call.

This patch also contains minor cosmetic changes.

Signed-off-by: Ariel Badichi <abadichi@bezeqint.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogitattributes: Fix subdirectory attributes specified from root directory
Matthew Ogilvie [Tue, 22 Apr 2008 18:19:12 +0000 (12:19 -0600)] 
gitattributes: Fix subdirectory attributes specified from root directory

Signed-off-by: Matthew Ogilvie <mmogilvi_git@miniinfo.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoam: POSIX portability fix
Junio C Hamano [Fri, 18 Apr 2008 23:11:40 +0000 (16:11 -0700)] 
am: POSIX portability fix

POSIX allows echo without flag to interpret specials such as \n, and we
tried to make things portable by using printf instead where it matters.
Recently added code to "git am" had unprotected "echo", which was caught
by t4014 and Rémi Vanicat.

This should fix it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-am: minor cleanup
Junio C Hamano [Wed, 16 Apr 2008 23:46:26 +0000 (16:46 -0700)] 
git-am: minor cleanup

This moves the assignment to FIRSTLINE down so that we do not have
to have multiple copies.

Suggested by Linus.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoClarify and fix English in "git-rm" documentation
Jon Loeliger [Wed, 16 Apr 2008 23:41:27 +0000 (18:41 -0500)] 
Clarify and fix English in "git-rm" documentation

Do some verb-noun agreement changes.
Clarify some file globbing cases.
Fixed a wrong statement in an example.

Signed-off-by: Jon Loeliger <jdl@jdl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-bisect: make "start", "good" and "skip" succeed or fail atomically
Christian Couder [Mon, 14 Apr 2008 03:41:45 +0000 (05:41 +0200)] 
git-bisect: make "start", "good" and "skip" succeed or fail atomically

Before this patch, when "git bisect start", "git bisect good" or
"git bisect skip" were called with many revisions, they could fail
after having already marked some revisions as "good", "bad" or
"skip".

This could be especilally bad for "git bisect start" because as
the file ".git/BISECT_NAMES" would not have been written, there
would have been no attempt to clear the marked revisions on a
"git bisect reset". That's because if there is no
".git/BISECT_NAMES" file, nothing is done to clean things up, as
the bisect session is not supposed to have started.

While at it, let's also create the ".git/BISECT_START" file, only
after ".git/BISECT_NAMES" as been created.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-am: cope better with an empty Subject: line
Linus Torvalds [Tue, 15 Apr 2008 19:56:50 +0000 (12:56 -0700)] 
git-am: cope better with an empty Subject: line

When the Subject: line is empty for whatever reason, git-am was fooled by
it and left an empty line at the beginning of the resulting commit log
message.

This moves the logic around so that we do not keep $SUBJECT in a separate
variable.  Instead, $dotest/msg-clean, which used to be the log message
body extracted from the message and then trailing whitespaces cleansed
out, now contains the subject line followed by a blank line at the
beginning for normal messages, and we use the first line from the file as
the summary line throughout the program.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoIgnore leading empty lines while summarizing merges
Linus Torvalds [Tue, 15 Apr 2008 18:01:36 +0000 (11:01 -0700)] 
Ignore leading empty lines while summarizing merges

"git log" and friends normally skip the initial empty lines when showing
one-line summary of a commit, but merge summary didn't.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
----
 builtin-fmt-merge-msg.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobisect: squelch "fatal: ref HEAD not a symref" misleading message
Christian Couder [Wed, 16 Apr 2008 02:09:49 +0000 (04:09 +0200)] 
bisect: squelch "fatal: ref HEAD not a symref" misleading message

To get the current HEAD when we start bisecting using for example
"git bisect start", we first try "git symbolic-ref HEAD" to get a
nice name, and if it fails, we fall back to "git rev-parse
--verify HEAD".

The problem is that when "git symbolic-ref HEAD" fails, it
displays "fatal: ref HEAD not a symref", so it looks like "git
bisect start" failed and does not accept detached HEAD, even if
in fact it worked fine.

This patch adds "-q" option to the "git symbolic-ref" call to
get rid of the misleading error message.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobuiltin-apply: Show a more descriptive error on failure when opening a patch
Alberto Bertogli [Mon, 14 Apr 2008 15:30:27 +0000 (12:30 -0300)] 
builtin-apply: Show a more descriptive error on failure when opening a patch

When a patch can't be opened (it doesn't exist, there are permission
problems, etc.) we get the usage text, which is not a proper indication of
failure.

Signed-off-by: Alberto Bertogli <albertito@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoClarify documentation of git-cvsserver, particularly in relation to git-shell
Scott Collins [Tue, 15 Apr 2008 21:44:43 +0000 (17:44 -0400)] 
Clarify documentation of git-cvsserver, particularly in relation to git-shell

For SSH clients restricted to git-shell, CVS_SERVER does not have to be
specified, because git-shell understands the default value of 'cvs' to
mean git-cvsserver'. This makes it totally transparent to CVS users, but
the instruction to set up CVS access for people with real shell access
does not apply.

Previous wording mentioning GIT_AUTHOR, GIT_COMMITTER variables was
unclear that we really meant GIT_AUTHOR_(NAME|EMAIL), etc.

Note that the .ssh/environment file is a good place to set these, and that
the .bashrc is shell-specific. Add a bit of text to differentiate cvs -d
(setting CVSROOT) from cvs co -d (setting the name of the newly checked
out directory).  Removed an extra 'Example:' string.

Signed-off-by: Scott Collins <scc@ScottCollins.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocs gitk: Explicitly mention the files that gitk uses (~/.gitk)
Clifford Caoile [Sat, 12 Apr 2008 09:50:20 +0000 (18:50 +0900)] 
Docs gitk: Explicitly mention the files that gitk uses (~/.gitk)

gitk creates and uses ~/.gitk

Signed-off-by: Clifford Caoile <piyo@users.sourceforge.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocument -w option to shortlog
Junio C Hamano [Sat, 12 Apr 2008 22:38:20 +0000 (15:38 -0700)] 
Document -w option to shortlog

Noticed by Fredrik Noring.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobisect: report bad rev better
Christian Couder [Sat, 12 Apr 2008 09:17:36 +0000 (02:17 -0700)] 
bisect: report bad rev better

The previous one overwrote the variable used to report the bad input
when the input is actually bad, and we did not give a useful enough
information.  This corrects it.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agobisect: fix bad rev checking in "git bisect good"
Christian Couder [Sat, 12 Apr 2008 05:53:59 +0000 (07:53 +0200)] 
bisect: fix bad rev checking in "git bisect good"

It seems that "git bisect good" and "git bisect skip" have never
properly checked arguments that have been passed to them. As soon
as one of them can be parsed as a SHA1, no error or warning would
be given.

This is because 'git rev-parse --revs-only --no-flags "$@"' always
"exit 0" and outputs all the SHA1 it can found from parsing "$@".

This patch fix this by using, for each "bisect good" argument, the
same logic as for the "bisect bad" argument.

While at it, this patch teaches "bisect bad" to give a meaningfull
error message when it is passed more than one argument.

Note that if "git bisect good" or "git bisect skip" is given some
proper revs and then something that is not a proper rev, then the
first proper revs will still have been marked as "good" or "skip".

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorevision.c: make --date-order overriddable
Michele Ballabio [Thu, 10 Apr 2008 20:06:52 +0000 (22:06 +0200)] 
revision.c: make --date-order overriddable

Jan Engelhardt noticed that while --topo-order can be overridden by a
subsequent --date-order, the reverse was not possible. That's because
setup_revisions() failed to set revs->lifo properly.

Signed-off-by: Michele Ballabio <barra_cuda@katamail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix section about backdating tags in the git-tag docs
Björn Steinbrink [Fri, 11 Apr 2008 20:52:07 +0000 (22:52 +0200)] 
Fix section about backdating tags in the git-tag docs

The tagger is equal to the committer, not the author, so
GIT_COMMITTER_DATE is the right environment variable to use, not
GIT_AUTHOR_DATE.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocument option --only of git commit
Johannes Sixt [Thu, 10 Apr 2008 11:33:09 +0000 (13:33 +0200)] 
Document option --only of git commit

Its documentation was removed by 6c96753 (Documentation/git-commit: rewrite
to make it more end-user friendly, 2006-12-08), even though it is referenced
from a few places, including builtin-commit.c (as part of the commentary in
the commit message template).

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation/git-request-pull: Fixed a typo ("send" -> "end")
Dirk Suesserott [Wed, 9 Apr 2008 20:20:10 +0000 (22:20 +0200)] 
Documentation/git-request-pull: Fixed a typo ("send" -> "end")

Signed-off-by: Dirk Suesserott <newsletter@dirk.my1.cc>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agocore-tutorial.txt: Fix showing the current behaviour.
Carlos Rica [Thu, 10 Apr 2008 00:08:23 +0000 (02:08 +0200)] 
core-tutorial.txt: Fix showing the current behaviour.

The --root option from "git diff-tree" won't do nothing
when is given to commands like git-whatchanged or git-log,
because those always print the initial commit by default.

This fixes the tutorial explaining the function of the
log.showroot configuration variable.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-archive: ignore prefix when checking file attribute
René Scharfe [Wed, 9 Apr 2008 21:14:43 +0000 (23:14 +0200)] 
git-archive: ignore prefix when checking file attribute

Ulrik Sverdrup noticed that git-archive doesn't correctly apply the attribute
export-subst when the option --prefix is given, too.

When it checked if a file has the attribute turned on, git-archive would try
to look up the full path -- including the prefix -- in .gitattributes.  That's
wrong, as the prefix doesn't need to have any relation to any existing
directories, tracked or not.

This patch makes git-archive ignore the prefix when looking up if value of the
attribute export-subst for a file.

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix documentation syntax of optional arguments in short options.
Carlos Rica [Wed, 9 Apr 2008 11:07:14 +0000 (13:07 +0200)] 
Fix documentation syntax of optional arguments in short options.

When an argument for an option is optional, like in -n from git-tag,
puting a space between the option and the argument is interpreted
as a missing argument for the option plus an isolated argument.
Documentation now reflects the need to write the parameter following
the option -n, as in "git tag -nARG", for instance.

Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix "git apply" to correctly enforce "match at the beginning"
Junio C Hamano [Mon, 7 Apr 2008 02:21:45 +0000 (19:21 -0700)] 
Fix "git apply" to correctly enforce "match at the beginning"

An earlier commit 4be6096 (apply --unidiff-zero: loosen sanity checks for
--unidiff=0 patches, 2006-09-17) made match_beginning and match_end
computed incorrectly.  If a hunk inserts at the beginning, old position
recorded at the hunk is line 0, and if a hunk changes at the beginning, it
is line 1.  The new test added to t4104 exposes that the old code did not
insist on matching at the beginning for a patch to add a line to an empty
file.

An even older 65aadb9 (apply: force matching at the beginning.,
2006-05-24) was equally wrong in that it tried to take hints from the
number of leading context lines, to decide if the hunk must match at the
beginning, but we can just look at the line number in the hunk to decide.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoGIT 1.5.4.5 v1.5.4.5
Junio C Hamano [Fri, 28 Mar 2008 03:36:35 +0000 (20:36 -0700)] 
GIT 1.5.4.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUpdate draft release notes for 1.5.4.5
Junio C Hamano [Thu, 27 Mar 2008 20:14:20 +0000 (13:14 -0700)] 
Update draft release notes for 1.5.4.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'jc/maint-fetch-regression-1.5.4' into maint
Junio C Hamano [Thu, 27 Mar 2008 20:03:56 +0000 (13:03 -0700)] 
Merge branch 'jc/maint-fetch-regression-1.5.4' into maint

* jc/maint-fetch-regression-1.5.4:
  git-fetch test: test tracking fetch results, not just FETCH_HEAD
  Fix branches file configuration
  Tighten refspec processing

16 years agoDocumentation: clarify use of .git{ignore,attributes} versus .git/info/*
Jeff King [Thu, 27 Mar 2008 05:31:00 +0000 (01:31 -0400)] 
Documentation: clarify use of .git{ignore,attributes} versus .git/info/*

gitignore patterns can be read from three different
files, while gitattributes can come from two files. Let's
provide some hints to the user about the differences and how
they are typically used.

Suggested by Toby Corkindale, but gratuitously reworded by Jeff King.

Signed-off-by: Toby Corkindale <toby.corkindale@rea-group.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot/t3800-mktag.sh: use test_must_fail rather than '!'
Brandon Casey [Wed, 26 Mar 2008 00:20:52 +0000 (19:20 -0500)] 
t/t3800-mktag.sh: use test_must_fail rather than '!'

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-fetch test: test tracking fetch results, not just FETCH_HEAD
Junio C Hamano [Wed, 26 Mar 2008 08:17:07 +0000 (01:17 -0700)] 
git-fetch test: test tracking fetch results, not just FETCH_HEAD

We really should have done this long time ago.  Existing t5515 test
was written for the specific purpose of catching regression to the
contents of generated FETCH_HEAD file, but it also is a good place
to make sure various fetch configurations do fetch what they intend
to fetch (and nothing else).

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix branches file configuration
Daniel Barkalow [Tue, 25 Mar 2008 23:35:28 +0000 (19:35 -0400)] 
Fix branches file configuration

Fetched remote branch from .git/branches/foo should fetch into
refs/heads/foo.  Also when partial URL is given, the fetched head should
always be remote HEAD, and the result should not be stored anywhere.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoTighten refspec processing
Daniel Barkalow [Tue, 18 Mar 2008 02:05:23 +0000 (22:05 -0400)] 
Tighten refspec processing

This changes the pattern matching code to not store the required final
/ before the *, and then to require each side to be a valid ref (or
empty). In particular, any refspec that looks like it should be a
pattern but doesn't quite meet the requirements will be found to be
invalid as a fallback non-pattern.

This was cherry picked from commit ef00d15 (Tighten refspec processing,
2008-03-17), and two fix-up commits 46220ca (remote.c: Fix overtight
refspec validation, 2008-03-20) and 7d19da4 (refspec: allow colon-less
wildcard "refs/category/*", 2008-03-25) squashed in.

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix the wrong output of `git-show v1.3.0~155^2~4` in documentation.
Guanqun Lu [Mon, 24 Mar 2008 07:27:28 +0000 (15:27 +0800)] 
Fix the wrong output of `git-show v1.3.0~155^2~4` in documentation.

Texts between ~ and ~ will be subscripted during the asciidoc translation.

Signed-off-by: Guanqun Lu <Guanqun.Lu@Gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
(cherry picked from commit 0c829391cfcdc57172765322575804a7ad5f3116)

16 years agoStart draft ReleaseNotes for 1.5.4.5
Junio C Hamano [Sun, 16 Mar 2008 06:29:28 +0000 (23:29 -0700)] 
Start draft ReleaseNotes for 1.5.4.5

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorebase -m: do not trigger pre-commit verification
Junio C Hamano [Sun, 16 Mar 2008 07:50:22 +0000 (00:50 -0700)] 
rebase -m: do not trigger pre-commit verification

When rebasing changes that contain issues that the pre-commit hook flags
as problematic, the rebase cannot be continued.  However, rebase is about
transplanting commits that are already made with as little distortion as
possible, and pre-commit check should not interfere.

Earlier, c5b09fe (Avoid update hook during git-rebase --interactive,
2007-12-19) fixed "rebase -i", but "rebase -m" shared the same issue.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoformat-patch: generate MIME header as needed even when there is format.header
Junio C Hamano [Sat, 15 Mar 2008 00:10:09 +0000 (17:10 -0700)] 
format-patch: generate MIME header as needed even when there is format.header

Earlier, the callchain from pretty_print_commit() down to pp_title_line()
had an unwarranted assumption that the presense of "after_subject"
parameter, means the caller has already output MIME headers for
attachments.  The parameter's primary purpose is to give extra header
lines the caller wants to place after pp_title_line() generates the
"Subject: " line.

This assumption does not hold when the user used the format.header
configuration variable to pass extra headers, and caused a message with
non-ASCII character to lack proper MIME headers (e.g.  8-bit CTE header).
The earlier logic also failed to suppress duplicated MIME headers when
"format-patch -s --attach" is asked for and the signer's name demanded
8-bit clean transport.

This patch fixes the logic by introducing a separate need_8bit_cte
parameter passed down the callchain.  This can have one of these values:

 -1 : we've already done MIME crap and we do not want to add extra header
      to say this is 8bit in pp_title_line();

  0 : we haven't done MIME and we have not seen anything that is 8bit yet;

  1 : we haven't done MIME and we have seen something that is 8bit;
      pp_title_line() must add MIME header.

It adds two tests by Jeff King who independently diagnosed this issue.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMake man page building quiet when DOCBOOK_XSL_172 is defined
Jonas Fonseca [Fri, 14 Mar 2008 21:38:18 +0000 (22:38 +0100)] 
Make man page building quiet when DOCBOOK_XSL_172 is defined

Tell xmlto to repress printing of the lines:

Note: meta date   : No date. Using generated date       git-xyx
Note: Writing git-xyz.1

Signed-off-by: Jonas Fonseca <fonseca@diku.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-new-workdir: Share SVN meta data between work dirs and the repository
Bernt Hansen [Sat, 15 Mar 2008 02:44:13 +0000 (22:44 -0400)] 
git-new-workdir: Share SVN meta data between work dirs and the repository

Multiple work dirs with git svn caused each work dir to have its own
stale copy of the SVN meta data in .git/svn

git svn rebase updates commits with git-svn-id: in the repository and
stores the SVN meta data information only in that work dir.  Attempting to
git svn rebase in other work dirs for the same branch would fail because
the last revision fetched according to the git-svn-id is greater than the
revision in the SVN meta data for that work directory.

Signed-off-by: Bernt Hansen <bernt@norang.ca>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorev-parse: fix meaning of rev~ vs rev~0.
Linus Torvalds [Fri, 14 Mar 2008 18:49:40 +0000 (11:49 -0700)] 
rev-parse: fix meaning of rev~ vs rev~0.

I think it would make more sense for rev~ to have the same guarantees that
rev^ has, namely to always return a commit. I would also suggest that not
giving a number would have the same effect of defaulting to 1, not 0.

Right now it's a bit illogical, but at least it's an _undocumented_
illogical behaviour.

This patch makes '^' and '~' act the same for the default count (i.e. both
default to 1), and also have the same behaviour for a count of zero.

Before (no discernible pattern):

[torvalds@woody git]$ git rev-parse v1.5.1 v1.5.1^0 v1.5.1~0 v1.5.1^ v1.5.1~
45354a57ee7e3e42c7137db6c94fa968c6babe8d
89815cab95268e8f0f58142b848ac4cd5e9cbdcb
45354a57ee7e3e42c7137db6c94fa968c6babe8d
045f5759c97746589a067461e50fad16f60711ac
45354a57ee7e3e42c7137db6c94fa968c6babe8d

After (fairly logical):

[torvalds@woody git]$ git rev-parse v1.5.1 v1.5.1^0 v1.5.1~0 v1.5.1^ v1.5.1~
45354a57ee7e3e42c7137db6c94fa968c6babe8d
89815cab95268e8f0f58142b848ac4cd5e9cbdcb
89815cab95268e8f0f58142b848ac4cd5e9cbdcb
045f5759c97746589a067461e50fad16f60711ac
045f5759c97746589a067461e50fad16f60711ac

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-svn: don't blindly append '*' to branch/tags config
Eric Wong [Fri, 14 Mar 2008 18:01:23 +0000 (11:01 -0700)] 
git-svn: don't blindly append '*' to branch/tags config

Previously, git-svn would blindly append '*' even if it was specified by
the user during initialization (for certain SVN setups, it is
necessary).

Now, the following command will work correctly:

  git svn init -T trunk/docutils \
               -t 'tags/*/docutils' \
               -b 'branches/*/docutils' \
               svn://svn.berlios.de/docutils

Thanks to martin f krafft for the bug report:
> My git-svn target configuration is
>
>   [svn-remote "svn"]
>     url = svn://svn.berlios.de/docutils
>     fetch = trunk/docutils:refs/remotes/trunk
>     branches = branches/*/docutils:refs/remotes/*
>     tags = tags/*/docutils:refs/remotes/tags/*
>
> Unfortunately, when I run
>
>   git-svn init -T trunk/docutils -t 'tags/*/docutils'
>    -b 'branches/*/docutils'
>
> then I get (note the two asterisks on the left hand side):
>
>     branches = branches/*/docutils/*:refs/remotes/*
>     tags = tags/*/docutils/*:refs/remotes/tags/*
>
> I took a brief stab at the code but I can't even figure out where
> the /* is appended, so I defer to you.
>
> It should be trivial to keep git-svn from appending /* if the left
> side already contains an asterisk.

Signed-off-by: Eric Wong <normalperson@yhbt.net>
Tested-by: martin f krafft <madduck@madduck.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'ph/maint-quiltimport' into maint
Junio C Hamano [Fri, 14 Mar 2008 07:16:26 +0000 (00:16 -0700)] 
Merge branch 'ph/maint-quiltimport' into maint

* ph/maint-quiltimport:
  quiltimport: fix misquoting of parsed -p<num> parameter
  git-quiltimport: better parser to grok "enhanced" series files.

16 years agomerge-file: handle empty files gracefully
Johannes Schindelin [Thu, 13 Mar 2008 15:19:35 +0000 (16:19 +0100)] 
merge-file: handle empty files gracefully

Earlier, it would error out while trying to read and/or writing them.
Now, calling merge-file with empty files is neither interesting nor
useful, but it is a bug that needed fixing.

Noticed by Clemens Buchacher.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
16 years agomerge-recursive: handle file mode changes
Clemens Buchacher [Thu, 13 Mar 2008 22:47:41 +0000 (23:47 +0100)] 
merge-recursive: handle file mode changes

File mode changes should be handled similarly to changes of content.
That is, if the file mode changed in only one branch, keep the changed
version, and if both branch changed to different mode, mark it as a
conflict.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMinor wording changes in the keyboard descriptions in git-add --interactive.
Vineet Kumar [Thu, 13 Mar 2008 18:32:16 +0000 (11:32 -0700)] 
Minor wording changes in the keyboard descriptions in git-add --interactive.

The wording of the interactive help text from git-add--interactive.perl is
clearer.  Just duplicate that text here.

Signed-off-by: Vineet Kumar <vineet@doorstop.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit fetch: Take '-n' to mean '--no-tags'
Johannes Schindelin [Thu, 13 Mar 2008 07:13:15 +0000 (08:13 +0100)] 
git fetch: Take '-n' to mean '--no-tags'

Prior to commit 8320199 (Rewrite builtin-fetch option parsing to use
parse_options().), we understood '-n' as a short option to mean "don't
fetch tags from the remote". This patch reinstates behaviour similar,
but not identical to the pre commit 8320199 times.

Back then, -n always overrode --tags, so if both --tags and -n was
given on command-line, no tags were fetched regardless of argument
ordering. Now we use a "last entry wins" strategy, so '-n --tags'
means "fetch tags".

Since it's patently absurd to say both --tags and --no-tags, this
shouldn't matter in practice.

Spotted-by: Artem Zolochevskiy <azol@altlinux.org>
Reported-by: Dmitry V. Levin <ldv@altlinux.org>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Tested-by: Andreas Ericsson <ae@op5.se>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoquiltimport: fix misquoting of parsed -p<num> parameter
Junio C Hamano [Thu, 13 Mar 2008 04:07:19 +0000 (21:07 -0700)] 
quiltimport: fix misquoting of parsed -p<num> parameter

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-cvsimport: fix merging with remote parent branch
Marc-Andre Lureau [Wed, 12 Mar 2008 19:54:21 +0000 (21:54 +0200)] 
git-cvsimport: fix merging with remote parent branch

commit-tree fails when specifying a remote name (via -r option) and
one of the parent branch has a name. Prefixing with "$remote/" fix it.

Signed-off-by: Marc-Andre Lureau <marcandre.lureau@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 agogit-svn: fix find-rev error message when missing arg
Marc-Andre Lureau [Tue, 11 Mar 2008 08:00:45 +0000 (10:00 +0200)] 
git-svn: fix find-rev error message when missing arg

Just let the user know that a revision argument is missing instead of
a perl error. This error message mimic the "init" error message, but
could be improved.

Signed-off-by: Marc-Andre Lureau <marcandre.lureau@gmail.com>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agot0021: tr portability fix for Solaris
Jeff King [Tue, 11 Mar 2008 17:40:45 +0000 (13:40 -0400)] 
t0021: tr portability fix for Solaris

Solaris' /usr/bin/tr doesn't seem to like multiple character
ranges in brackets (it simply prints "Bad string").

Instead, let's just enumerate the transformation we want.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agolaunch_editor(): allow spaces in the filename
Johannes Schindelin [Tue, 11 Mar 2008 09:56:30 +0000 (10:56 +0100)] 
launch_editor(): allow spaces in the filename

The construct

sh -c "$0 \"$@\"" <editor> <file>

does not pick up quotes in <editor>, so you cannot give path to the
editor that has a shell IFS whitespace in it, and also give it initial
set of parameters and flags.  Replace $0 with <editor> to fix this issue.

This fixes

git config core.editor '"c:/Program Files/What/Ever.exe"'

In other words, you can specify an editor with spaces in its path using a
config containing something like this:

[core]
editor = \"c:/Program Files/Darn/Spaces.exe\"

NOTE: we cannot just replace the $0 with \"$0\", because we still want
this to work:

[core]
editor = emacs -nw

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit rebase --abort: always restore the right commit
Mike Hommey [Sat, 1 Mar 2008 10:32:14 +0000 (11:32 +0100)] 
git rebase --abort: always restore the right commit

Previously, --abort would end by git resetting to ORIG_HEAD, but some
commands, such as git reset --hard (which happened in git rebase --skip,
but could just as well be typed by the user), would have already modified
ORIG_HEAD.

Just use the orig-head we store in $dotest instead.

[jc: cherry-picked from 48411d and 4947cf9 on 'master']

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'kb/maint-filter-branch-disappear' into maint
Junio C Hamano [Tue, 11 Mar 2008 07:38:29 +0000 (00:38 -0700)] 
Merge branch 'kb/maint-filter-branch-disappear' into maint

* kb/maint-filter-branch-disappear:
  filter-branch: handle "disappearing tree" case correctly in subdir filter

16 years agoMerge branch 'aw/maint-shortlog-blank-lines' into maint
Junio C Hamano [Tue, 11 Mar 2008 07:37:38 +0000 (00:37 -0700)] 
Merge branch 'aw/maint-shortlog-blank-lines' into maint

* aw/maint-shortlog-blank-lines:
  shortlog: take the first populated line of the description

16 years agogit-pull documentation: warn about the option order
Junio C Hamano [Mon, 10 Mar 2008 08:22:03 +0000 (01:22 -0700)] 
git-pull documentation: warn about the option order

We might eventually be loosening this rule, but there is a longstanding
restriction that the users currently need to be aware of.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-quiltimport: better parser to grok "enhanced" series files.
Pierre Habouzit [Sat, 8 Mar 2008 18:27:09 +0000 (19:27 +0100)] 
git-quiltimport: better parser to grok "enhanced" series files.

The previous parser wasn't able to grok:

 * empty lines;
 * annotated patch levels (trailing -pNNN annotations);
 * trailing comments.

Now it understands them and uses the patch level hints as a git apply
argument.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoGIT 1.5.4.4 v1.5.4.4
Junio C Hamano [Sun, 9 Mar 2008 03:34:47 +0000 (19:34 -0800)] 
GIT 1.5.4.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoident.c: reword error message when the user name cannot be determined
Santi Béjar [Sat, 8 Mar 2008 11:30:04 +0000 (12:30 +0100)] 
ident.c: reword error message when the user name cannot be determined

The "config --global" suggested in the message is a valid one-shot fix,
and hopefully one-shot across machines that NFS mounts the home directories.

This knowledge can hopefully be reused when you are forced to use git on
Windows, but the fix based on GECOS would not be applicable, so
it is not such a useful hint to mention the exact reason why the
name cannot be determined.

Signed-off-by: Santi Béjar <sbejar@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix dcommit, rebase when rewriteRoot is in use
John Goerzen [Sat, 8 Mar 2008 22:04:05 +0000 (16:04 -0600)] 
Fix dcommit, rebase when rewriteRoot is in use

When the rewriteRoot setting is used with git-svn, it causes the svn
IDs added to commit messages to bear a different URL than is actually
used to retrieve Subversion data.

It is common for Subversion repositories to be available multiple
ways: for instance, HTTP to the public, and svn+ssh to people with
commit access.  The need to switch URLs for access is fairly common as
well -- perhaps someone was just given commit access.  To switch URLs
without having to rewrite history, one can use the old url as a
rewriteRoot, and use the new one in the svn-remote url setting.

This works well for svn fetching and general git commands.

However, git-svn dcommit, rebase, and perhaps other commands do not
work in this scenario.  They scan the svn ID lines in commit messages
and attempt to match them up with url lines in [svn-remote] sections
in the git config.

This patch allows them to match rewriteRoot options, if such options
are present.

Signed-off-by: John Goerzen <jgoerzen@complete.org>
Acked-by: Eric Wong <normalperson@yhbt.net>
16 years agofilter-branch: handle "disappearing tree" case correctly in subdir filter
Junio C Hamano [Sat, 8 Mar 2008 20:25:58 +0000 (12:25 -0800)] 
filter-branch: handle "disappearing tree" case correctly in subdir filter

The subdirectory filter had a bug to notice that the commit in question
did not have anything in the path-limited part of the tree.  $commit:$path
does not name an empty tree when $path does not appear in $commit.

This should fix it.  The additional test in t7003 is originally from Kevin
Ballard but with fixups.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoReally make the LF after reset in fast-import optional
Adeodato Simó [Fri, 7 Mar 2008 20:22:17 +0000 (21:22 +0100)] 
Really make the LF after reset in fast-import optional

cmd_from() ends with a call to read_next_command(), which is needed
when using cmd_from() from commands where from is not the last element.

With reset, however, "from" is the last command, after which the flow
returns to the main loop, which calls read_next_command() again.

Because of this, always set unread_command_buf in cmd_reset_branch(),
even if cmd_from() was successful.

Add a test case for this in t9300-fast-import.sh.

Signed-off-by: Adeodato Simó <dato@net.com.org.es>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoMerge branch 'mh/maint-http-proxy-fix' into maint
Junio C Hamano [Sat, 8 Mar 2008 10:20:37 +0000 (02:20 -0800)] 
Merge branch 'mh/maint-http-proxy-fix' into maint

* mh/maint-http-proxy-fix:
  Set proxy override with http_init()

16 years agoMerge branch 'js/maint-daemon' into maint
Junio C Hamano [Sat, 8 Mar 2008 10:20:30 +0000 (02:20 -0800)] 
Merge branch 'js/maint-daemon' into maint

* js/maint-daemon:
  daemon: ensure that base-path is an existing directory
  daemon: send more error messages to the syslog

16 years agoMerge branch 'js/maint-cvsexport' into maint
Junio C Hamano [Sat, 8 Mar 2008 10:13:52 +0000 (02:13 -0800)] 
Merge branch 'js/maint-cvsexport' into maint

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

Conflicts:

t/t9200-git-cvsexportcommit.sh

16 years agoMerge branch 'jc/maint-log-merge-left-right' into maint
Junio C Hamano [Sat, 8 Mar 2008 10:11:37 +0000 (02:11 -0800)] 
Merge branch 'jc/maint-log-merge-left-right' into maint

* jc/maint-log-merge-left-right:
  Fix "git log --merge --left-right"

16 years agoMerge branch 'ew/maint-svn-cert-fileprovider' into maint
Junio C Hamano [Sat, 8 Mar 2008 10:11:32 +0000 (02:11 -0800)] 
Merge branch 'ew/maint-svn-cert-fileprovider' into maint

* ew/maint-svn-cert-fileprovider:
  git-svn: Don't prompt for client cert password everytime.

16 years agounquote_c_style: fix off-by-one.
Pierre Habouzit [Thu, 6 Mar 2008 21:28:19 +0000 (22:28 +0100)] 
unquote_c_style: fix off-by-one.

The optional endp parameter to unquote_c_style() was supposed to point at
a location past the closing double quote, but it was going one beyond it.

git-fast-import used this function heavily and the bug caused it to
misparse the input stream, especially when parsing a rename command:

R "filename that needs quoting" rename-target-name

Because the function erroneously ate the whitespace after the closing dq,
this triggered "Missing space after source" error when it shouldn't.

Thanks to Adeodato Simò for having caught this.

Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agotest-lib: fix TERM to dumb for test repeatability
Junio C Hamano [Fri, 7 Mar 2008 03:04:26 +0000 (19:04 -0800)] 
test-lib: fix TERM to dumb for test repeatability

Dscho noticed that Term::ReadLine (used by send-email) colorized its
output for his TERM settings, inside t9001 tests.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoconfig.txt: refer to --upload-pack and --receive-pack instead of --exec
Uwe Kleine-König [Thu, 6 Mar 2008 20:28:07 +0000 (21:28 +0100)] 
config.txt: refer to --upload-pack and --receive-pack instead of --exec

The options --upload-pack (of git-fetch-pack) and --receive-pack (of
git-push) do the same as --exec (for both commands).  But the former options
have the more descriptive name.

Signed-off-by: Uwe Kleine-König <Uwe.Kleine-Koenig@digi.com>
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 [Thu, 6 Mar 2008 08:18:23 +0000 (00:18 -0800)] 
Merge branch 'maint' of git://repo.or.cz/git-gui into maint

* 'maint' of git://repo.or.cz/git-gui:
  git-gui: Gracefully fall back to po2msg.sh if msgfmt --tcl fails

16 years agoshortlog: take the first populated line of the description
Andy Whitcroft [Wed, 5 Mar 2008 14:24:10 +0000 (14:24 +0000)] 
shortlog: take the first populated line of the description

Way back the perl version of shortlog would take the first populated line
of the commit body.  The builtin version mearly takes the first line.
This leads to empty shortlog entries when there is some viable text in
the commit.

Reinstate this behaviour igoring all lines with nothing but whitespace.
This is often useful when dealing with commits imported from foreign SCMs
that do not tidy up the log message of useless blank lines at the beginning.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Gracefully fall back to po2msg.sh if msgfmt --tcl fails
Shawn O. Pearce [Thu, 28 Feb 2008 00:29:34 +0000 (19:29 -0500)] 
git-gui: Gracefully fall back to po2msg.sh if msgfmt --tcl fails

Mac OS X Tiger may have a msgfmt available but it doesn't understand
how to implement --tcl.  Falling back to po2msg.sh on such systems
is a reasonable behavior.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoFix 'git remote show' regression on empty repository in 1.5.4
Shawn O. Pearce [Tue, 4 Mar 2008 06:00:36 +0000 (01:00 -0500)] 
Fix 'git remote show' regression on empty repository in 1.5.4

Back in 18f7c51c we switched git-ls-remote/git-peek-remote to
use the transport backend, rather than do everything itself.

As part of that switch we started to produce a non-zero exit
status if no refs were received from the remote peer, which
happens when the remote peer has no commits pushed to it yet.
(E.g. "git --git-dir=foo.git init; git ls-remote foo.git")

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix incorrect wording in git-merge.txt.
Matthieu Moy [Mon, 3 Mar 2008 17:52:49 +0000 (18:52 +0100)] 
Fix incorrect wording in git-merge.txt.

A merge is not necessarily with a remote branch, it can be with any
commit.

Thanks to Paolo Ciarrocchi for pointing out the problem, and to
Nicolas Pitre for pointing out the fact that a merge is not
necessarily with a branch head.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-merge.sh: better handling of combined --squash,--no-ff,--no-commit options
Gerrit Pape [Mon, 3 Mar 2008 09:22:03 +0000 (09:22 +0000)] 
git-merge.sh: better handling of combined --squash,--no-ff,--no-commit options

git-merge used to use either the --squash,--no-squash, --no-ff,--ff,
--no-commit,--commit option, whichever came last in the command line.
This lead to some un-intuitive behavior, having

 git merge --no-commit --no-ff <branch>

actually commit the merge.  Now git-merge respects --no-commit together
with --no-ff, as well as other combinations of the options.  However,
this broke a selftest in t/t7600-merge.sh which expected to have --no-ff
completely override the --squash option, so that

 git merge --squash --no-ff <branch>

fast-forwards, and makes a merge commit; combining --squash with --no-ff
doesn't really make sense though, and is now refused by git-merge.  The
test is adapted to test --no-ff without the preceding --squash, and
another test is added to make sure the --squash --no-ff combination is
refused.

The unexpected behavior was reported by John Goerzen through
 http://bing.sdebian.org/468568

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoFix random crashes in http_cleanup()
Mike Hommey [Mon, 3 Mar 2008 19:30:16 +0000 (20:30 +0100)] 
Fix random crashes in http_cleanup()

For some reason, http_cleanup was running all active slots, which could
lead in situations where a freed slot would be accessed in
fill_active_slots. OTOH, we are cleaning up, which means the caller
doesn't care about pending requests. Just forget about them instead
or running them.

Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoUpdate draft release notes for 1.5.4.4
Junio C Hamano [Mon, 3 Mar 2008 05:49:28 +0000 (21:49 -0800)] 
Update draft release notes for 1.5.4.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agorevert: actually check for a dirty index
Jeff King [Mon, 3 Mar 2008 06:30:56 +0000 (01:30 -0500)] 
revert: actually check for a dirty index

The previous code mistakenly used wt_status_prepare to check whether the
index had anything commitable in it; however, that function is just an
init function, and will never report a dirty index.

The correct way with wt_status_* would be to call wt_status_print with the
output pointing to /dev/null or similar. However, that does extra work by
both examining the working tree and spewing status information to nowhere.

Instead, let's just implement the useful subset of wt_status_print as an
"is_index_dirty" function.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agotests: introduce test_must_fail
Junio C Hamano [Thu, 28 Feb 2008 21:09:30 +0000 (13:09 -0800)] 
tests: introduce test_must_fail

When we expect a git command to notice and signal errors, we
carelessly wrote in our tests:

    test_expect_success 'reject bogus request' '
        do something &&
        do something else &&
        ! git command
    '

but a non-zero exit could come from the "git command" segfaulting.

A new helper function "tset_must_fail" is introduced and it is
meant to be used to make sure the command gracefully fails (iow,
dying and exiting with non zero status is counted as a failure
to "gracefully fail").  The above example should be written as:

    test_expect_success 'reject bogus request' '
        do something &&
        do something else &&
        test_must_fail git command
    '

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-submodule: Fix typo 'url' which should be '$url'
Ping Yin [Mon, 3 Mar 2008 02:03:18 +0000 (10:03 +0800)] 
git-submodule: Fix typo 'url' which should be '$url'

Fix typo in 'test -z "url"' when checking whether a submodule url is
empty. "url" should be "$url".

Signed-off-by: Ping Yin <pkufranky@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoreceive-pack: Initialize PATH to include exec-dir.
Björn Steinbrink [Mon, 3 Mar 2008 04:08:43 +0000 (05:08 +0100)] 
receive-pack: Initialize PATH to include exec-dir.

511707d (use only the $PATH for exec'ing git commands) made it a
requirement to call setup_path() to include the git exec-dir in PATH
before spawning any other git commands. git-receive-pack was not yet
adapted to do this and therefore fails to spawn git-unpack-objects if that
is not in the standard PATH.

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoDocumentation cherry-pick: Fix cut-and-paste error
Mike Ralphson [Fri, 29 Feb 2008 17:00:38 +0000 (17:00 +0000)] 
Documentation cherry-pick: Fix cut-and-paste error

Signed-off-by: Mike Ralphson <mike@abacus.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit.el: find the git-status buffer whatever its name is
Rémi Vanicat [Fri, 29 Feb 2008 18:28:19 +0000 (19:28 +0100)] 
git.el: find the git-status buffer whatever its name is

git-status used the buffer name to find git-status buffers, and that
can fail if the buffer has another name, for example when multiple
working directories is tracked.

Signed-off-by: Rémi Vanicat <vanicat@debian.org>
Acked-by: Alexandre Julliard <julliard@winehq.org>
Tested-by: Xavier Maillard <xma@gnu.org>
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, 1 Mar 2008 05:19:43 +0000 (21:19 -0800)] 
Merge branch 'maint' of git://repo.or.cz/git-gui into maint

* 'maint' of git://repo.or.cz/git-gui:
  git-gui: Paper bag fix info dialog when no files are staged at commit

16 years agotemplates/Makefile: don't depend on local umask setting
Gerrit Pape [Thu, 28 Feb 2008 18:44:42 +0000 (18:44 +0000)] 
templates/Makefile: don't depend on local umask setting

Don't take the local umask setting into account when installing the
templates/* files and directories, running 'make install' with umask set
to 077 resulted in template/* installed with permissions 700 and 600.

The problem was discovered by Florian Zumbiehl, reported through
 http://bugs.debian.org/467518

Signed-off-by: Gerrit Pape <pape@smarden.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoCorrect name of diff_flush() in API documentation
Daniel Barkalow [Thu, 28 Feb 2008 17:24:42 +0000 (12:24 -0500)] 
Correct name of diff_flush() in API documentation

Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoStart preparing for 1.5.4.4
Junio C Hamano [Thu, 28 Feb 2008 07:37:39 +0000 (23:37 -0800)] 
Start preparing for 1.5.4.4

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agogit-gui: Paper bag fix info dialog when no files are staged at commit gitgui-0.9.3
Shawn O. Pearce [Thu, 28 Feb 2008 06:28:45 +0000 (01:28 -0500)] 
git-gui: Paper bag fix info dialog when no files are staged at commit

If the user tries to commit their changes without actually staging
anything we used to display an informational dialog suggesting they
first stage those changes, then retry the commit feature.

Unfortunately I broke this in aba15f7 ("Ensure error dialogs always
appear over all other windows") and failed to fix it in the paper
bag fix that came one day after it.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
16 years agoFix "git log --merge --left-right"
Junio C Hamano [Wed, 27 Feb 2008 07:18:38 +0000 (23:18 -0800)] 
Fix "git log --merge --left-right"

The command did not reject the combination of these options, but
did not show left/right markers.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
16 years agoSet proxy override with http_init()
Mike Hommey [Wed, 27 Feb 2008 20:35:50 +0000 (21:35 +0100)] 
Set proxy override with http_init()

In transport.c, proxy setting (the one from the remote conf) was set through
curl_easy_setopt() call, while http.c already does the same with the
http.proxy setting. We now just use this infrastructure instead, and make
http_init() now take the struct remote as argument so that it can take the
http_proxy setting from there, and any other property that would be added
later.

At the same time, we make get_http_walker() take a struct remote argument
too, and pass it to http_init(), which makes remote defined proxy be used
for more than get_refs_via_curl().

We leave out http-fetch and http-push, which don't use remotes for the
moment, purposefully.

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