gitweb.git
sh-setup: add new peel_committish() helperRamkumar Ramachandra Fri, 14 Jun 2013 13:17:51 +0000 (18:47 +0530)

sh-setup: add new peel_committish() helper

The normal way to check whether a certain revision resolves to a valid
commit is:

$ git rev-parse --verify $REV^0

Unfortunately, this does not work when $REV is of the type :/quuxery.
Write a helper to work around this limitation.

Suggested-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/rebase: add failing tests for a peculiar revisionRamkumar Ramachandra Fri, 14 Jun 2013 13:17:50 +0000 (18:47 +0530)

t/rebase: add failing tests for a peculiar revision

The following commands fail, even if :/quuxery and :/foomery resolve to
perfectly valid commits:

$ git rebase [-i] --onto :/quuxery :/foomery

This is because rebase [-i] attempts to rev-parse ${REV}^0 to verify
that the given revision resolves to a commit. Add tests to document
these failures.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: make error message more preciseCélestin Matte Fri, 14 Jun 2013 13:50:39 +0000 (15:50 +0200)

git-remote-mediawiki: make error message more precise

In subroutine parse_command, error messages were not correct. For the "import"
function, having too much or incorrect arguments displayed both
"invalid arguments", while it displayed "too many arguments" for the "option"
functions under the same conditions.
Separate the two error messages in both cases.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: add a perlcritic rule in MakefileCélestin Matte Fri, 14 Jun 2013 13:50:38 +0000 (15:50 +0200)

git-remote-mediawiki: add a perlcritic rule in Makefile

Option "-2" launches perlcritic with level 2. Levels go from 5 (most pertinent)
to 1. Rules of level 1 are mostly a question of style, and are therefore
ignored.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: add a .perlcriticrc fileCélestin Matte Fri, 14 Jun 2013 13:50:37 +0000 (15:50 +0200)

git-remote-mediawiki: add a .perlcriticrc file

Such a file allows to configure perlcritic.
Here, it is used to remove many unwanted rules and configure one to
remove unwanted warnings.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: clearly rewrite double dereferenceCélestin Matte Fri, 14 Jun 2013 13:50:36 +0000 (15:50 +0200)

git-remote-mediawiki: clearly rewrite double dereference

