gitweb.git
git-gui: correct assignment of work-treePat Thoyts Wed, 20 Oct 2010 13:29:56 +0000 (14:29 +0100)

git-gui: correct assignment of work-tree

git-gui currently uses its own logic to determine the work-tree setting
but 'git rev-parse --toplevel' directly returns git's work-tree value
by calling get_git_work_tree() and is therefore always correct.

This fixes an inability to handle some repository configurations. In
particular where .git is a file containing a path to the real directory
(a cross-platform symbolic link).
To continue to support older versions than 1.7.0, setting the work-tree
by normalizing the --show-cdup value is more reliable as git-dir might be
outside the work-tree entirely.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

t4203: do not let "git shortlog" DWIM based on ttyJunio C Hamano Wed, 20 Oct 2010 06:32:06 +0000 (23:32 -0700)

t4203: do not let "git shortlog" DWIM based on tty

The "shortlog" command defaults to HEAD only when its standard input is
connected to a terminal; otherwise it acts in the traditional "filter"
mode to read and summarize the "git log" output.

Two new tests added to t4203 assumed that the command always default to
HEAD, but when the standard input is closed (or connected to /dev/null),
it output empty, which is a summary of its empty input, causing the test
to break.

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

{cvs,svn}import: use the new 'git read-tree --empty'Thomas Rast Mon, 18 Oct 2010 13:11:25 +0000 (15:11 +0200)

{cvs,svn}import: use the new 'git read-tree --empty'

Since fb1bb96 (read-tree: deprecate syntax without tree-ish args,
2010-09-10) not passing --empty caused a spurious warning that was
shown to the user.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 19 Oct 2010 21:15:51 +0000 (14:15 -0700)

Merge branch 'maint'

* maint:
t/t9001-send-email.sh: fix stderr redirection in 'Invalid In-Reply-To'
Clarify and extend the "git diff" format documentation
git-show-ref.txt: clarify the pattern matching
documentation: git-config minor cleanups
Update test script annotate-tests.sh to handle missing/extra authors

t/t9001-send-email.sh: fix stderr redirection in 'Inval... Antonio Ospite Tue, 19 Oct 2010 09:50:39 +0000 (11:50 +0200)

t/t9001-send-email.sh: fix stderr redirection in 'Invalid In-Reply-To'

Signed-off-by: Antonio Ospite <ospite@studenti.unina.it>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Clarify and extend the "git diff" format documentationAndreas Gruenbacher Thu, 14 Oct 2010 10:53:11 +0000 (12:53 +0200)

Clarify and extend the "git diff" format documentation

Move the similarity and dissimilarity index header description closer to
where those extended headers are described.

Describe and/or clarify the format used for file modes, pathnames, and
the index header.

Document that all "old" files refer to the state before applying the
*entire* output, and all "new" files refer to the state thereafter.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-show-ref.txt: clarify the pattern matchingMichael J Gruber Mon, 18 Oct 2010 11:33:32 +0000 (13:33 +0200)

git-show-ref.txt: clarify the pattern matching

git-show-ref really does not do what one would expect under the name
pattern matching, so describe it.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

documentation: git-config minor cleanupsCliff Frey Mon, 18 Oct 2010 03:10:45 +0000 (20:10 -0700)

documentation: git-config minor cleanups

Change push.default's description to add hyphens between values and
descriptions to make the manpage easier to read. The html version is
readable either way.

Change status.showUntrackedFiles to make item descriptions be
sentences and to use the same asciidoc format as push.default. The
only visual change is the additions of "."

Signed-off-by: Cliff Frey <cliff@meraki.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update test script annotate-tests.sh to handle missing... Kevin Ballard Sat, 16 Oct 2010 11:09:20 +0000 (04:09 -0700)

Update test script annotate-tests.sh to handle missing/extra authors

The current script used by annotate-tests.sh (used by t8001 and t8002) fails
to emit a warning if any of the expected authors never show up in the output
or if authors that show up in the output were never specified as expected.
Update the script to fail in both of these scenarios.

Helped-by: Jakub Narebski <jnareb@gmail.com>
Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

repack: place temporary packs under .git/objects/pack/Thomas Rast Tue, 19 Oct 2010 09:50:43 +0000 (11:50 +0200)

repack: place temporary packs under .git/objects/pack/

git-pack-objects is already careful to start out its temporary packs
under .git/objects/pack/ (cf. 8b4eb6b, Do not perform cross-directory
renames when creating packs, 2008-09-22), but git-repack did not
respond in kind so the effort was lost when the filesystem boundary is
exactly at that directory.

Let git-repack pass a path under .git/objects/pack/ as the base for
its temporary packs.

This means we might need the $PACKDIR sooner (before the pack-objects
invocation), so move the mkdir up just to be safe.

Also note that the only use of *.pack is in the find invocation way
before the pack-objects call, so the temporary packs will not suddenly
show up in any wildcards because of the directory change.

Reported-by: Marat Radchenko <marat@slonopotamus.org>
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

push: pass --progress down to git-pack-objectsJeff King Sat, 16 Oct 2010 18:37:03 +0000 (02:37 +0800)

push: pass --progress down to git-pack-objects

