gitweb.git
bash prompt: use bash builtins to check stash stateSZEDER Gábor Fri, 1 Apr 2011 15:47:37 +0000 (17:47 +0200)

bash prompt: use bash builtins to check stash state

When the environment variable $GIT_PS1_SHOWSTASHSTATE is set
__git_ps1() checks the presence of stashes by running 'git rev-parse
--verify refs/stash'. This command not only checks that the
'refs/stash' ref exists but also, well, verifies that it's a valid
ref.

However, we don't need to be that thorough for the bash prompt. We
can omit that verification and only check whether 'refs/stash' exists
or not. Since 'git pack-refs' never packs 'refs/stash', it's a matter
of checking the existence of a ref file. Perform this check using
only bash builtins to spare the overhead of fork()+exec()ing a git
process.

Also run 'git pack-refs --all' in the corresponding test to document
that the prompt script depends on 'git pack-refs' not packing
'refs/stash' and to catch possible breakages should this behavior ever
change.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

bash prompt: use bash builtins to check for unborn... SZEDER Gábor Mon, 24 Jun 2013 10:49:19 +0000 (12:49 +0200)

bash prompt: use bash builtins to check for unborn branch for dirty state

When the dirty work tree and index status indicator is enabled,
__git_ps1() checks for changes in the index by running 'git diff-index
--cached --quiet HEAD --' and looking at its exit code. However, that
makes sense only when HEAD points to a valid commit: on an unborn
branch the failure of said command would be caused by the invalid
HEAD, not by changes in the index. Therefore, __git_ps1() first
checks for a valid HEAD by running 'git rev-parse --quiet --verify
HEAD'.

Since the previous patch we implicitly check HEAD's validity by
running 'git rev-parse ... --short HEAD', making the dirty status
indicator's 'git rev-parse' check redundant. It's sufficient to check
for non-emptyness of the variable holding the abbreviated commit
object name, thereby sparing the overhead of fork()+exec()ing a git
process.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

bash prompt: combine 'git rev-parse' for detached headSZEDER Gábor Mon, 24 Jun 2013 00:16:02 +0000 (02:16 +0200)

bash prompt: combine 'git rev-parse' for detached head

When describing a detached HEAD according to the $GIT_PS1_DESCRIBE
environment variable fails, __git_ps1() now runs the '$(git rev-parse
--short HEAD)' command substitution to get the abbreviated detached
HEAD commit object name. This imposes the overhead of fork()ing a
subshell and fork()+exec()ing a git process.

Avoid this overhead by combining this command substitution with the
"main" 'git rev-parse' execution for getting the path to the .git
directory & co. This means that we'll look for the abbreviated commit
object name even when it's not necessary, because we're on a branch or
the detached HEAD can be described. It doesn't matter, however,
because once 'git rev-parse' is up and running to fulfill all those
other queries, the additional overhead of looking for the abbreviated
commit object name is not measurable because it's lost in the noise.

There is a caveat, however, when we are on an unborn branch, because
in that case HEAD doesn't point to a valid commit, hence the query for
the abbreviated commit object name fails. Therefore, '--short HEAD'
must be the last options to 'git rev-parse' in order to get all the
other necessary information for the prompt even on an unborn branch.
Furthermore, in that case, and in that case only, 'git rev-parse'
doesn't output the last line containing the abbreviated commit object
name, obviously, so we have to take care to only parse it if 'git
rev-parse' exited without any error.

Although there are tests already excercising __git_ps1() on unborn
branches, they all do so implicitly. Add a test that checks this
explicitly.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

bash prompt: combine 'git rev-parse' executions in... SZEDER Gábor Mon, 17 Jun 2013 20:58:42 +0000 (22:58 +0200)

bash prompt: combine 'git rev-parse' executions in the main code path

There are a couple of '$(git rev-parse --<opt>)' command substitutions
in __git_ps1() and three of them are executed in the main code path:

- the first to get the path to the .git directory ('--git-dir'),
- the second to check whether we're inside the .git directory
('--is-inside-git-dir'),
- and the last, depending on the results of the second, either
* to check whether it's a bare repo ('--is-bare-repository'), or
* to check whether inside a work tree ('--is-inside-work-tree').

Naturally, this imposes the overhead of fork()ing three subshells and
fork()+exec()ing three git commands.

Combine these four 'git rev-parse' queries into a single one and use
bash parameter expansions to parse the combined output, i.e. to
separate the path to the .git directory from the true/false of
'--is-inside-git-dir', etc. This way we can eliminate two of the
three subshells and git commands.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

bash prompt: use bash builtins to find out current... SZEDER Gábor Thu, 31 Mar 2011 21:41:18 +0000 (23:41 +0200)

bash prompt: use bash builtins to find out current branch

__git_ps1() runs the '$(git symbolic-ref HEAD)' command substitution
to find out whether we are on a branch and to find out the name of
that branch. This imposes the overhead of fork()ing a subshell and
fork()+exec()ing a git process.

Since HEAD is in most cases a single-line file and the symbolic ref
format is quite simple to recognize and parse, read and parse it using
only bash builtins, thereby sparing all that fork()+exec() overhead.
Don't display the git prompt if reading HEAD fails, because a readable
HEAD is required for a git repository. HEAD can also be a symlink
symbolic ref (due to 'core.preferSymlinkRefs'), so use bash builtins
for reading HEAD only when HEAD is not a symlink.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

bash prompt: use bash builtins to find out rebase stateSZEDER Gábor Thu, 31 Mar 2011 22:25:16 +0000 (00:25 +0200)

bash prompt: use bash builtins to find out rebase state

During an ongoing interactive rebase __git_ps1() finds out the name of
the rebased branch, the total number of patches and the number of the
current patch by executing a '$(cat .git/rebase-merge/<FILE>)' command
substitution for each. That is not quite the most efficient way to
read single line single word files, because it imposes the overhead of
fork()ing a subshell and fork()+exec()ing 'cat' several times.

Use the 'read' bash builtin instead to avoid those overheads.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

bash prompt: run 'git rev-parse --git-dir' directly... SZEDER Gábor Mon, 17 Jun 2013 21:55:16 +0000 (23:55 +0200)

bash prompt: run 'git rev-parse --git-dir' directly instead of __gitdir()

__git_ps1() finds out the path to the repository by using the
__gitdir() helper function. __gitdir() is basically just a wrapper
around 'git rev-parse --git-dir', extended with support for
recognizing a remote repository given as argument, to use the path
given on the command line, and with a few shortcuts to recognize a git
repository in cwd or at $GIT_DIR quickly without actually running 'git
rev-parse'. However, the former two is only necessary for the
completion script but makes no sense for the bash prompt, while the
latter shortcuts are performance optimizations __git_ps1() can do
without (they just avoid the overhead of fork()+exec()ing a git
process).

Run 'git rev-parse --git-dir' directly in __git_ps1(), because it will
allow this patch series to combine several $(git rev-parse ...)
command substitutions in the main code path, and the overall
performance benefit will far outweigh the loss of those few shortcuts
in __gitdir(). Furthermore, since __gitdir() is not needed anymore
for the prompt, remove it from the prompt script finally eliminating
its duplication between the prompt and completion scripts. Also
remove the comment from the completion script warning about this code
duplication.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

bash prompt: return early from __git_ps1() when not... SZEDER Gábor Mon, 5 Sep 2011 18:53:37 +0000 (20:53 +0200)

bash prompt: return early from __git_ps1() when not in a git repository

... to gain one level of indentation for the bulk of the function.