@$var structures are re-written in the following way: @{$var}
It makes them more readable.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: fix a typo ("mediwiki" instead... Célestin Matte Fri, 14 Jun 2013 13:50:35 +0000 (15:50 +0200)

git-remote-mediawiki: fix a typo ("mediwiki" instead of "mediawiki")

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: put non-trivial numeric values... Célestin Matte Fri, 14 Jun 2013 13:50:34 +0000 (15:50 +0200)

git-remote-mediawiki: put non-trivial numeric values in constants.

Non-trivial numeric values (e.g., different from 0, 1 and 2) are placed in
constants at the top of the code to be easily modifiable and to make more sense

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: don't use quotes for empty stringsCélestin Matte Fri, 14 Jun 2013 13:50:33 +0000 (15:50 +0200)

git-remote-mediawiki: don't use quotes for empty strings

Empty strings are replaced by an $EMPTY constant.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: replace "unless" statements with... Célestin Matte Fri, 14 Jun 2013 13:50:32 +0000 (15:50 +0200)

git-remote-mediawiki: replace "unless" statements with negated "if" statements

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: brace file handles for print... Célestin Matte Fri, 14 Jun 2013 13:50:31 +0000 (15:50 +0200)

git-remote-mediawiki: brace file handles for print for more clarity

This follows the following rule:
InputOutput::RequireBracedFileHandleWithPrint (Severity: 1)
The `print' and `printf' functions have a unique syntax that supports an
optional file handle argument. Conway suggests wrapping this argument in
braces to make it visually stand out from the other arguments. When you
put braces around any of the special package-level file handles like
`STDOUT', `STDERR', and `DATA', you must the `'*'' sigil or else it
won't compile under `use strict 'subs''.

print $FH "Mary had a little lamb\n"; #not ok
print {$FH} "Mary had a little lamb\n"; #ok

print STDERR $foo, $bar, $baz; #not ok
print {STDERR} $foo, $bar, $baz; #won't compile under 'strict'
print {*STDERR} $foo, $bar, $baz; #perfect!

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: modify strings for a better codin... Célestin Matte Fri, 14 Jun 2013 13:50:30 +0000 (15:50 +0200)

git-remote-mediawiki: modify strings for a better coding-style

- strings which don't need interpolation are single-quoted for more clarity and
slight gain of performance
- interpolation is preferred over concatenation in many cases, for more clarity
- variables are always used with the ${} operator inside strings
- strings including double-quotes are written with qq() so that the quotes do
not have to be escaped

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: put long code into a subroutineCélestin Matte Fri, 14 Jun 2013 13:50:29 +0000 (15:50 +0200)

git-remote-mediawiki: put long code into a subroutine

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: remove import of unused open2Célestin Matte Fri, 14 Jun 2013 13:50:28 +0000 (15:50 +0200)

git-remote-mediawiki: remove import of unused open2

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: check return value of openCélestin Matte Fri, 14 Jun 2013 13:50:27 +0000 (15:50 +0200)

git-remote-mediawiki: check return value of open

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: assign a variable as undef and... Célestin Matte Fri, 14 Jun 2013 13:50:26 +0000 (15:50 +0200)

git-remote-mediawiki: assign a variable as undef and make proper indentation

Explicitly assign local variable $/ as undef and make a proper
one-instruction-by-line indentation

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: rename a variable ($last) which... Célestin Matte Fri, 14 Jun 2013 13:50:25 +0000 (15:50 +0200)

git-remote-mediawiki: rename a variable ($last) which has the name of a keyword

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: remove unused variable $entryCélestin Matte Fri, 14 Jun 2013 13:50:24 +0000 (15:50 +0200)

git-remote-mediawiki: remove unused variable $entry

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: turn double-negated expressions... Célestin Matte Fri, 14 Jun 2013 13:50:23 +0000 (15:50 +0200)

git-remote-mediawiki: turn double-negated expressions into simple expressions

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: change the name of a variableCélestin Matte Fri, 14 Jun 2013 13:50:22 +0000 (15:50 +0200)

git-remote-mediawiki: change the name of a variable

Local variable $url has the same name as a global variable. Changing the name
of the local variable prevents future possible misunderstanding.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: add newline in the end of die... Célestin Matte Fri, 14 Jun 2013 13:50:21 +0000 (15:50 +0200)

git-remote-mediawiki: add newline in the end of die() error messages

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: change style in a regexpCélestin Matte Fri, 14 Jun 2013 13:50:20 +0000 (15:50 +0200)

git-remote-mediawiki: change style in a regexp

Change '[\n]' to '\n': brackets are useless here.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: change style in a regexpCélestin Matte Fri, 14 Jun 2013 13:50:19 +0000 (15:50 +0200)

git-remote-mediawiki: change style in a regexp

In this regexp, ' |\n' is used, whereas its equivalent '[ \n]', which is
clearer, is used elsewhere. Make the style coherent.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: change separator of some regexpsCélestin Matte Fri, 14 Jun 2013 13:50:18 +0000 (15:50 +0200)

git-remote-mediawiki: change separator of some regexps

Use {}{} instead of /// when slashes are used inside the regexp so as not to
escape it.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: change the behaviour of a splitCélestin Matte Fri, 14 Jun 2013 13:50:17 +0000 (15:50 +0200)

git-remote-mediawiki: change the behaviour of a split

A "split ' '" is turned into a "split / /", which changes its behaviour: the
old method matched a run of whitespaces (/\s*/), while the new one will match a
single space, which is what we want here. Indeed, in other contexts,
changing split(' ') to split(/ /) could potentially be a regression, however,
here, when parsing the output of "rev-list --parents", whose output SHA-1's are
each separated by a single space, splitting on a single space is perfectly
correct.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: remove useless regexp modifier (m)Célestin Matte Fri, 14 Jun 2013 13:50:16 +0000 (15:50 +0200)

git-remote-mediawiki: remove useless regexp modifier (m)

m// and // is used randomly. It is better to use the m modifier only when
needed, e.g., when the regexp uses another separator than //.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: rewrite unclear line of instructionsCélestin Matte Fri, 14 Jun 2013 13:50:15 +0000 (15:50 +0200)

git-remote-mediawiki: rewrite unclear line of instructions

Subroutines' parameters should be assigned to variable before doing anything
else
Besides, existing instruction affected a variable inside a "if", which break
Git's coding style

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: change syntax of map callsCélestin Matte Fri, 14 Jun 2013 13:50:14 +0000 (15:50 +0200)

git-remote-mediawiki: change syntax of map calls

Put first parameter of map inside a block, for better readability.
Follow BuiltinFunctions::RequireBlockMap

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: move a variable declaration at... Célestin Matte Fri, 14 Jun 2013 13:50:13 +0000 (15:50 +0200)

git-remote-mediawiki: move a variable declaration at the top of the code

%basetimestamps declaration was lost in the middle of subroutines

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: always end a subroutine with... Célestin Matte Fri, 14 Jun 2013 13:50:12 +0000 (15:50 +0200)

git-remote-mediawiki: always end a subroutine with a return

Follow Subroutines::RequireFinalReturn

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: replace :utf8 by :encoding(UTF-8)Célestin Matte Fri, 14 Jun 2013 13:50:11 +0000 (15:50 +0200)

git-remote-mediawiki: replace :utf8 by :encoding(UTF-8)

Follow perlcritic's InputOutput::RequireEncodingWithUTF8Layer policy

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: move "use warnings;" before any... Célestin Matte Fri, 14 Jun 2013 13:50:10 +0000 (15:50 +0200)

git-remote-mediawiki: move "use warnings;" before any instruction

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: make a regexp clearerCélestin Matte Fri, 14 Jun 2013 13:50:09 +0000 (15:50 +0200)

git-remote-mediawiki: make a regexp clearer

Perl's split function takes a regex pattern argument. You can also
feed it an expression, which is then compiled into a regex at runtime.
It therefore works to pass your pattern via single quotes, but it is
much less obvious to a reader that the argument is meant to be a
regex, not a static string. Using the traditional slash-delimiters
makes this easier to read.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'rr/complete-difftool-fixup'Junio C Hamano Fri, 14 Jun 2013 15:46:23 +0000 (08:46 -0700)

Merge branch 'rr/complete-difftool-fixup'

"git difftool" can take both revs to be compared and pathspecs.
"git show" takes revs, revs:path and pathspecs.

* rr/complete-difftool-fixup:
completion: show can take both revlist and paths
completion: difftool takes both revs and files

Merge branch 'mt/send-email-cc-match-fix'Junio C Hamano Fri, 14 Jun 2013 15:46:20 +0000 (08:46 -0700)

Merge branch 'mt/send-email-cc-match-fix'

Logic git-send-email used to suppress cc mishandled names like "A
U. Thor" <author@example.xz>, where the human readable part needs
to be quoted (the user input may not have the double quotes around
the name, and comparison was done between quoted and unquoted
strings).

* mt/send-email-cc-match-fix:
test-send-email: test for pre-sanitized self name
t/send-email: test suppress-cc=self with non-ascii
t/send-email: add test with quoted sender
send-email: make --suppress-cc=self sanitize input
t/send-email: test suppress-cc=self on cccmd
send-email: fix suppress-cc=self on cccmd
t/send-email.sh: add test for suppress-cc=self

Merge branch 'bp/mediawiki-credential'Junio C Hamano Fri, 14 Jun 2013 15:46:17 +0000 (08:46 -0700)

Merge branch 'bp/mediawiki-credential'

The bridge to MediaWiki has been updated to use the credential
helper interface in Git.pm, losing its own and the original
implementation the former was based on.

* bp/mediawiki-credential:
git-remote-mediawiki: use Git.pm functions for credentials

Merge branch 'mh/reflife'Junio C Hamano Fri, 14 Jun 2013 15:46:13 +0000 (08:46 -0700)

Merge branch 'mh/reflife'

Define memory ownership and lifetime rules for what for-each-ref
feeds to its callbacks (in short, "you do not own it, so make a
copy if you want to keep it").

* mh/reflife: (25 commits)
refs: document the lifetime of the args passed to each_ref_fn
register_ref(): make a copy of the bad reference SHA-1
exclude_existing(): set existing_refs.strdup_strings
string_list_add_refs_by_glob(): add a comment about memory management
string_list_add_one_ref(): rename first parameter to "refname"
show_head_ref(): rename first parameter to "refname"
show_head_ref(): do not shadow name of argument
add_existing(): do not retain a reference to sha1
do_fetch(): clean up existing_refs before exiting
do_fetch(): reduce scope of peer_item
object_array_entry: fix memory handling of the name field
find_first_merges(): remove unnecessary code
find_first_merges(): initialize merges variable using initializer
fsck: don't put a void*-shaped peg in a char*-shaped hole
object_array_remove_duplicates(): rewrite to reduce copying
revision: use object_array_filter() in implementation of gc_boundary()
object_array: add function object_array_filter()
revision: split some overly-long lines
cmd_diff(): make it obvious which cases are exclusive of each other
cmd_diff(): rename local variable "list" -> "entry"
...

Merge branch 'kb/full-history-compute-treesame-carefully-2'Junio C Hamano Fri, 14 Jun 2013 15:45:59 +0000 (08:45 -0700)

Merge branch 'kb/full-history-compute-treesame-carefully-2'

Major update to the revision traversal logic to improve culling of
irrelevant parents while traversing a mergy history.

* kb/full-history-compute-treesame-carefully-2:
revision.c: make default history consider bottom commits
revision.c: don't show all merges for --parents
revision.c: discount side branches when computing TREESAME
revision.c: add BOTTOM flag for commits
simplify-merges: drop merge from irrelevant side branch
simplify-merges: never remove all TREESAME parents
t6012: update test for tweaked full-history traversal
revision.c: Make --full-history consider more merges
Documentation: avoid "uninteresting"
rev-list-options.txt: correct TREESAME for P
t6111: add parents to tests
t6111: allow checking the parents as well
t6111: new TREESAME test set
t6019: test file dropped in -s ours merge
decorate.c: compact table when growing

Merge branch 'rr/remove-contrib-some'Junio C Hamano Fri, 14 Jun 2013 15:45:57 +0000 (08:45 -0700)

Merge branch 'rr/remove-contrib-some'

Remove stale contrib/ material.

* rr/remove-contrib-some:
contrib: drop blameview/ directory
contrib: remove continuous/ and patches/

prompt: squelch error output from catRamkumar Ramachandra Fri, 14 Jun 2013 08:28:05 +0000 (13:58 +0530)

prompt: squelch error output from cat

The files $g/rebase-{merge,apply}/{head-name,msgnum,end} are not
guaranteed to exist. When attempting to cat them, squelch the error
output.

In addition to guarding against stray directories, this patch addresses
a real problem:

# on terminal 1
$ git rebase -i master
# ignore editor, and switch to terminal 2
cat: .git/rebase-merge/msgnum: No such file or directory
cat: .git/rebase-merge/end: No such file or directory
$

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

handle multibyte characters in nameFredrik Gustafsson Fri, 14 Jun 2013 00:26:02 +0000 (02:26 +0200)

handle multibyte characters in name

Many "git submodule" operations do not work on a submodule at a path whose
name is not in ASCII.

This is because "git ls-files" is used to find which paths are bound to
submodules to the current working tree, and the output is C-quoted by default
for non ASCII pathnames.

Tell "git ls-files" to not C-quote its output, which is easier than unwrapping
C-quote ourselves.

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

rebase: finish_rebase() in noop rebaseRamkumar Ramachandra Thu, 13 Jun 2013 16:06:13 +0000 (21:36 +0530)

rebase: finish_rebase() in noop rebase

In the following case

$ git rebase master
Current branch autostash-fix is up to date.

the autostash is not applied automatically, because this codepath
forgets to call finish_rebase(). Fix this. Also add a test to guard
against regressions.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: finish_rebase() in fast-forward rebaseRamkumar Ramachandra Thu, 13 Jun 2013 16:06:12 +0000 (21:36 +0530)

rebase: finish_rebase() in fast-forward rebase

In the following case

$ git rebase master
Fast-forwarded autostash-fix to master.

The autostash is not applied automatically, because this codepath
forgets to call finish_rebase(). Fix this. Also add a test to guard
against regressions.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase: guard against missing files in read_basic_state()Ramkumar Ramachandra Thu, 13 Jun 2013 16:06:11 +0000 (21:36 +0530)

rebase: guard against missing files in read_basic_state()

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

use logical OR (||) instead of binary OR (|) in logical... René Scharfe Thu, 13 Jun 2013 18:19:44 +0000 (20:19 +0200)

use logical OR (||) instead of binary OR (|) in logical context

The compiler can short-circuit the evaluation of conditions strung
together with logical OR operators instead of computing the resulting
bitmask with binary ORs. More importantly, this patch makes the
intent of the changed code clearer, because the logical context (as
opposed to binary context) becomes immediately obvious.

While we're at it, simplify the check for patch->is_rename in
builtin/apply.c a bit; it can only be 0 or 1, so we don't need a
comparison operator.

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

match-trees: factor out fill_tree_desc_strictRené Scharfe Thu, 13 Jun 2013 18:19:28 +0000 (20:19 +0200)

match-trees: factor out fill_tree_desc_strict

Deduplicate code by moving tree_desc initialization into a helper
function, fill_tree_desc_strict. It is like fill_tree_descriptor,
except that it only accepts tree hashes and no tree references (tags,
commits). No functional change.

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

rm: introduce advice.rmHints to shorten messagesMathieu Lienard--Mayor Wed, 12 Jun 2013 08:06:44 +0000 (10:06 +0200)

rm: introduce advice.rmHints to shorten messages

Introduce advice.rmHints to choose whether to display advice or not
when git rm fails. Defaults to true, in order to preserve current behavior.

As an example, the message:
error: 'foo.txt' has changes staged in the index
(use --cached to keep the file, or -f to force removal)

would look like, with advice.rmHints=false:
error: 'foo.txt' has changes staged in the index

Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>
Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rm: better error message on failure for multiple filesMathieu Lienard--Mayor Wed, 12 Jun 2013 08:06:43 +0000 (10:06 +0200)

rm: better error message on failure for multiple files

When 'git rm' fails, it now displays a single message
with the list of files involved, instead of displaying
a list of messages with one file each.

As an example, the old message:
error: 'foo.txt' has changes staged in the index
(use --cached to keep the file, or -f to force removal)
error: 'bar.txt' has changes staged in the index
(use --cached to keep the file, or -f to force removal)

would now be displayed as:
error: the following files have changes staged in the index:
foo.txt
bar.txt
(use --cached to keep the file, or -f to force removal)

Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>
Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix `git svn` `rebase` & `dcommit` if top-level HEAD... Slava Kardakov Wed, 5 Jun 2013 18:31:27 +0000 (11:31 -0700)

Fix `git svn` `rebase` & `dcommit` if top-level HEAD directory exist

When a file (or a directory) called HEAD exists in the working tree,
internal calls git svn makes trigger "did you mean a revision or a
path?" ambiguity check.

$ git svn rebase
fatal: ambiguous argument 'HEAD': both revision and filename
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
rev-list --first-parent --pretty=medium HEAD: command returned error: 128

Explicitly disambiguate by adding "--" after the revision.

Signed-off-by: Slava Kardakov <ojab@ojab.ru>
Reviewed-by: Jeff King <peff@peff.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib: drop blameview/ directoryJeff King Wed, 12 Jun 2013 19:49:56 +0000 (15:49 -0400)

contrib: drop blameview/ directory

Blameview was a quick-and-dirty demonstration of how blame's
incremental output could be used in an interface. These days
one can find much better (and less ugly!) demonstrations in
"git gui blame" and "tig blame".

The only advantage blameview has is that its code is perhaps
simpler to read. However, that is balanced by the fact that
it probably has bugs, as nobody uses it nor has touched the
code in 6 years. An implementor is probably better off just
reading the "incremental output" section of "man git-blame".

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

Move create_notes_commit() from notes-merge.c into... Johan Herland Wed, 12 Jun 2013 00:13:01 +0000 (02:13 +0200)

Move create_notes_commit() from notes-merge.c into notes-utils.c

create_notes_commit() is needed by both the notes-merge code, and by
commit_notes() in notes-utils. Since it is generally useful, and not
bound to the notes-merge machinery, we move it from (the more specific)
notes-merge to (the more general) notes-utils.

Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Move copy_note_for_rewrite + friends from builtin/notes... Johan Herland Wed, 12 Jun 2013 00:13:00 +0000 (02:13 +0200)

Move copy_note_for_rewrite + friends from builtin/notes.c to notes-utils.c

This is a pure code movement of the machinery for copying notes to
rewritten objects. This code was located in builtin/notes.c for
historical reasons. In order to make it available to builtin/commit.c
it was declared in builtin.h. This was more of an accident of history
than a concious design, and we now want to make this machinery more
widely available.

Hence, this patch moves the code into the new notes-utils.[hc] files
which are included into libgit.a. Except for adjusting #includes
accordingly, this patch merely moves the relevant functions verbatim
into the new files.

Cc: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

finish_copy_notes_for_rewrite(): Let caller provide... Johan Herland Wed, 12 Jun 2013 00:12:59 +0000 (02:12 +0200)

finish_copy_notes_for_rewrite(): Let caller provide commit message

When copying notes for a rewritten object, the resulting notes commit
would have the following hardcoded commit message:

Notes added by 'git notes copy'

This is obviously bogus when the notes rewriting is performed by
'git commit --amend'.

Therefore, let the caller specify an appropriate notes commit message
instead of hardcoding it. The above message is used for 'git notes copy',
but when calling finish_copy_notes_for_rewrite() from builtin/commit.c,
we use the following message instead:

Notes added by 'git commit --amend'

Cc: Thomas Rast <trast@inf.ethz.ch>
Signed-off-by: Johan Herland <johan@herland.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

status: introduce status.short to enable --short by... Jorge Juan Garcia Garcia Tue, 11 Jun 2013 13:34:04 +0000 (15:34 +0200)

status: introduce status.short to enable --short by default

Some people always run 'git status -s'.
The configuration variable status.short allows to set it by default.

Signed-off-by: Jorge Juan Garcia Garcia <Jorge-Juan.Garcia-Garcia@ensimag.imag.fr>
Signed-off-by: Mathieu Lienard--Mayor <Mathieu.Lienard--Mayor@ensimag.imag.fr>
Reviewed-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Matthieu Moy <Matthieu.Moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-remote-mediawiki: display message when launched... Célestin Matte Tue, 11 Jun 2013 13:38:48 +0000 (15:38 +0200)

git-remote-mediawiki: display message when launched directly

Users may be confused when they run the perl script directly.
A good way to detect this is to check the number of parameters used to call the
script, which is never different from 2 in a normal use.
Display a proper error message to avoid any confusion.

Signed-off-by: Célestin Matte <celestin.matte@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'maint'Junio C Hamano Tue, 11 Jun 2013 21:25:09 +0000 (14:25 -0700)

Merge branch 'maint'

* maint:
t0070 "mktemp to unwritable directory" needs SANITY
pre-push.sample: Make the script executable

Merge branch 'maint-1.8.2' into maintJunio C Hamano Tue, 11 Jun 2013 21:24:56 +0000 (14:24 -0700)

Merge branch 'maint-1.8.2' into maint

* maint-1.8.2:
t0070 "mktemp to unwritable directory" needs SANITY
pre-push.sample: Make the script executable

t0070 "mktemp to unwritable directory" needs SANITYTorsten Bögershausen Sat, 8 Jun 2013 12:17:49 +0000 (14:17 +0200)

t0070 "mktemp to unwritable directory" needs SANITY

Use the SANITY prerequisite when testing if a temp file can
be created in a read only directory.
Skip the test under CYGWIN, or skip it under Unix/Linux when
it is run as root.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notesJunio C Hamano Tue, 11 Jun 2013 20:50:12 +0000 (13:50 -0700)

Update draft release notes

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

Merge branch 'cm/gitweb-project-list-persistent-cgi... Junio C Hamano Tue, 11 Jun 2013 20:31:45 +0000 (13:31 -0700)

Merge branch 'cm/gitweb-project-list-persistent-cgi-fix'

"gitweb" forgot to clear a global variable $search_regexp upon each
request, mistakenly carrying over the previous search to a new one
when used as a persistent CGI.

* cm/gitweb-project-list-persistent-cgi-fix:
gitweb: fix problem causing erroneous project list

Merge branch 'rr/maint-fetch-tag-doc-asterisks'Junio C Hamano Tue, 11 Jun 2013 20:31:41 +0000 (13:31 -0700)

Merge branch 'rr/maint-fetch-tag-doc-asterisks'

* rr/maint-fetch-tag-doc-asterisks:
fetch-options.txt: prevent a wildcard refspec from getting misformatted

Merge branch 'rr/rebase-autostash'Junio C Hamano Tue, 11 Jun 2013 20:31:28 +0000 (13:31 -0700)

Merge branch 'rr/rebase-autostash'

* rr/rebase-autostash:
rebase: implement --[no-]autostash and rebase.autostash
rebase --merge: return control to caller, for housekeeping
rebase -i: return control to caller, for housekeeping
am: return control to caller, for housekeeping
rebase: prepare to do generic housekeeping
rebase -i: don't error out if $state_dir already exists
am: tighten a conditional that checks for $dotest

Merge branch 'jk/test-exit-code-by-signal'Junio C Hamano Tue, 11 Jun 2013 20:31:25 +0000 (13:31 -0700)

Merge branch 'jk/test-exit-code-by-signal'

* jk/test-exit-code-by-signal:
t0005: skip signal death exit code test on Windows
t0005: test git exit code from signal death

Merge branch 'fc/at-head'Junio C Hamano Tue, 11 Jun 2013 20:31:23 +0000 (13:31 -0700)

Merge branch 'fc/at-head'

Instead of typing four capital letters "HEAD", you can say "@"
instead.

* fc/at-head:
sha1_name: compare variable with constant, not constant with variable
Add new @ shortcut for HEAD
sha1_name: refactor reinterpret()
sha1_name: check @{-N} errors sooner
sha1_name: reorganize get_sha1_basic()
sha1_name: don't waste cycles in the @-parsing loop
sha1_name: remove unnecessary braces
sha1_name: remove no-op
tests: at-combinations: @{N} versus HEAD@{N}
tests: at-combinations: increase coverage
tests: at-combinations: improve nonsense()
tests: at-combinations: check ref names directly
tests: at-combinations: simplify setup

Merge branch 'ar/wildmatch-foldcase'Junio C Hamano Tue, 11 Jun 2013 20:31:21 +0000 (13:31 -0700)

Merge branch 'ar/wildmatch-foldcase'

The wildmatch engine did not honor WM_CASEFOLD option correctly.

* ar/wildmatch-foldcase:
wildmatch: properly fold case everywhere

Merge branch 'tr/sha1-file-silence-loose-object-info... Junio C Hamano Tue, 11 Jun 2013 20:31:19 +0000 (13:31 -0700)

Merge branch 'tr/sha1-file-silence-loose-object-info-under-prune-race'

* tr/sha1-file-silence-loose-object-info-under-prune-race:
sha1_file: silence sha1_loose_object_info

Merge branch 'nd/warn-ambiguous-object-name'Junio C Hamano Tue, 11 Jun 2013 20:31:07 +0000 (13:31 -0700)

Merge branch 'nd/warn-ambiguous-object-name'

"git cmd <name>", when <name> happens to be a 40-hex string,
directly uses the 40-hex string as an object name, even if a ref
"refs/<some hierarchy>/<name>" exists. This disambiguation order
is unlikely to change, but we should warn about the ambiguity just
like we warn when more than one refs/ hierachies share the same
name.

* nd/warn-ambiguous-object-name:
get_sha1: warn about full or short object names that look like refs

Merge branch 'rr/diffcore-pickaxe-doc'Junio C Hamano Tue, 11 Jun 2013 20:31:04 +0000 (13:31 -0700)

Merge branch 'rr/diffcore-pickaxe-doc'

Update the low-level diffcore documentation on -S/-G and --pickaxe-all.

* rr/diffcore-pickaxe-doc:
diffcore-pickaxe doc: document -S and -G properly
diffcore-pickaxe: make error messages more consistent

Merge branch 'cr/git-work-tree-sans-git-dir'Junio C Hamano Tue, 11 Jun 2013 20:31:01 +0000 (13:31 -0700)

Merge branch 'cr/git-work-tree-sans-git-dir'

These days, "git --work-tree=there cmd" without specifying an
explicit --git-dir=here will do the usual discovery, but we had a
description of older behaviour in the documentation.

* cr/git-work-tree-sans-git-dir:
git.txt: remove stale comment regarding GIT_WORK_TREE

Merge branch 'mm/mediawiki-https-fail-message'Junio C Hamano Tue, 11 Jun 2013 20:30:43 +0000 (13:30 -0700)

Merge branch 'mm/mediawiki-https-fail-message'

Hint users when https:// connection failed to check the certificate.

* mm/mediawiki-https-fail-message:
git-remote-mediawiki: better error message when HTTP(S) access fails

Merge branch 'cb/log-follow-with-combined'Junio C Hamano Tue, 11 Jun 2013 20:30:36 +0000 (13:30 -0700)

Merge branch 'cb/log-follow-with-combined'

* cb/log-follow-with-combined:
fix segfault with git log -c --follow

Merge branch 'xq/credential-osxkeychain'Junio C Hamano Tue, 11 Jun 2013 20:30:31 +0000 (13:30 -0700)

Merge branch 'xq/credential-osxkeychain'

* xq/credential-osxkeychain:
credential-osxkeychain: support more protocols

Merge branch 'fc/do-not-use-the-index-in-add-to-index'Junio C Hamano Tue, 11 Jun 2013 20:30:28 +0000 (13:30 -0700)

Merge branch 'fc/do-not-use-the-index-in-add-to-index'

* fc/do-not-use-the-index-in-add-to-index:
read-cache: trivial style cleanups
read-cache: fix wrong 'the_index' usage

Merge branch 'fc/remote-bzr'Junio C Hamano Tue, 11 Jun 2013 20:30:26 +0000 (13:30 -0700)

Merge branch 'fc/remote-bzr'

* fc/remote-bzr:
remote-bzr: add fallback check for a partial clone
remote-bzr: reorganize the way 'wanted' works
remote-bzr: trivial cleanups
remote-bzr: change global repo
remote-bzr: delay cloning/pulling
remote-bzr: simplify get_remote_branch()
remote-bzr: fix for files with spaces
remote-bzr: recover from failed clones

Merge branch 'fc/remote-hg'Junio C Hamano Tue, 11 Jun 2013 20:30:24 +0000 (13:30 -0700)

Merge branch 'fc/remote-hg'

* fc/remote-hg: (50 commits)
remote-hg: add support for --force
remote-hg: add support for --dry-run
remote-hg: check if a fetch is needed
remote-hg: trivial cleanup
remote-helpers: improve marks usage
remote-hg: add check_push() helper
remote-hg: add setup_big_push() helper
remote-hg: remove files before modifications
remote-hg: improve lightweight tag author
remote-hg: use remote 'default' not local one
remote-hg: improve branch listing
remote-hg: simplify branch_tip()
remote-hg: check diverged bookmarks
remote-hg: pass around revision refs
remote-hg: implement custom checkheads()
remote-hg: implement custom push()
remote-hg: only update necessary revisions
remote-hg: force remote bookmark push selectively
remote-hg: reorganize bookmark handling
remote-hg: add test for failed double push
...

Merge branch 'rj/mingw-cygwin'Junio C Hamano Tue, 11 Jun 2013 20:30:20 +0000 (13:30 -0700)

Merge branch 'rj/mingw-cygwin'

Update build for Cygwin 1.[57]. Torsten Bögershausen reports that
this is fine with Cygwin 1.7 ($gmane/225824) so let's try moving it
ahead.

* rj/mingw-cygwin:
cygwin: Remove the CYGWIN_V15_WIN32API build variable
mingw: rename WIN32 cpp macro to GIT_WINDOWS_NATIVE

Merge branch 'fc/completion-less-ls-remote'Junio C Hamano Tue, 11 Jun 2013 20:30:16 +0000 (13:30 -0700)

Merge branch 'fc/completion-less-ls-remote'

* fc/completion-less-ls-remote:
completion: avoid ls-remote in certain scenarios

Merge branch 'tr/test-commit-only-on-orphan'Junio C Hamano Tue, 11 Jun 2013 20:30:12 +0000 (13:30 -0700)

Merge branch 'tr/test-commit-only-on-orphan'

* tr/test-commit-only-on-orphan:
Test 'commit --only' after 'checkout --orphan'

Merge branch 'rs/unpack-trees-plug-leak'Junio C Hamano Tue, 11 Jun 2013 20:30:05 +0000 (13:30 -0700)

Merge branch 'rs/unpack-trees-plug-leak'

* rs/unpack-trees-plug-leak:
unpack-trees: free cache_entry array members for merges
diff-lib, read-tree, unpack-trees: mark cache_entry array paramters const
diff-lib, read-tree, unpack-trees: mark cache_entry pointers const
unpack-trees: create working copy of merge entry in merged_entry
unpack-trees: factor out dup_entry
read-cache: mark cache_entry pointers const
cache: mark cache_entry pointers const

Merge branch 'rr/die-on-missing-upstream'Junio C Hamano Tue, 11 Jun 2013 20:29:58 +0000 (13:29 -0700)

Merge branch 'rr/die-on-missing-upstream'

When a reflog notation is used for implicit "current branch", we
did not say which branch and worse said "branch ''".

* rr/die-on-missing-upstream:
sha1_name: fix error message for @{<N>}, @{<date>}
sha1_name: fix error message for @{u}

pre-push.sample: Make the script executableWieland Hoffmann Tue, 11 Jun 2013 12:14:56 +0000 (14:14 +0200)

pre-push.sample: Make the script executable

githooks(5) says that "[...]the .sample files are executable by default"
which was not true.

Signed-off-by: Wieland Hoffmann <themineo@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 1.8.3.1Junio C Hamano Mon, 10 Jun 2013 19:35:32 +0000 (12:35 -0700)

Sync with 1.8.3.1

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

Git 1.8.3.1 v1.8.3.1Junio C Hamano Mon, 10 Jun 2013 00:16:20 +0000 (17:16 -0700)

Git 1.8.3.1

Primarily to push out two regression issues that seem to affect many
people, namely, the ".gitignore !directory" bug and "daemon cannot
read from $HOME owned by root" bug.

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

mingw: make mingw_signal return the correct handlerErik Faye-Lund Mon, 10 Jun 2013 05:48:17 +0000 (07:48 +0200)

mingw: make mingw_signal return the correct handler

Returning the SIGALRM handler for SIGINT is not very useful.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

make color.ui default to 'auto'Matthieu Moy Mon, 10 Jun 2013 14:26:09 +0000 (16:26 +0200)

make color.ui default to 'auto'

Most users seem to like having colors enabled, and colors can help
beginners to understand the output of some commands (e.g. notice
immediately the boundary between commits in the output of "git log").

Many tutorials tell the users to set color.ui=auto as a very first step,
which tend to indicate that color.ui=none is not the recommanded value,
hence should not be the default.

These tutorials would benefit from skipping this step and starting the
real Git manipulations earlier. Other beginners do not know about
color.ui=auto, and may not discover it by themselves, hence live with
black&white outputs while they may have preferred colors.

A few people (e.g. color-blind) prefer having no colors, but they can
easily set color.ui=never for this (and googling "disable colors in git"
already tells them how to do so), but this needs not occupy space in
beginner-oriented documentations.

A transition period with Git emitting a warning when color.ui is unset
would be possible, but the discomfort of having the warning seems
superior to the benefit: users may be surprised by the change, but not
harmed by it.

The default value is changed, and the documentation is reworded to
mention "color.ui=false" first, since the primary use of color.ui after
this change is to disable colors, not to enable it.

Signed-off-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jn/config-ignore-inaccessible' into maintJunio C Hamano Mon, 10 Jun 2013 00:06:55 +0000 (17:06 -0700)

Merge branch 'jn/config-ignore-inaccessible' into maint

A git daemon that starts as "root" and then drops privilege often
leaves $HOME set to that of the root user, which is unreadable by
the daemon process, which was diagnosed as a configuration error.

Make per-user configuration files that are inaccessible due to
EACCES as though these files do not exist to avoid this issue, as
the tightening which was originally meant as an additional security
has annoyed enough sysadmins.

* jn/config-ignore-inaccessible:
config: allow inaccessible configuration under $HOME

Merge branch 'kb/status-ignored-optim-2' into maintJunio C Hamano Mon, 10 Jun 2013 00:05:15 +0000 (17:05 -0700)

Merge branch 'kb/status-ignored-optim-2' into maint

Fix recent regression of .gitignore files that list !directory to
mark it not-ignored.

* kb/status-ignored-optim-2:
dir.c: fix ignore processing within not-ignored directories

read-cache: free cache in discard_indexRené Scharfe Sun, 9 Jun 2013 17:39:18 +0000 (19:39 +0200)

read-cache: free cache in discard_index

discard_cache doesn't have to free the array of cache entries, because
the next call of read_cache can simply reuse it, as they all operate on
the global variable the_index.

discard_index on the other hand does have to free it, because it can be
used e.g. with index_state variables on the stack, in which case a
missing free would cause an unrecoverable leak. This patch releases the
memory and removes a comment that was relevant for discard_cache but has
become outdated.

Since discard_cache is just a wrapper around discard_index nowadays, we
lose the optimization that avoids reallocation of that array within
loops of read_cache and discard_cache. That doesn't cause a performance
regression for me, however (HEAD = this patch, HEAD^ = master + p0002):

Test // HEAD^ HEAD
---------------\\-----------------------------------------------------
0002.1: read_ca// 1000 times 0.62(0.58+0.04) 0.61(0.58+0.02) -1.6%

Suggested-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: René Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read-cache: add simple performance testRené Scharfe Sun, 9 Jun 2013 17:39:17 +0000 (19:39 +0200)

read-cache: add simple performance test

Add the helper test-read-cache, which can be used to call read_cache and
discard_cache in a loop as well as a performance check based on it.

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

test: test_must_be_empty helperJunio C Hamano Sun, 9 Jun 2013 18:29:20 +0000 (11:29 -0700)

test: test_must_be_empty helper

There are quite a lot places where an output file is expected to be
empty, and we fail the test when it is not. The output from running
the test script with -i -v can be helped if we showed the unexpected
contents at that point.

We could of course do

>expected.empty && test_cmp expected.empty actual

but this is commmon enough to be done with a dedicated helper.

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

git.txt: document GIT_TRACE_PACKETNguyễn Thái Ngọc Duy Sun, 9 Jun 2013 05:22:49 +0000 (12:22 +0700)

git.txt: document GIT_TRACE_PACKET

"This can help with debugging object negotiation or other protocol
issues."

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

core: use env variable instead of config var to turn... Nguyễn Thái Ngọc Duy Sun, 9 Jun 2013 05:22:48 +0000 (12:22 +0700)

core: use env variable instead of config var to turn on logging pack access

5f44324 (core: log offset pack data accesses happened - 2011-07-06)
provides a way to observe pack access patterns via a config
switch. Setting an environment variable looks more obvious than a
config var, especially when you just need to _observe_, and more
inline with other tracing knobs we have.

Document it as it may be useful for remote troubleshooting.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: show can take both revlist and pathsRamkumar Ramachandra Sun, 2 Jun 2013 14:03:42 +0000 (19:33 +0530)

completion: show can take both revlist and paths

The 'git show' completion uses __git_complete_file (aliased to
__git_complete_revlist_file), because accepts <tree-ish>:<path> as
well as <commit-ish>. But the command also accepts range of commits
in A..B notation, so using __git_complete_revlist_file is more
appropriate.

There still remain two users of __git_complete_file, completions for
"archive" and "ls-tree". As these commands do not take range
notation, and "git show" no longer uses __git_complete_file, the
implementation of it can be updated not to complete ranges, but that
is a separate topic.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: use $^ to avoid listing prerequisites on... Felipe Contreras Sat, 8 Jun 2013 22:38:58 +0000 (17:38 -0500)

Makefile: use $^ to avoid listing prerequisites on the command line

There's no need to list again the prerequisites.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: remove redundant check for the_index.initializedRené Scharfe Sun, 9 Jun 2013 16:33:45 +0000 (18:33 +0200)

submodule: remove redundant check for the_index.initialized

read_cache already performs the same check and returns immediately if
the cache has already been loaded.

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

Document .git/modulesFredrik Gustafsson Sun, 9 Jun 2013 11:11:36 +0000 (13:11 +0200)

Document .git/modules

A note in the beginning of this document describes the behavior already.
This patch just adds where to find the repositories.

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

build: do not install git-remote-testgitFelipe Contreras Fri, 7 Jun 2013 22:03:07 +0000 (17:03 -0500)

build: do not install git-remote-testgit

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

build: generate and clean test scriptsFelipe Contreras Fri, 7 Jun 2013 22:03:06 +0000 (17:03 -0500)

build: generate and clean test scripts

Commit 416fda6 (build: do not install git-remote-testpy) made it so
git-remote-testpy is not only not installed, but also not generated
by default. From a fresh checkout, "make --test=5800 test" would
have failed.

This was not found primarily because "make clean" failed to remove
git-remote-testpy, which is another bug in the same commit.

Fix the former by having 'all' target depend on $(NO_INSTALL) and
the latter by removing $(NO_INSTALL) in the 'clean' target.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'js/transport-helper-error-reporting-fix... Junio C Hamano Fri, 7 Jun 2013 23:15:32 +0000 (16:15 -0700)

Merge branch 'js/transport-helper-error-reporting-fix' into fc/makefile

* js/transport-helper-error-reporting-fix:
git-remote-testgit: build it to run under $SHELL_PATH
git-remote-testgit: further remove some bashisms
git-remote-testgit: avoid process substitution
t5801: "VAR=VAL shell_func args" is forbidden
transport-helper: update remote helper namespace
transport-helper: trivial code shuffle
transport-helper: warn when refspec is not used
transport-helper: clarify pushing without refspecs
transport-helper: update refspec documentation
transport-helper: clarify *:* refspec
transport-helper: improve push messages
transport-helper: mention helper name when it dies
transport-helper: report errors properly

Conflicts:
t/t5801-remote-helpers.sh

git-gui: fix file name handling with non-empty prefixJohn Keeping Sat, 27 Apr 2013 13:24:16 +0000 (14:24 +0100)

git-gui: fix file name handling with non-empty prefix

Commit e3d06ca (git-gui: Detect full path when parsing arguments -
2012-10-02) fixed the handling of absolute paths passed to the browser
and blame subcommands by checking whether the file exists without the
prefix before prepending the prefix and checking again. Since we have
chdir'd to the top level of the working tree before doing this, this
does not work if a file with the same name exists in a subdirectory and
at the top level (for example Makefile in git.git's t/ directory).

Instead of doing this, revert that patch and fix absolute path issue by
using "file join" to prepend the prefix to the supplied path. This will
correctly handle absolute paths by skipping the prefix in that case.

Acked-by: Andrew Wong <andrew.kw.w@gmail.com>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>