When pushing via builtin transports (like file://, git://), the
underlying transport helper (in this case, git-pack-objects) did not get
the --progress option, even if it was passed to git push.

Fix this, and update the tests to reflect this.

Note that according to the git-pack-objects documentation, we can safely
apply the usual --progress semantics for the transport commands like
clone and fetch (and for pushing over other smart transports).

Reported-by: Chase Brammer <cbrammer@gmail.com>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5523-push-upstream: test progress messagesTay Ray Chuan Sat, 16 Oct 2010 18:37:02 +0000 (02:37 +0800)

t5523-push-upstream: test progress messages

Reported-by: Chase Brammer <cbrammer@gmail.com>
Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5523-push-upstream: add function to ensure fresh upstr... Tay Ray Chuan Sat, 16 Oct 2010 18:37:01 +0000 (02:37 +0800)

t5523-push-upstream: add function to ensure fresh upstream repo

Signed-off-by: Tay Ray Chuan <rctay89@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test_terminal: ensure redirections work reliablyJonathan Nieder Sun, 17 Oct 2010 00:38:07 +0000 (19:38 -0500)

test_terminal: ensure redirections work reliably

For terminal tests that capture output/stderr, the TTY prerequisite
warning does not quite work for commands like

test_terminal foo >out 2>err

because the warning gets "swallowed" up by the redirection that's
supposed only to be done by the subcommand.

Even worse, the outcome depends on whether stdout was already a
terminal (in which case test_terminal is a noop) or not (in which case
test_terminal introduces a pseudo-tty in the middle of the pipeline).

$ test_terminal.perl sh -c 'test -t 1 && echo >&2 YES' >out
YES
$ sh -c 'test -t 1 && echo >&2 YES' >out
$

So:

- use the test_terminal script even when running with "-v".

- skip tests that require a terminal when the test_terminal
script is unusable because IO::Pty is not installed.

- write the "need to declare TTY prerequisite" message to fd 4,
where it will be printed when running tests with -v, rather
than being swallowed up by an unrelated redireciton.

Noticed-by: Tay Ray Chuan <rctay89@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test_terminal: catch use without TTY prerequisiteJonathan Nieder Sat, 16 Oct 2010 18:36:59 +0000 (02:36 +0800)

test_terminal: catch use without TTY prerequisite

It is easy to forget to declare the TTY prerequisite when
writing tests on a system where it would always be satisfied
(because IO::Pty is installed; see v1.7.3-rc0~33^2, 2010-08-16
for example). Automatically detect this problem so there is
no need to remember.

test_terminal: need to declare TTY prerequisite
test_must_fail: command not found: test_terminal echo hi

test_terminal returns status 127 in this case to simulate
not being available.

Also replace the SIMPLEPAGERTTY prerequisite on one test with
"SIMPLEPAGER,TTY", since (1) the latter is supported now and
(2) the prerequisite detection relies on the TTY prereq being
explicitly declared.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-lib: allow test code to check the list of declared... Jonathan Nieder Sat, 16 Oct 2010 18:36:58 +0000 (02:36 +0800)

test-lib: allow test code to check the list of declared prerequisites

This is plumbing to prepare helpers like test_terminal to notice buggy
test scripts that do not declare all of the necessary prerequisites.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: test terminal output to both stdout and stderrJeff King Sat, 16 Oct 2010 18:36:57 +0000 (02:36 +0800)

tests: test terminal output to both stdout and stderr

Some outputs (like the pager) care whether stdout is a
terminal. Others (like progress meters) care about stderr.

This patch sets up both. Technically speaking, we could go
further and set up just one (because either the other goes
to a terminal, or because our tests are only interested in
one). This patch does both to keep the interface to
lib-terminal simple.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tests: factor out terminal handling from t7006Jeff King Sat, 16 Oct 2010 18:36:56 +0000 (02:36 +0800)

tests: factor out terminal handling from t7006

Other tests besides the pager ones may want to check how we handle
output to a terminal. This patch makes the code reusable.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-pack: avoid redundant "pack-objects died with... Jonathan Nieder Sat, 16 Oct 2010 17:09:54 +0000 (12:09 -0500)

send-pack: avoid redundant "pack-objects died with strange error"

Saying "pack-objects died with strange error" after "pack-objects died
of signal 13" seems kind of redundant. The latter message was
introduced when the run-command API changed to report abnormal exits
on behalf of the caller (v1.6.5-rc0~86^2~5, 2009-07-04).

Similarly, after a controlled pack-objects failure (detectable as a
normal exit with nonzero status), a "died with strange error" message
would be redundant next to the message from pack-objects itself.

So leave off the "strange error" messages.

The result should look something like this:

$ git push sf master
Counting objects: 21542, done.
Compressing objects: 100% (4179/4179), done.
fatal: Unable to create temporary file: Permission denied
error: pack-objects died of signal 13
error: failed to push some refs to 'ssh://sf.net/gitroot/project/project'
$

Or in the "controlled exit" case (contrived example):

[...]
fatal: delta size changed
error: failed to push some refs to 'ssh://example.com/foo/bar'
$

Improved-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-file: correctly find files when called in subdirThomas Rast Sun, 17 Oct 2010 19:23:22 +0000 (21:23 +0200)

merge-file: correctly find files when called in subdir

Since b541248 (merge.conflictstyle: choose between "merge" and "diff3
-m" styles, 2008-08-29), git-merge-file uses setup_directory_gently(),
thus cd'ing around to find any possible config files to use.

This broke merge-file when it is called from within a subdirectory of
a repository, and the arguments are all relative paths.

Fix by prepending the prefix, as passed down from the main git
setup code, if there is any.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

prefix_filename(): safely handle the case where pfx_len=0Thomas Rast Sun, 17 Oct 2010 19:23:21 +0000 (21:23 +0200)

prefix_filename(): safely handle the case where pfx_len=0

Current prefix_filename() is proofed against the case where the prefix
'pfx' is NULL or a 0-length string, _except on Windows_.

Change the behaviour to work the same on both platforms, and only
check pfx_len so that callers passing a NULL prefix with a nonzero
pfx_len segfault early on both.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4203 (mailmap): stop hardcoding commit ids and datesJonathan Nieder Fri, 15 Oct 2010 17:12:19 +0000 (12:12 -0500)

t4203 (mailmap): stop hardcoding commit ids and dates

A seemingly innocuous change like adding test_tick somewhere can
completely upset the final mailmap test, since it checks commit
hashes and dates. Make the test less fragile by fuzzing away the
unpredictable parts and leaving in the authors (which is what the
test is about, anyway).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Thu, 14 Oct 2010 03:20:09 +0000 (20:20 -0700)

Merge branch 'maint'

* maint:
Better advice on using topic branches for kernel development
Documentation: update implicit "--no-index" behavior in "git diff"
Documentation: expand 'git diff' SEE ALSO section
Documentation: diff can compare blobs
Documentation: gitrevisions is in section 7
shell portability: no "export VAR=VAL"
CodingGuidelines: reword parameter expansion section
Documentation: update-index: -z applies also to --index-info
Documentation: No argument of ALLOC_GROW should have side-effects

mailmap: fix use of freed memoryJim Meyering Mon, 11 Oct 2010 15:41:16 +0000 (17:41 +0200)

mailmap: fix use of freed memory

On an x86_64 system (F13-based), I ran these commands in an empty directory:

git init
printf '%s\n' \
'<jdoe@example.com> <jdoe@example.COM>' \
'John <jdoe@example.com>' > .mailmap
git shortlog < /dev/null

Here's the result:

(reading log message from standard input)
*** glibc detected *** git: free(): invalid pointer: 0x0000000000f53730 ***
======= Backtrace: =========
/lib64/libc.so.6[0x31ba875676]
git[0x48c2a5]
git[0x4b9858]
...
zsh: abort (core dumped) git shortlog

What happened?

Some .mailmap entry is of the <email1> <email2> form,
while a subsequent one looks like "User Name <Email2>,
and the two email addresses on the right are not identical
but are "equal" when using a case-insensitive comparator.

Then, when add_mapping is processing the latter line, new_email is NULL
and we free me->email, yet do not replace it with a new strdup'd string.
Thus, when later we attempt to use the buffer behind that ->email pointer,
we reference freed memory.

The solution is to free ->email and ->name only if we're about to replace them.

[jc: squashed in the tests from Jonathan]

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

Better advice on using topic branches for kernel develo... Luck, Tony Fri, 1 Oct 2010 18:57:52 +0000 (11:57 -0700)

Better advice on using topic branches for kernel development

Linus Torvalds wrote:
> The real problem is that maintainers often pick random - and not at
> all stable - points for their development to begin with. They just
> pick some random "this is where Linus -git tree is today", and do
> their development on top of that. THAT is the problem - they are
> unaware that there's some nasty bug in that version.

Maybe they do this because they read it in the Git user-manual.

Fix the manual to give them better guidance.

Signed-off-by: Tony Luck <tony.luck@intel.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: update implicit "--no-index" behavior... Jonathan Nieder Mon, 11 Oct 2010 16:06:18 +0000 (11:06 -0500)

Documentation: update implicit "--no-index" behavior in "git diff"

Originally "--no-index" mode triggered for untracked files within the
tracked tree, but with v1.5.6-rc1~41 (Merge branch 'jc/diff-no-no-index,
2008-05-26) the command was fixed to only implicitly trigger when paths
outside the tracked tree are mentioned.

Reported-by: Yann Dirson <dirson@bertin.fr>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: expand 'git diff' SEE ALSO sectionJonathan Nieder Mon, 11 Oct 2010 16:05:32 +0000 (11:05 -0500)

Documentation: expand 'git diff' SEE ALSO section

Point in many directions in the hope of helping the reader find what
is needed more quickly.

This commit also removes the summary attached to the SEE ALSO entry
for difftool, to avoid making the SEE ALSO list too verbose. If the
reader wants a summary of the commands referred to, she can always
look to the top of the named pages or to the table of contents on the
main git(1) page.

Suggested-by: Goswin von Brederlow <goswin-v-b@web.de>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: diff can compare blobsJonathan Nieder Mon, 11 Oct 2010 16:04:08 +0000 (11:04 -0500)

Documentation: diff can compare blobs

Meanwhile, there is no plumbing command to compare two blobs.
Strange.

Reported-by: Yann Dirson <dirson@bertin.fr>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: gitrevisions is in section 7Jonathan Nieder Mon, 11 Oct 2010 16:03:32 +0000 (11:03 -0500)

Documentation: gitrevisions is in section 7

Fix references to gitrevisions(1) in the manual pages and HTML
documentation.

In practice, this will not matter much unless someone tries to use a
hard copy of the git reference manual.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rev-list: handle %x00 NUL in user formatJeff King Thu, 7 Oct 2010 18:25:43 +0000 (14:25 -0400)

rev-list: handle %x00 NUL in user format

The code paths for showing commits in "git log" and "git
rev-list --graph" correctly handle embedded NULs by looking
only at the resulting strbuf's length, and never treating it
as a C string. The code path for regular rev-list, however,
used printf("%s"), which resulted in truncated output. This
patch uses fwrite instead, like the --graph code path.

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

submodule sync: Update "submodule.<name>.url" for empty... Andreas Köhler Fri, 8 Oct 2010 01:07:48 +0000 (03:07 +0200)

submodule sync: Update "submodule.<name>.url" for empty directories

If a submodule directory has not been filled by "git submodule update"
yet, then "git submodule sync" must still update the super-project's
configuration for submodule.<name>.url.

This situation occurs when switching between branches with a module from
different urls and other branches without the submodule.

Signed-off-by: Andreas Köhler <andi5.py@gmx.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: Support the DWIM mode for git checkoutKevin Ballard Tue, 12 Oct 2010 21:38:12 +0000 (14:38 -0700)

completion: Support the DWIM mode for git checkout

Ever since commit 70c9ac2 (DWIM: "git checkout frotz" to "git checkout
-b frotz origin/frotz"), git checkout has supported a DWIM mode where
it creates a local tracking branch for a remote branch if just the name
of the remote branch is specified on the command-line and only one remote
has a branch with that name. Teach the bash completion script to understand
this DWIM mode and provide such remote-tracking branch names as possible
completions.

Signed-off-by: Kevin Ballard <kevin@sb.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fast-import: Allow filemodify to set the rootDavid Barr Sun, 10 Oct 2010 03:30:15 +0000 (14:30 +1100)

fast-import: Allow filemodify to set the root

v1.7.3-rc0~75^2 (Teach fast-import to import subtrees named by tree id,
2010-06-30) has a shortcoming - it doesn't allow the root to be set.
Extend this behaviour by allowing the root to be referenced as the
empty path, "".

For a command (like filter-branch --subdirectory-filter) that wants
to commit a lot of trees that already exist in the object db, writing
undeltified objects as loose files only to repack them later can
involve a significant amount of overhead.
(23% slow-down observed on Linux 2.6.35, worse on Mac OS X 10.6)

Fortunately we have fast-import (which is one of the only git commands
that will write to a pack directly) but there is not an advertised way
to tell fast-import to commit a given tree without unpacking it.

This patch changes that, by allowing

M 040000 <tree id> ""

as a filemodify line in a commit to reset to a particular tree without
any need to parse it. For example,

M 040000 4b825dc642cb6eb9a060e54bf8d69288fbee4904 ""

is a synonym for the deleteall command and the fast-import equivalent of

git read-tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904

Signed-off-by: David Barr <david.barr@cordelta.com>
Commit-message-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Tested-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash: support pretty format aliasesSZEDER Gábor Sun, 10 Oct 2010 22:06:22 +0000 (00:06 +0200)

bash: support pretty format aliases

Users can have their own pretty format aliases since 8028184 (pretty:
add aliases for pretty formats, 2010-05-02), so let's offer those
after '--pretty=' and '--format=' for 'log' and 'show', too.

Similar to the completion of aliases, this will invoke 'git config'
each time pretty aliases needs to be completed, so changes in pretty.*
configuration will be reflected immediately.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash: support more 'git notes' subcommands and their... SZEDER Gábor Sun, 10 Oct 2010 21:43:33 +0000 (23:43 +0200)

bash: support more 'git notes' subcommands and their options

The current completion function for 'git notes' only supported the
'edit' and 'show' subcommands and none of their options. This patch
adds support for all missing subcommands, options, and their arguments
(files or refs), if any.

The code responsible for completing subcommand looks different
compared to the completion functions of other git commands with
subcommands. This is because of the '--ref <notes-ref>' option which
comes before the subcommand (i.e. git notes --ref <notes-ref> add).

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash: not all 'git bisect' subcommands make sense when... SZEDER Gábor Sun, 10 Oct 2010 21:39:34 +0000 (23:39 +0200)

bash: not all 'git bisect' subcommands make sense when not bisecting

... but only 'start' and 'replay'. The other commands will either
error out or offer to start bisecting for the user.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bash: offer refs for 'git bisect start'SZEDER Gábor Sun, 10 Oct 2010 21:39:33 +0000 (23:39 +0200)

bash: offer refs for 'git bisect start'

The completion script only offered path completion after 'git bisect
start', although bad and good refs could also be specified before the
doubledash.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: check for mandatory argument of 'bisect replay'SZEDER Gábor Sun, 10 Oct 2010 21:48:58 +0000 (23:48 +0200)

bisect: check for mandatory argument of 'bisect replay'

'git bisect replay' has a mandatory logfile argument, but the current
implementation doesn't check whether the user has specified one. When
the user omits the logfile argument, this leads to the following
unhelpful error message:

cannot read for replaying

So, check for the mandatory argument first, and provide a more
meaningful error message when it is omitted.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: improve error msg of 'bisect reset' when origin... SZEDER Gábor Sun, 10 Oct 2010 21:48:57 +0000 (23:48 +0200)

bisect: improve error msg of 'bisect reset' when original HEAD is deleted

'git bisect reset' (without the optional <commit> argument) returns to
the original HEAD from where the bisection was started. However,
when, for whatever reason, the user deleted the original HEAD before
invoking 'git bisect reset', then all he gets is an error message from
'git checkout':

fatal: invalid reference: somebranch

Let's try to be more helpful with an error message better describing
what went wrong and a suggestion about how to resolve the situation:

Could not check out original HEAD 'somebranch'. Try 'git bisect reset <commit>'.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: improve error message of 'bisect log' while... SZEDER Gábor Sun, 10 Oct 2010 21:48:56 +0000 (23:48 +0200)

bisect: improve error message of 'bisect log' while not bisecting

'git bisect log' is implemented by a direct invocation of 'cat
"$GIT_DIR/BISECT_LOG"', without any sanity checks. Consequently,
running 'git bisect log' while not bisecting leads to an error,
because the bisect logfile doesn't exists. The accompanying error
message

cat: /path/to/repo/.git/BISECT_LOG: No such file or directory

is neither very helpful nor very friendly.

Instead of blindly trying to cat the log file, first check whether
there is a bisection going on (i.e. the bisect logfile exists), and
die with a more appropriate error message when not.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

shell portability: no "export VAR=VAL"Junio C Hamano Wed, 13 Oct 2010 18:36:36 +0000 (11:36 -0700)

shell portability: no "export VAR=VAL"

It is more portable to say "VAR=VAL && export VAR" instead.

Noticed by Ævar.

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

CodingGuidelines: reword parameter expansion sectionJunio C Hamano Wed, 13 Oct 2010 18:15:14 +0000 (11:15 -0700)

CodingGuidelines: reword parameter expansion section

Group entries related to parameter substitutions together and avoid
using the word "regexp" to refer to the ${parameter/pattern/string}
substitution (banned), as the pattern there is a shell glob and not
a regular expression.

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

Documentation: update-index: -z applies also to --index... Bert Wesarg Fri, 8 Oct 2010 06:50:20 +0000 (08:50 +0200)

Documentation: update-index: -z applies also to --index-info

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Improve behavior for actionless path_info gitwe... Jakub Narebski Wed, 13 Oct 2010 11:35:20 +0000 (13:35 +0200)

gitweb: Improve behavior for actionless path_info gitweb URLs

Eli Barzilay noticed that

http://server/gitweb/project/<commit-sha1>

link goes to 'shortlog' view, while 'commit' view would be more
useful, but that 'shortlog' action is more apropriate for

http://server/gitweb/project/<commit-sha1>..<other-commit-sha1>

links.

Therefore for the case when we don't have either action, or filename,
or parent hash [base] in path_info-based URL, i.e. for

http://server/gitweb/project/<object-id>

link, instead of using 'shortlog' view we allow dispatch() subroutine
to detect type of object and use appropriate action (in most case it
would be either 'commit' action, or 'tag', or 'tree' for top
directory).

Requested-by: Eli Barzilay <eli@barzilay.org>
Signed-off-by: Jakub Narebski <jnareb@gmail.com>
Tested-by: Eli Barzilay <eli@barzilay.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Fix bug in evaluate_path_infoJakub Narebski Wed, 13 Oct 2010 11:33:48 +0000 (13:33 +0200)

gitweb: Fix bug in evaluate_path_info

There was bug in parsing "project/:/file" and "project/:/" path_info
URLs, with implicit HEAD as 'hash_base'.

For such URLs the refname is empty, and before this fix regexp for
parsing path_info fragment assumed that it is always non-empty.

Refname cannot contain ':', as per 'git check-ref-format'.

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

gitweb: Fix test of highlighting support in t9500Jakub Narebski Wed, 13 Oct 2010 11:57:41 +0000 (13:57 +0200)

gitweb: Fix test of highlighting support in t9500

The commit 7ce896b (Enable highlight executable path as a
configuration option, 2010-09-21) forgot to update t9500 test.

While at it, describe highlight test better.

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

t5503: fix typoMichael J Gruber Fri, 8 Oct 2010 21:03:15 +0000 (23:03 +0200)

t5503: fix typo

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: No argument of ALLOC_GROW should have... Jonathan Nieder Fri, 8 Oct 2010 16:46:59 +0000 (11:46 -0500)

Documentation: No argument of ALLOC_GROW should have side-effects

The explanatory comment before the definition of ALLOC_GROW carefully
lists arguments that will be used more than once and thus cannot have
side-effects; a lazy reader might conclude that the arguments not
listed are used only once and side effects safe.

Correct it to list all three arguments, avoiding this confusion.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix {update,checkout}-index usage stringsŠtěpán Němec Fri, 8 Oct 2010 17:31:20 +0000 (19:31 +0200)

Fix {update,checkout}-index usage strings

The `<file>' argument is optional in both cases (the man pages are
already correct).

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Put a space between `<' and argument in pack-objects... Štěpán Němec Fri, 8 Oct 2010 17:31:19 +0000 (19:31 +0200)

Put a space between `<' and argument in pack-objects usage string

This makes it cosistent with other places (including the
git-pack-objects(1) manpage itself) and avoids possible confusion (I,
for one, mistook `<object-list' for a `<object-list>' typo at first when
preparing this series).

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Remove stray quotes in --pretty and --format documentationŠtěpán Němec Fri, 8 Oct 2010 17:31:18 +0000 (19:31 +0200)

Remove stray quotes in --pretty and --format documentation

Quotes (for emphasis) are used in option explanations, not the
headings.

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use parentheses and `...' where appropriateŠtěpán Němec Fri, 8 Oct 2010 17:31:17 +0000 (19:31 +0200)

Use parentheses and `...' where appropriate

Remove some stray usage of other bracket types and asterisks for the
same purpose.

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix odd markup in --diff-filter documentationŠtěpán Němec Fri, 8 Oct 2010 18:40:32 +0000 (20:40 +0200)

Fix odd markup in --diff-filter documentation

Instead of using the regex-like bracket expression, use grouping to make
it more consistent with other similar places. The brackets now have the
same meaning as in other documentation (i.e., the argument is optional).

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Mentored-and-Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Use angles for placeholders consistentlyŠtěpán Němec Fri, 8 Oct 2010 17:31:15 +0000 (19:31 +0200)

Use angles for placeholders consistently

Signed-off-by: Štěpán Němec <stepnem@gmail.com>
Acked-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-gui: use full dialog width for old name when renami... Pat Thoyts Thu, 7 Oct 2010 22:00:33 +0000 (23:00 +0100)

git-gui: use full dialog width for old name when renaming branch

Let the combobox/option menu expand to fill the width of the dialog.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

git-gui: generic version trimmingPat Thoyts Thu, 7 Oct 2010 21:28:45 +0000 (22:28 +0100)

git-gui: generic version trimming

Rather than attempting to trim off all the non-version number suffixes
from the 'git version' result, let us scan along from the beginning until
we find a non-numeric part and stop there. Any such dot-version number will
be compatible with the Tcl package version comparison command which is the
aim of this code.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

commit-tree: free commit message before exitingJonathan Nieder Sat, 2 Oct 2010 08:41:00 +0000 (03:41 -0500)

commit-tree: free commit message before exiting

This buffer is freed by the C runtime when commit-tree exits moments
later, but freeing it explicitly should make valgrind quieter.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Wed, 6 Oct 2010 20:49:45 +0000 (13:49 -0700)

Merge branch 'maint'

* maint:
t/t3415: use && where applicable.
SubmittingPatches: Document some extra tags used in commit messages

t/t3415: use && where applicable.Yann Dirson Fri, 1 Oct 2010 21:19:19 +0000 (23:19 +0200)

t/t3415: use && where applicable.

Signed-off-by: Yann Dirson <ydirson@altern.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

SubmittingPatches: Document some extra tags used in... Ramkumar Ramachandra Sat, 2 Oct 2010 04:37:43 +0000 (10:07 +0530)

SubmittingPatches: Document some extra tags used in commit messages

Document the meanings of the tags "Reported-by:", "Acked-by:",
"Reviewed-by:" and "Tested-by:" clearly. Also mention that the user is
free to use any custom tags.

Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Liked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diffcore-pickaxe.c: a void function shouldn't try to... Brandon Casey Mon, 4 Oct 2010 22:51:48 +0000 (17:51 -0500)

diffcore-pickaxe.c: a void function shouldn't try to return something

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Make test script t9157 executableJunio C Hamano Wed, 6 Oct 2010 19:13:20 +0000 (12:13 -0700)

Make test script t9157 executable

Fixes a buglet introduced by a3c75056d

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

Merge branch 'jk/repack-reuse-object'Junio C Hamano Wed, 6 Oct 2010 19:11:26 +0000 (12:11 -0700)

Merge branch 'jk/repack-reuse-object'

* jk/repack-reuse-object:
Documentation: pack.compression: explain how to recompress
repack: add -F flag to let user choose between --no-reuse-delta/object

Merge branch 'bc/fix-cherry-pick-root'Junio C Hamano Wed, 6 Oct 2010 19:11:20 +0000 (12:11 -0700)

Merge branch 'bc/fix-cherry-pick-root'

* bc/fix-cherry-pick-root:
builtin/revert.c: don't dereference a NULL pointer

Merge branch 'uk/fix-author-ident-sed-script'Junio C Hamano Wed, 6 Oct 2010 19:11:12 +0000 (12:11 -0700)

Merge branch 'uk/fix-author-ident-sed-script'

* uk/fix-author-ident-sed-script:
get_author_ident_from_commit(): remove useless quoting

Merge branch 'cw/gitweb-hilite-config'Junio C Hamano Wed, 6 Oct 2010 19:10:35 +0000 (12:10 -0700)

Merge branch 'cw/gitweb-hilite-config'

* cw/gitweb-hilite-config:
Enable highlight executable path as a configuration option

Merge branch 'ab/makefile-track-cc'Junio C Hamano Wed, 6 Oct 2010 19:10:29 +0000 (12:10 -0700)

Merge branch 'ab/makefile-track-cc'

* ab/makefile-track-cc:
Makefile: add CC to TRACK_CFLAGS

Merge branch 'mg/reset-doc'Junio C Hamano Wed, 6 Oct 2010 19:10:26 +0000 (12:10 -0700)

Merge branch 'mg/reset-doc'

* mg/reset-doc:
git-reset.txt: make modes description more consistent
git-reset.txt: point to git-checkout
git-reset.txt: use "working tree" consistently
git-reset.txt: reset --soft is not a no-op
git-reset.txt: reset does not change files in target
git-reset.txt: clarify branch vs. branch head

Merge branch 'maint'Junio C Hamano Wed, 6 Oct 2010 19:10:02 +0000 (12:10 -0700)

Merge branch 'maint'

* maint:
Documentation/git-clone: describe --mirror more verbosely
do not depend on signed integer overflow
work around buggy S_ISxxx(m) implementations
xdiff: cast arguments for ctype functions to unsigned char
init: plug tiny one-time memory leak
diffcore-pickaxe.c: remove unnecessary curly braces
t3020 (ls-files-error-unmatch): remove stray '1' from end of file
setup: make sure git dir path is in a permanent buffer
environment.c: remove unused variable
git-svn: fix processing of decorated commit hashes
git-svn: check_cherry_pick should exclude commits already in our history
Documentation/git-svn: discourage "noMetadata"

Merge branch 'work/pt/for-junio' of git://repo.or.cz... Junio C Hamano Tue, 5 Oct 2010 15:43:59 +0000 (08:43 -0700)

Merge branch 'work/pt/for-junio' of git://repo.or.cz/git/mingw/4msysgit

* 'work/pt/for-junio' of git://repo.or.cz/git/mingw/4msysgit:
Add MinGW-specific execv() override.
Fix Windows-specific macro redefinition warning.
Fix 'clone' failure at DOS root directory.
mingw: do not crash on open(NULL, ...)
git-am: fix detection of absolute paths for windows
Side-step MSYS-specific path "corruption" leading to t5560 failure.
Side-step sed line-ending "corruption" leading to t6038 failure.
Skip 'git archive --remote' test on msysGit
Do not strip CR when grepping HTTP headers.
Skip t1300.70 and 71 on msysGit.
merge-octopus: Work around environment issue on Windows
MinGW: Report errors when failing to launch the html browser.
MinGW: fix stat() and lstat() implementations for handling symlinks
MinGW: Add missing file mode bit defines
MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility

Martin Langhoff has a new e-mail addressJunio C Hamano Tue, 5 Oct 2010 19:44:08 +0000 (12:44 -0700)

Martin Langhoff has a new e-mail address

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

Documentation/git-clone: describe --mirror more verboselyUwe Kleine-König Mon, 4 Oct 2010 17:28:27 +0000 (19:28 +0200)

Documentation/git-clone: describe --mirror more verbosely

Some people in #linux-rt noticed that describing what "--mirror" option does
with "it mirrors" is way insufficient.

Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Darren 'Some People' Hart <darren@dvhart.com>
Cc: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

do not depend on signed integer overflowErik Faye-Lund Tue, 5 Oct 2010 07:24:10 +0000 (09:24 +0200)

do not depend on signed integer overflow

Signed integer overflow is not defined in C, so do not depend on it.

This fixes a problem with GCC 4.4.0 and -O3 where the optimizer would
consider "consumed_bytes > consumed_bytes + bytes" as a constant
expression, and never execute the die()-call.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Acked-by: Nicolas Pitre <nico@fluxnic.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

work around buggy S_ISxxx(m) implementationsRené Scharfe Mon, 4 Oct 2010 10:53:11 +0000 (12:53 +0200)

work around buggy S_ISxxx(m) implementations

There are buggy implementations of S_ISxxx(m) macros on some platforms
(e.g. NetBSD). The issue is that NetBSD doesn't take care to wrap its
macro arguments in parentheses, so on Linux and sane systems we have
S_ISREG(m) defined as something like:

(((m) & S_IFMT) == S_IFREG)

But on NetBSD:

((m & _S_IFMT) == _S_IFREG)

Since a caller in builtin/diff.c called our macro as `S_IFREG | 0644'
this bug introduced a logic error on NetBSD, since the precedence of
bit-wise & is higher than | in C.

[jc: took change description from Ævar Arnfjörð Bjarmason's patch]

Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

xdiff: cast arguments for ctype functions to unsigned... Jonathan Nieder Mon, 4 Oct 2010 09:09:17 +0000 (04:09 -0500)

xdiff: cast arguments for ctype functions to unsigned char

The ctype functions isspace(), isalnum(), et al take an integer
argument representing an unsigned character, or -1 for EOF. On
platforms with a signed char, it is unsafe to pass a char to them
without casting it to unsigned char first.

Most of git is already shielded against this by the ctype
implementation in git-compat-util.h, but xdiff, which uses libc
ctype.h, ought to be fixed.

Noticed-by: der Mouse <mouse@Rodents-Montreal.ORG>
Reported-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

init: plug tiny one-time memory leakJonathan Nieder Mon, 4 Oct 2010 04:34:27 +0000 (23:34 -0500)

init: plug tiny one-time memory leak

The buffer used to construct paths like ".git/objects/info" and
".git/objects/pack" is allocated on the heap and never freed.

So free it. While at it, factor out the relevant code into its own
function and rename the sha1_dir variable to object_directory (to
match the change in everyday usage after the renaming of
SHA1_FILE_DIRECTORY in v0.99~603^2~7, 2005).

Noticed by valgrind while setting up tests (in test-lib).

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-gui: enable the Tk console when tracing/debugging... Pat Thoyts Tue, 5 Oct 2010 22:51:34 +0000 (23:51 +0100)

git-gui: enable the Tk console when tracing/debugging on Windows

Without any standard channels the trace option is pretty useless on Win32
unless you can show the Tk console which captures such output. This also
permits introspection of the running application to assist in debugging.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

git-gui: show command-line errors in a messagebox on... Pat Thoyts Tue, 5 Oct 2010 22:39:54 +0000 (23:39 +0100)

git-gui: show command-line errors in a messagebox on Windows

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

diffcore-pickaxe.c: remove unnecessary curly bracesBrandon Casey Mon, 4 Oct 2010 22:51:47 +0000 (17:51 -0500)

diffcore-pickaxe.c: remove unnecessary curly braces

Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge early part of git-svn into maintJunio C Hamano Tue, 5 Oct 2010 15:36:10 +0000 (08:36 -0700)

Merge early part of git-svn into maint

* commit 'git-svn/master~1':
git-svn: fix processing of decorated commit hashes
git-svn: check_cherry_pick should exclude commits already in our history
Documentation/git-svn: discourage "noMetadata"

On Windows, avoid git-gui to call Cygwin's nice utilitySebastian Schuberth Tue, 5 Oct 2010 09:12:00 +0000 (11:12 +0200)

On Windows, avoid git-gui to call Cygwin's nice utility

It's a common case for Windows developers to have both Cygwin and msysGit
installed. Unfortunately, some scenarios also require to have Cygwin in PATH.
By default, Cygwin comes with nice.exe, while msysGit does not. Since git-gui
calls nice if it is in PATH, this results in Cygwin's nice.exe being called
from msysGit's git-gui. Mixing Cygwin and msysGit generally is not a good idea,
and in this particular case it causes differences not being correctly detected.
So we only call nice.exe on Windows if it is in the same directory as git.exe.
This way, this work-around does neither affect a pure Cygwin environment, or
the case when nice.exe will be shipped with msysGit at some point in time.

This fixes msysGit issue 394.

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

send-email: Don't leak To: headers between patchesStephen Boyd Mon, 4 Oct 2010 07:05:24 +0000 (00:05 -0700)

send-email: Don't leak To: headers between patches

If the first patch in a series has a To: header in the file and the
second patch in the series doesn't the address from the first patch will
be part of the To: addresses in the second patch. Fix this by treating the
to list like the cc list. Have an initial to list come from the command
line, user input and config options. Then build up a to list from each
patch and concatenate the two together before sending the patch. Finally,
reset the list after sending each patch so the To: headers from a patch
don't get used for the next one.

Reported-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Stephen Boyd <bebarino@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3020 (ls-files-error-unmatch): remove stray '1' from... Elijah Newren Sun, 3 Oct 2010 20:00:00 +0000 (14:00 -0600)

t3020 (ls-files-error-unmatch): remove stray '1' from end of file

Acked-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

setup: make sure git dir path is in a permanent bufferJonathan Nieder Sat, 2 Oct 2010 08:36:52 +0000 (03:36 -0500)

setup: make sure git dir path is in a permanent buffer

If setup_git_env() is run before the usual repository discovery
sequence and .git is a file with the text

gitdir: <path>

(with <path> any string) then the in-core git_dir variable is set to
the result of converting <path> to an absolute path using
make_absolute_path().

Unfortunately make_absolute_path() returns its result in a static
buffer that is overwritten by later calls. Such a call could cause
later accesses to git_dir (from git_pathdup(), for example) to read
the wrong path, leaving git very confused.

It is not obvious whether any existing code in git will trigger the
problem, but in any case, it is worth a few dozen bytes to copy the
return value from make_absolute_path() for some added peace of mind.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

environment.c: remove unused variableJonathan Nieder Sat, 2 Oct 2010 08:35:29 +0000 (03:35 -0500)

environment.c: remove unused variable

After v1.6.0-rc0~230^2^ (environment.c: remove unused function,
2008-06-19), git_refs_dir is not used any more.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add MinGW-specific execv() override.Eric Sunshine Mon, 27 Sep 2010 11:02:17 +0000 (07:02 -0400)

Add MinGW-specific execv() override.

As of 2dbc887e, shell.c employs execv(), so provide a MinGW-specific
mingw_execv() override, complementing existing mingw_execvp() and
cousins.

As a bonus, this also resolves a compilation warning due to an
execv() prototype mismatch between Linux and MinGW. Linux expects
the second argument to be (char *const *), whereas MinGW expects
(const char *const *).

Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Fix Windows-specific macro redefinition warning.Eric Sunshine Mon, 27 Sep 2010 11:01:59 +0000 (07:01 -0400)

Fix Windows-specific macro redefinition warning.

shell.c defines macro HELP_COMMAND which collides with a like-named
macro from winuser.h. Avoid collision by sanitizing preprocessor
namespace after including Windows headers.

Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Fix 'clone' failure at DOS root directory.Eric Sunshine Wed, 7 Jul 2010 01:48:47 +0000 (21:48 -0400)

Fix 'clone' failure at DOS root directory.

Cloning via relative path fails for a project residing immediately under
the root directory of a DOS drive. For instance, for project c:/foo,
issuing "cd c:/" followed by "git clone foo bar" fails with error
"Unable to find remote helper for 'c'". The problem is caused by
make_nonrelative_path() incorrectly returning c://foo rather than
c:/foo for input "foo". The bogus path c://foo is misinterpreted by
transport_get() as a URL with unrecognized protocol "c", hence the
missing remote helper error. Fix make_nonrelative_path() to return
c:/foo rather than c://foo (and /foo rather than //foo on Unix).

Resolves msysgit issue #501 [1]

[PT: squashed in changes requested by Junio [2][3]]

[1] http://code.google.com/p/msysgit/issues/detail?id=501
[2] http://marc.info/?l=git&m=128570102331652&w=2
[3] http://marc.info/?l=git&m=128573246704862&w=2

Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>

mingw: do not crash on open(NULL, ...)Erik Faye-Lund Thu, 23 Sep 2010 17:35:25 +0000 (17:35 +0000)

mingw: do not crash on open(NULL, ...)

fetch_and_setup_pack_index() apparently pass a NULL-pointer to
parse_pack_index(), which in turn pass it to check_packed_git_idx(),
which again pass it to open(). Since open() already sets errno
correctly for the NULL-case, let's just avoid the problematic strcmp.

[PT: squashed in fix for fopen which was missed first time round]

Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

git-am: fix detection of absolute paths for windowsPat Thoyts Thu, 30 Sep 2010 13:24:07 +0000 (14:24 +0100)

git-am: fix detection of absolute paths for windows

Add an is_absolute_path function to abstract out platform differences
in checking for an absolute or relative path.
Specifically fixes t4150-am on Windows.

[PT: updated following suggestion from j6t to support \* and //*]

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Side-step MSYS-specific path "corruption" leading to... Eric Sunshine Tue, 20 Jul 2010 23:29:16 +0000 (19:29 -0400)

Side-step MSYS-specific path "corruption" leading to t5560 failure.

Upon program invocation, MSYS converts environment variables containing
path-like values from Unix-style to DOS-style under the assumption that
the program being invoked understands only DOS-style pathnames. For
instance, the Unix-style path /msysgit is translated to c:/msysgit. For
test t5560, the path being requested from git-http-backend is specified
via environment variable PATH_INFO as a URL path of the form
/repo.git/foobar, which git-http-backend combines with GIT_PROJECT_ROOT
to determine the actual physical path within the repository. This is a
case where MSYS's conversion of the path-like value of PATH_INFO causes
harm, for two reasons. First, the resulting converted path, when joined
with GIT_PROJECT_ROOT is bogus (for instance,
"C:/msysgit/git/t/trash-zzz/C:/msysgit/repo.git/HEAD"). Second, the
converted PATH_INFO path is rejected by git-http-backend as an 'alias'
due to validation failure on the part of daemon_avoid_alias().
Unfortunately, the standard work-around of doubling the leading slash
(i.e. //repo.git/foobar) to suppress MSYS path conversion works only for
command-line arguments, but not for environment variables.
Consequently, side step the problem by instead passing git-http-backend
an already-constructed full path rather than components GIT_PROJECT_ROOT
and PATH_INFO.

Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Side-step sed line-ending "corruption" leading to t6038... Eric Sunshine Fri, 17 Sep 2010 13:16:01 +0000 (09:16 -0400)

Side-step sed line-ending "corruption" leading to t6038 failure.

By default, MSYS sed throws away CR from CRLF line-endings. Tests
t6038.5 and t6038.6 employ sed to normalize conflict output of git-merge
for validation purposes. These tests expect CRLF line-endings to be
present in the normalized output of git-merge, and thus fail when sed
undesirably removes CR. Fix by employing sed's -b/--binary switch to
suppress its default behavior of dropping CR characters.

Acked-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Skip 'git archive --remote' test on msysGitPat Thoyts Fri, 17 Sep 2010 13:27:56 +0000 (14:27 +0100)

Skip 'git archive --remote' test on msysGit

This test requires git daemon support which is not available on msysgit

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Do not strip CR when grepping HTTP headers.Pat Thoyts Sun, 12 Sep 2010 09:37:24 +0000 (10:37 +0100)

Do not strip CR when grepping HTTP headers.

By default, MSYS grep reads in text-mode and converts CRLF into LF line
endings. For testing HTTP use binary mode (-U) as checking is done for
CR in HTTP headers

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

Skip t1300.70 and 71 on msysGit.Pat Thoyts Mon, 27 Sep 2010 21:02:57 +0000 (22:02 +0100)

Skip t1300.70 and 71 on msysGit.

These two tests fail on msysGit because /dev/null is an alias for nul on
Windows and when reading the value back from git config the alias does
not match the real filename. Also the HOME environment variable has a
unix-style path but git returns a native equivalent path for '~'. As
these are platform-dependent equivalent results it seems simplest to
skip the test entirely.

Moves the NOT_MINGW prereq from t5503 into the test library.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

merge-octopus: Work around environment issue on WindowsJohannes Schindelin Fri, 11 Jun 2010 22:45:35 +0000 (00:45 +0200)

merge-octopus: Work around environment issue on Windows

For some reason, the environment variables get upper-cased when a
subprocess is launched on Windows. Cope with that.

[PT: fixed typo in the char range noted by junio]

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

MinGW: Report errors when failing to launch the html... Pat Thoyts Thu, 18 Mar 2010 21:45:19 +0000 (21:45 +0000)

MinGW: Report errors when failing to launch the html browser.

The mingw function to launch the system html browser is silent if the
target file does not exist leaving the user confused. Make it display
something.

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>

MinGW: fix stat() and lstat() implementations for handl... Pat Thoyts Wed, 17 Mar 2010 15:17:34 +0000 (15:17 +0000)

MinGW: fix stat() and lstat() implementations for handling symlinks

In msysGit the stat() function has been implemented using mingw_lstat
which sets the st_mode member to S_IFLNK when a symbolic links is found.
This causes the is_executable function to return when git attempts to
build a list of available commands in the help code and we end up missing
most git commands. (msysGit issue #445)

This patch modifies the implementation so that lstat() will return the link
flag but if we are called as stat() we read the size of the target and set
the mode to that of a regular file.

Includes squashed fix st_mode for symlink dirs

Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>

MinGW: Add missing file mode bit definesSebastian Schuberth Mon, 28 Dec 2009 17:13:52 +0000 (18:13 +0100)

MinGW: Add missing file mode bit defines

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>

MinGW: Use pid_t more consequently, introduce uid_t... Sebastian Schuberth Mon, 28 Dec 2009 17:04:21 +0000 (18:04 +0100)

MinGW: Use pid_t more consequently, introduce uid_t for greater compatibility

Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>