(The patch looks quite unreadable, you'd better check it with 'git
diff -w'.)

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

bash prompt: print unique detached HEAD abbreviated... SZEDER Gábor Sun, 23 Jun 2013 23:55:42 +0000 (01:55 +0200)

bash prompt: print unique detached HEAD abbreviated object name

When describing a detached HEAD according to the $GIT_PS1_DESCRIBE
environment variable fails, __git_ps1() runs 'cut -c1-7 .git/HEAD' to
show the 7 hexdigits abbreviated commit object name in the prompt.
Obviously, this neither respects core.abbrev nor produces a unique
object name.

Fix this by using 'git rev-parse --short HEAD' instead and adjust the
corresponding test to use non-standard number of hexdigits.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

bash prompt: add a test for symbolic link symbolic... SZEDER Gábor Fri, 24 Aug 2012 17:52:48 +0000 (19:52 +0200)

bash prompt: add a test for symbolic link symbolic refs

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

completion, bash prompt: move __gitdir() tests to compl... SZEDER Gábor Mon, 17 Jun 2013 18:31:51 +0000 (20:31 +0200)

completion, bash prompt: move __gitdir() tests to completion test suite

Currently __gitdir() is duplicated in the git completion and prompt
scripts, while its tests are in the prompt test suite. This patch
series is about to change __git_ps1() in a way that it won't need
__gitdir() anymore and __gitdir() will be removed from the prompt
script.

So move all __gitdir() tests from the prompt test suite over to the
completion test suite. Update the setup tests so that they perform
only those steps that are necessary for each test suite.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

bash prompt: use 'write_script' helper in interactive... SZEDER Gábor Fri, 24 Aug 2012 18:03:58 +0000 (20:03 +0200)

bash prompt: use 'write_script' helper in interactive rebase test

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

bash prompt: fix redirection coding style in testsSZEDER Gábor Mon, 17 Jun 2013 20:34:16 +0000 (22:34 +0200)

bash prompt: fix redirection coding style in tests

Use '>file' instead of '> file', in accordance with the coding
guidelines.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>

Update draft release notes to 1.8.4Junio C Hamano Sun, 23 Jun 2013 21:55:45 +0000 (14:55 -0700)

Update draft release notes to 1.8.4

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

Merge branch 'mz/rebase-tests'Junio C Hamano Sun, 23 Jun 2013 21:53:26 +0000 (14:53 -0700)

Merge branch 'mz/rebase-tests'

* mz/rebase-tests:
rebase topology tests: fix commit names on case-insensitive file systems
tests: move test for rebase messages from t3400 to t3406
t3406: modernize style
add tests for rebasing merged history
add tests for rebasing root
add tests for rebasing of empty commits
add tests for rebasing with patch-equivalence present
add simple tests of consistency across rebase types

Merge branch 'jk/unpack-entry-fallback-to-another'Junio C Hamano Sun, 23 Jun 2013 21:53:20 +0000 (14:53 -0700)

Merge branch 'jk/unpack-entry-fallback-to-another'

* jk/unpack-entry-fallback-to-another:
unpack_entry: do not die when we fail to apply a delta
t5303: drop "count=1" from corruption dd

Merge branch 'jk/apache-test-for-2.4'Junio C Hamano Sun, 23 Jun 2013 21:53:17 +0000 (14:53 -0700)

Merge branch 'jk/apache-test-for-2.4'

* jk/apache-test-for-2.4:
lib-httpd/apache.conf: check version only after mod_version loads
t/lib-httpd/apache.conf: configure an MPM module for apache 2.4
t/lib-httpd/apache.conf: load compat access module in apache 2.4
t/lib-httpd/apache.conf: load extra auth modules in apache 2.4
t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4

Merge branch 'cm/remote-mediawiki-perlcritique'Junio C Hamano Sun, 23 Jun 2013 21:53:13 +0000 (14:53 -0700)

Merge branch 'cm/remote-mediawiki-perlcritique'

* cm/remote-mediawiki-perlcritique: (31 commits)
git-remote-mediawiki: make error message more precise
git-remote-mediawiki: add a perlcritic rule in Makefile
git-remote-mediawiki: add a .perlcriticrc file
git-remote-mediawiki: clearly rewrite double dereference
git-remote-mediawiki: fix a typo ("mediwiki" instead of "mediawiki")
git-remote-mediawiki: put non-trivial numeric values in constants.
git-remote-mediawiki: don't use quotes for empty strings
git-remote-mediawiki: replace "unless" statements with negated "if" statements
git-remote-mediawiki: brace file handles for print for more clarity
git-remote-mediawiki: modify strings for a better coding-style
git-remote-mediawiki: put long code into a subroutine
git-remote-mediawiki: remove import of unused open2
git-remote-mediawiki: check return value of open
git-remote-mediawiki: assign a variable as undef and make proper indentation
git-remote-mediawiki: rename a variable ($last) which has the name of a keyword
git-remote-mediawiki: remove unused variable $entry
git-remote-mediawiki: turn double-negated expressions into simple expressions
git-remote-mediawiki: change the name of a variable
git-remote-mediawiki: add newline in the end of die() error messages
git-remote-mediawiki: change style in a regexp
...

Merge branch 'bp/remote-mw-tests'Junio C Hamano Sun, 23 Jun 2013 21:53:11 +0000 (14:53 -0700)

Merge branch 'bp/remote-mw-tests'

* bp/remote-mw-tests:
git-remote-mediawiki: remove hardcoded version number in the test suite

Merge branch 'rr/rebase-autostash'Junio C Hamano Sun, 23 Jun 2013 21:53:07 +0000 (14:53 -0700)

Merge branch 'rr/rebase-autostash'

* rr/rebase-autostash:
rebase: finish_rebase() in noop rebase
rebase: finish_rebase() in fast-forward rebase
rebase: guard against missing files in read_basic_state()

Merge branch 'rr/prompt-rebase-breakage-fix'Junio C Hamano Sun, 23 Jun 2013 21:53:05 +0000 (14:53 -0700)

Merge branch 'rr/prompt-rebase-breakage-fix'

* rr/prompt-rebase-breakage-fix:
prompt: squelch error output from cat

Merge branch 'jg/status-config'Junio C Hamano Sun, 23 Jun 2013 21:51:58 +0000 (14:51 -0700)

Merge branch 'jg/status-config'

"git status" learned status.branch and status.short configuration
variables to use --branch and --short options by default (override
with --no-branch and --no-short options from the command line).

* jg/status-config:
status: introduce status.branch to enable --branch by default
status: introduce status.short to enable --short by default

lib-httpd/apache.conf: check version only after mod_ver... Jeff King Fri, 21 Jun 2013 18:12:51 +0000 (14:12 -0400)

lib-httpd/apache.conf: check version only after mod_version loads

Commit 0442743 introduced an <IfVersion> directive near the
top of the apache config file. However, at that point we
have not yet checked for and loaded the mod_version module.
This means that the directive will behave oddly if
mod_version is dynamically loaded, failing to match when it
should.

We can fix this by moving the whole block below the
LoadModule directive for mod_version.

Reported-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with maintJunio C Hamano Fri, 21 Jun 2013 18:26:41 +0000 (11:26 -0700)

Sync with maint

* maint:
completion: complete diff --word-diff

transport-helper: be quiet on read errors from helpersJeff King Fri, 21 Jun 2013 07:05:39 +0000 (03:05 -0400)

transport-helper: be quiet on read errors from helpers

Prior to commit 81d340d4, we did not print any error message
if a remote transport helper died unexpectedly. If a helper
did not print any error message (e.g., because it crashed),
the user could be left confused. That commit tried to
rectify the situation by printing a note that the helper
exited unexpectedly.

However, this makes a much more common case worse: when a
helper does die with a useful message, we print the extra
"Reading from 'git-remote-foo failed" message. This can also
end up confusing users, as they may not even know what
remote helpers are (e.g., the fact that http support comes
through git-remote-https is purely an implementation detail
that most users do not know or care about).

Since we do not have a good way of knowing whether the
helper printed a useful error, and since the common failure
mode is for it to do so, let's default to remaining quiet.
Debuggers can dig further by setting GIT_TRANSPORT_HELPER_DEBUG.

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

completion: complete diff --word-diffRamkumar Ramachandra Tue, 18 Jun 2013 19:24:05 +0000 (00:54 +0530)

completion: complete diff --word-diff

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

Update draft release notes to 1.8.4Junio C Hamano Thu, 20 Jun 2013 23:13:41 +0000 (16:13 -0700)

Update draft release notes to 1.8.4

Merge branch 'cm/remote-mediawiki'Junio C Hamano Thu, 20 Jun 2013 23:02:42 +0000 (16:02 -0700)

Merge branch 'cm/remote-mediawiki'

* cm/remote-mediawiki:
git-remote-mediawiki: display message when launched directly

Merge branch 'rs/match-trees-refactor'Junio C Hamano Thu, 20 Jun 2013 23:02:40 +0000 (16:02 -0700)

Merge branch 'rs/match-trees-refactor'

Code cleanup.

* rs/match-trees-refactor:
match-trees: factor out fill_tree_desc_strict

Merge branch 'rs/logical-vs-binary-or'Junio C Hamano Thu, 20 Jun 2013 23:02:38 +0000 (16:02 -0700)

Merge branch 'rs/logical-vs-binary-or'

Code cleanup.

* rs/logical-vs-binary-or:
use logical OR (||) instead of binary OR (|) in logical context

Merge branch 'mm/color-auto-default'Junio C Hamano Thu, 20 Jun 2013 23:02:33 +0000 (16:02 -0700)

Merge branch 'mm/color-auto-default'

Flip the default for color.ui to 'auto', which is what many
tutorials recommend new users to do.

* mm/color-auto-default:
make color.ui default to 'auto'
config: refactor management of color.ui's default value

Merge branch 'rs/discard-index-discard-array'Junio C Hamano Thu, 20 Jun 2013 23:02:30 +0000 (16:02 -0700)

Merge branch 'rs/discard-index-discard-array'

* rs/discard-index-discard-array:
read-cache: free cache in discard_index
read-cache: add simple performance test

Merge branch 'nd/traces'Junio C Hamano Thu, 20 Jun 2013 23:02:28 +0000 (16:02 -0700)

Merge branch 'nd/traces'

* nd/traces:
git.txt: document GIT_TRACE_PACKET
core: use env variable instead of config var to turn on logging pack access

Merge branch 'fc/show-non-empty-errors-in-test'Junio C Hamano Thu, 20 Jun 2013 23:02:24 +0000 (16:02 -0700)

Merge branch 'fc/show-non-empty-errors-in-test'

* fc/show-non-empty-errors-in-test:
test: test_must_be_empty helper

Merge branch 'fc/makefile'Junio C Hamano Thu, 20 Jun 2013 23:02:21 +0000 (16:02 -0700)

Merge branch 'fc/makefile'

Makefile simplification.

* fc/makefile:
Makefile: use $^ to avoid listing prerequisites on the command line
build: do not install git-remote-testgit
build: generate and clean test scripts

Merge branch 'js/test-ln-s-add'Junio C Hamano Thu, 20 Jun 2013 23:02:18 +0000 (16:02 -0700)

Merge branch 'js/test-ln-s-add'

Many tests that check the behaviour of symbolic links stored in the
index or the tree objects do not have to be skipped on a filesystem
that lack symbolic link support.

* js/test-ln-s-add:
t4011: remove SYMLINKS prerequisite
t6035: use test_ln_s_add to remove SYMLINKS prerequisite
t3509, t4023, t4114: use test_ln_s_add to remove SYMLINKS prerequisite
t3100: use test_ln_s_add to remove SYMLINKS prerequisite
t3030: use test_ln_s_add to remove SYMLINKS prerequisite
t0000: use test_ln_s_add to remove SYMLINKS prerequisite
tests: use test_ln_s_add to remove SYMLINKS prerequisite (trivial cases)
tests: introduce test_ln_s_add
t3010: modernize style
test-chmtime: Fix exit code on Windows

Merge branch 'nd/make-wildmatch-default'Junio C Hamano Thu, 20 Jun 2013 23:02:14 +0000 (16:02 -0700)

Merge branch 'nd/make-wildmatch-default'

* nd/make-wildmatch-default:
Makefile: promote wildmatch to be the default fnmatch implementation

rebase topology tests: fix commit names on case-insensi... Johannes Sixt Tue, 18 Jun 2013 07:28:07 +0000 (09:28 +0200)

rebase topology tests: fix commit names on case-insensitive file systems

The recently introduced tests used uppercase letters to denote
cherry-picks of commits having the corresponding lowercase letter names.
The helper functions also set up tags with the names of the commits.

But this constellation fails on case-insensitive file systems because
there cannot be distinct tags with names that differ only in case.

Use a less subtle convention for the names of cherry-picked commits.

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

Merge tag 'gitgui-0.18.0' of git://repo.or.cz/git-guiJunio C Hamano Mon, 17 Jun 2013 03:06:55 +0000 (20:06 -0700)

Merge tag 'gitgui-0.18.0' of git://repo.or.cz/git-gui

git-gui 0.18.0

* tag 'gitgui-0.18.0' of git://repo.or.cz/git-gui:
git-gui 0.18
git-gui: avoid an error message when removing the last remote
git-gui: fix file name handling with non-empty prefix
git-gui: bring wish process to front on Mac
git-gui: change dialog button positions for Windows to suit platform.
git-gui: allow "\ No newline at end of file" for linewise staging
git-gui: fix the mergetool launcher for the Beyond Compare tool.
Makefile: replace "echo 1>..." with "echo >..."
French translation: copy -> copie.
git-gui: Fix parsing of <rev> <path-which-not-present-in-worktree>

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

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

Some people often run 'git status -b'.
The config variable status.branch 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>

Update draft release notes to 1.8.4Junio C Hamano Sun, 16 Jun 2013 05:12:52 +0000 (22:12 -0700)

Update draft release notes to 1.8.4

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

git-gui 0.18 gitgui-0.18.0Pat Thoyts Sat, 15 Jun 2013 22:53:34 +0000 (23:53 +0100)

git-gui 0.18

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

git-gui: avoid an error message when removing the last... Pat Thoyts Sat, 15 Jun 2013 22:36:27 +0000 (23:36 +0100)

git-gui: avoid an error message when removing the last remote

When the last remote is removed on a system that has tearoff menu items
the code that adjusts the fetch and prune menus may raise an error when
probing the menu entry for a non-existing -label option.
Check the entry type to avoid this fault.

Reported-by: Vedran Miletić <rivanvx@gmail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>

unpack_entry: do not die when we fail to apply a deltaJeff King Fri, 14 Jun 2013 21:53:34 +0000 (17:53 -0400)

unpack_entry: do not die when we fail to apply a delta

When we try to load an object from disk and fail, our
general strategy is to see if we can get it from somewhere
else (e.g., a loose object). That lets users fix corruption
problems by copying known-good versions of objects into the
object database.

We already handle the case where we were not able to read
the delta from disk. However, when we find that the delta we
read does not apply, we simply die. This case is harder to
trigger, as corruption in the delta data itself would
trigger a crc error from zlib. However, a corruption that
pointed us at the wrong delta base might cause it.

We can do the same "fail and try to find the object
elsewhere" trick instead of dying. This not only gives us a
chance to recover, but also puts us on code paths that will
alert the user to the problem (with the current message,
they do not even know which sha1 caused the problem).

Note that unlike some other pack corruptions, we do not
recover automatically from this case when doing a repack.
There is nothing apparently wrong with the delta, as it
points to a valid, accessible object, and we realize the
error only when the resulting size does not match up. And in
theory, one could even have a case where the corrupted size
is the same, and the problem would only be noticed by
recomputing the sha1.

We can get around this by recomputing the deltas with
--no-reuse-delta, which our test does (and this is probably
good advice for anyone recovering from pack corruption).

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

t5303: drop "count=1" from corruption ddJeff King Fri, 14 Jun 2013 21:51:01 +0000 (17:51 -0400)

t5303: drop "count=1" from corruption dd

This test corrupts pack objects by using "dd" with a seek
command. It passes "count=1 bs=1" to munge just a single
byte. However, the test added in commit b3118bdc wants to
munge two bytes, and the second byte of corruption is
silently ignored.

This turned out not to impact the test, however. The idea
was to reduce the "size of this entry" part of the header so
that zlib runs out of input bytes while inflating the entry.
That header is two bytes long, and the test reduced the
value of both bytes; since we experience the problem if we
are off by even 1 byte, it is sufficient to munge only the
first one.

Even though the test would have worked with only a single
byte munged, and we could simply tweak the test to use a
single byte, it makes sense to lift this 1-byte restriction
from do_corrupt_object. It will allow future tests that do
need to change multiple bytes to do so.

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

git-remote-mediawiki: remove hardcoded version number... Benoit Person Fri, 14 Jun 2013 10:19:11 +0000 (12:19 +0200)

git-remote-mediawiki: remove hardcoded version number in the test suite

Updates the code to make it more easy to switch mediawiki version when
testing. Before that, the version number was partly hardcoded, partly
in a var.

Signed-off-by: Benoit Person <benoit.person@ensimag.fr>
Signed-off-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t/lib-httpd/apache.conf: configure an MPM module for... Jeff King Sun, 9 Jun 2013 08:09:32 +0000 (04:09 -0400)

t/lib-httpd/apache.conf: configure an MPM module for apache 2.4

Versions of Apache before 2.4 always had a "MultiProcessing
Module" (MPM) statically built in, which manages the worker
threads/processes. We do not care which one, as it is
largely a performance issue, and we put only a light load on
the server during our testing.

As of Apache 2.4, the MPM module is loadable just like any
other module, but exactly one such module must be loaded. On
a system where the MPMs are compiled dynamically (e.g.,
Debian unstable), this means that our test Apache server
will not start unless we provide the appropriate
configuration.

Unfortunately, we do not actually know which MPM modules are
available or appropriate for the system on which the tests
are running. This patch picks the "prefork" module, as it
is likely to be available on all Unix-like systems.

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

t/lib-httpd/apache.conf: load compat access module... Jeff King Sun, 9 Jun 2013 08:08:45 +0000 (04:08 -0400)

t/lib-httpd/apache.conf: load compat access module in apache 2.4

In apache 2.4, the "Order" directive has gone away in favor
of a new system in mod_authz_host. However, since we want
our config file to remain compatible across multiple Apache
versions, we can use mod_access_compat to keep using the
older style.

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

t/lib-httpd/apache.conf: load extra auth modules in... Jeff King Sun, 9 Jun 2013 08:08:22 +0000 (04:08 -0400)

t/lib-httpd/apache.conf: load extra auth modules in apache 2.4

In apache 2.4, the "Auth*" and "Require" directives have
moved into the authn_core and authz_core modules,
respectively.

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

t/lib-httpd/apache.conf: do not use LockFile in apache... Jeff King Sun, 9 Jun 2013 08:07:59 +0000 (04:07 -0400)

t/lib-httpd/apache.conf: do not use LockFile in apache >= 2.4

The LockFile directive from earlier versions of apache has
been replaced by the Mutex directive. The latter seems to
give sane defaults and does not need any specific
customization, so we can get away with just adding a version
check to the use of LockFile.

Signed-off-by: Jeff King <peff@peff.net>
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>

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>

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>

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>