gitweb.git
send-email: validate & reconfirm interactive responsesJunio C Hamano Tue, 14 Aug 2012 22:15:53 +0000 (15:15 -0700)

send-email: validate & reconfirm interactive responses

People answer 'y' to "Who should the emails appear to be from?" and
'n' to "Message-ID to be used as In-Reply-To for the first email?"
for some unknown reason. While it is possible that your local
username really is "y" and you are sending the mail to your local
colleagues, it is possible, and some might even say it is likely,
that it is a user error.

Fortunately, our interactive prompter already has input validation
mechanism built-in. Enhance it so that we can optionally reconfirm
and allow the user to pass an input that does not validate, and
"softly" require input to the sender, in-reply-to, and recipient to
contain "@" and "." in this order, which would catch most cases of
mistakes.

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

send-email: multiedit is a boolean config optionJeff King Mon, 9 Jan 2012 22:55:42 +0000 (17:55 -0500)

send-email: multiedit is a boolean config option

The sendemail.multiedit variable is meant to be a boolean.
However, it is not marked as such in the code, which means
we store its value literally. Thus in the do_edit function,
perl ends up coercing it to a boolean value according to
perl rules, not git rules. This works for "0", but "false",
"no", or "off" will erroneously be interpreted as true.

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

Git 1.7.8.3 v1.7.8.3Junio C Hamano Fri, 6 Jan 2012 20:41:39 +0000 (12:41 -0800)

Git 1.7.8.3

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

Merge branch 'jn/maint-gitweb-utf8-fix' into maintJunio C Hamano Fri, 6 Jan 2012 20:36:43 +0000 (12:36 -0800)

Merge branch 'jn/maint-gitweb-utf8-fix' into maint

* jn/maint-gitweb-utf8-fix:
gitweb: Fix fallback mode of to_utf8 subroutine
gitweb: Output valid utf8 in git_blame_common('data')
gitweb: esc_html() site name for title in OPML
gitweb: Call to_utf8() on input string in chop_and_escape_str()

Merge branch 'maint-1.7.7' into maintJunio C Hamano Fri, 6 Jan 2012 20:35:12 +0000 (12:35 -0800)

Merge branch 'maint-1.7.7' into maint

* maint-1.7.7:
Documentation: rerere.enabled is the primary way to configure rerere

Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano Fri, 6 Jan 2012 20:35:05 +0000 (12:35 -0800)

Merge branch 'maint-1.7.6' into maint-1.7.7

* maint-1.7.6:
Documentation: rerere.enabled is the primary way to configure rerere

Documentation: rerere.enabled is the primary way to... Thomas Rast Fri, 6 Jan 2012 13:08:02 +0000 (14:08 +0100)

Documentation: rerere.enabled is the primary way to configure rerere

The wording seems to suggest that creating the directory is needed and the
setting of rerere.enabled is only for disabling the feature by setting it
to 'false'. But the configuration is meant to be the primary control and
setting it to 'true' will enable it; the rr-cache directory will be
created as necessary and the user does not have to create it.

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

t5550: repack everything into one fileClemens Buchacher Wed, 4 Jan 2012 15:55:34 +0000 (16:55 +0100)

t5550: repack everything into one file

Subsequently we assume that there is only one pack. Currently this is
true only by accident. Pass '-a -d' to repack in order to guarantee that
assumption to hold true.

The prune-packed command is now redundant since repack -d already calls
it.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'nd/maint-parse-depth' into maintJunio C Hamano Wed, 4 Jan 2012 17:43:26 +0000 (09:43 -0800)

Merge branch 'nd/maint-parse-depth' into maint

* nd/maint-parse-depth:
Catch invalid --depth option passed to clone or fetch

Catch invalid --depth option passed to clone or fetchNguyễn Thái Ngọc Duy Wed, 4 Jan 2012 10:01:55 +0000 (17:01 +0700)

Catch invalid --depth option passed to clone or fetch

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

Merge branch 'maint-1.7.7' into maintJunio C Hamano Tue, 3 Jan 2012 21:47:46 +0000 (13:47 -0800)

Merge branch 'maint-1.7.7' into maint

* maint-1.7.7:
docs: describe behavior of relative submodule URLs
Documentation: read-tree --prefix works with existing subtrees
Add MYMETA.json to perl/.gitignore

Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano Tue, 3 Jan 2012 21:47:15 +0000 (13:47 -0800)

Merge branch 'maint-1.7.6' into maint-1.7.7

* maint-1.7.6:
Documentation: read-tree --prefix works with existing subtrees
Add MYMETA.json to perl/.gitignore

docs: describe behavior of relative submodule URLsJens Lehmann Sun, 1 Jan 2012 15:13:16 +0000 (16:13 +0100)

docs: describe behavior of relative submodule URLs

Since the relative submodule URLs have been introduced in f31a522a2d, they
do not conform to the rules for resolving relative URIs but rather to
those of relative directories.

Document that behavior.

Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fix hang in git fetch if pointed at a 0 length bundleBrian Harring Tue, 3 Jan 2012 13:46:03 +0000 (05:46 -0800)

fix hang in git fetch if pointed at a 0 length bundle

git-repo if interupted at the exact wrong time will generate zero
length bundles- literal empty files. git-repo is wrong here, but
git fetch shouldn't effectively spin loop if pointed at a zero
length bundle.

Signed-off-by: Brian Harring <ferringb@chromium.org>
Helped-by: Johannes Sixt
Helped-by: Nguyen Thai Ngoc Duy
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Documentation: read-tree --prefix works with existing... Clemens Buchacher Sat, 31 Dec 2011 11:50:56 +0000 (12:50 +0100)

Documentation: read-tree --prefix works with existing subtrees

Since 34110cd4 (Make 'unpack_trees()' have a separate source and
destination index) it is no longer true that a subdirectory with
the same prefix must not exist.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add MYMETA.json to perl/.gitignoreJack Nagel Thu, 29 Dec 2011 04:42:05 +0000 (22:42 -0600)

Add MYMETA.json to perl/.gitignore

ExtUtils::MakeMaker generates MYMETA.json in addition to MYMETA.yml
since version 6.57_07. As it suggests, it is just meta information about
the build and is cleaned up with 'make clean', so it should be ignored.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.7.8.2 v1.7.8.2Junio C Hamano Wed, 28 Dec 2011 19:49:09 +0000 (11:49 -0800)

Git 1.7.8.2

Contains accumulated fixes since 1.7.8 that have been merged to the
'master' branch in preparation for the 1.7.9 release.

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

Merge branch 'jv/maint-config-set' into maintJunio C Hamano Wed, 28 Dec 2011 20:03:19 +0000 (12:03 -0800)

Merge branch 'jv/maint-config-set' into maint

* jv/maint-config-set:
Fix an incorrect reference to --set-all.

Merge branch 'jk/follow-rename-score' into maintJunio C Hamano Wed, 28 Dec 2011 19:49:37 +0000 (11:49 -0800)

Merge branch 'jk/follow-rename-score' into maint

* jk/follow-rename-score:
use custom rename score during --follow

Merge branch 'jc/checkout-m-twoway' into maintJunio C Hamano Wed, 28 Dec 2011 19:44:54 +0000 (11:44 -0800)

Merge branch 'jc/checkout-m-twoway' into maint

* jc/checkout-m-twoway:
t/t2023-checkout-m.sh: fix use of test_must_fail
checkout_merged(): squelch false warning from some gcc
Test 'checkout -m -- path'
checkout -m: no need to insist on having all 3 stages

Merge branch 'tr/doc-sh-setup' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:51 +0000 (11:42 -0800)

Merge branch 'tr/doc-sh-setup' into maint

* tr/doc-sh-setup:
git-sh-setup: make require_clean_work_tree part of the interface

Merge branch 'jk/maint-strbuf-missing-init' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:46 +0000 (11:42 -0800)

Merge branch 'jk/maint-strbuf-missing-init' into maint

* jk/maint-strbuf-missing-init:
commit, merge: initialize static strbuf

Merge branch 'jk/maint-push-v-is-verbose' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:42 +0000 (11:42 -0800)

Merge branch 'jk/maint-push-v-is-verbose' into maint

* jk/maint-push-v-is-verbose:
make "git push -v" actually verbose

Merge branch 'jk/http-push-to-empty' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:37 +0000 (11:42 -0800)

Merge branch 'jk/http-push-to-empty' into maint

* jk/http-push-to-empty:
remote-curl: don't pass back fake refs

Conflicts:
remote-curl.c

Merge branch 'jk/doc-fsck' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:33 +0000 (11:42 -0800)

Merge branch 'jk/doc-fsck' into maint

* jk/doc-fsck:
docs: brush up obsolete bits of git-fsck manpage

Merge branch 'jc/maint-lf-to-crlf-keep-crlf' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:27 +0000 (11:42 -0800)

Merge branch 'jc/maint-lf-to-crlf-keep-crlf' into maint

* jc/maint-lf-to-crlf-keep-crlf:
lf_to_crlf_filter(): resurrect CRLF->CRLF hack

Merge branch 'ef/setenv-putenv' into maintJunio C Hamano Wed, 28 Dec 2011 19:42:24 +0000 (11:42 -0800)

Merge branch 'ef/setenv-putenv' into maint

* ef/setenv-putenv:
compat/setenv.c: error if name contains '='
compat/setenv.c: update errno when erroring out

Merge branch 'jc/advice-doc' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:39 +0000 (11:32 -0800)

Merge branch 'jc/advice-doc' into maint

* jc/advice-doc:
advice: Document that they all default to true

Merge branch 'jn/maint-sequencer-fixes' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:39 +0000 (11:32 -0800)

Merge branch 'jn/maint-sequencer-fixes' into maint

* jn/maint-sequencer-fixes:
revert: stop creating and removing sequencer-old directory
Revert "reset: Make reset remove the sequencer state"
revert: do not remove state until sequence is finished
revert: allow single-pick in the middle of cherry-pick sequence
revert: pass around rev-list args in already-parsed form
revert: allow cherry-pick --continue to commit before resuming
revert: give --continue handling its own function

Merge branch 'jk/maint-snprintf-va-copy' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:38 +0000 (11:32 -0800)

Merge branch 'jk/maint-snprintf-va-copy' into maint

* jk/maint-snprintf-va-copy:
compat/snprintf: don't look at va_list twice

Merge branch 'jk/maint-push-over-dav' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:37 +0000 (11:32 -0800)

Merge branch 'jk/maint-push-over-dav' into maint

* jk/maint-push-over-dav:
http-push: enable "proactive auth"
t5540: test DAV push with authentication

Merge branch 'jk/maint-mv' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:36 +0000 (11:32 -0800)

Merge branch 'jk/maint-mv' into maint

* jk/maint-mv:
mv: be quiet about overwriting
mv: improve overwrite warning
mv: make non-directory destination error more clear
mv: honor --verbose flag
docs: mention "-k" for both forms of "git mv"

Merge branch 'jk/fetch-no-tail-match-refs' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:36 +0000 (11:32 -0800)

Merge branch 'jk/fetch-no-tail-match-refs' into maint

* jk/fetch-no-tail-match-refs:
connect.c: drop path_match function
fetch-pack: match refs exactly
t5500: give fully-qualified refs to fetch-pack
drop "match" parameter from get_remote_heads

Merge branch 'ew/keepalive' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:36 +0000 (11:32 -0800)

Merge branch 'ew/keepalive' into maint

* ew/keepalive:
enable SO_KEEPALIVE for connected TCP sockets

Merge branch 'ci/stripspace-docs' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:35 +0000 (11:32 -0800)

Merge branch 'ci/stripspace-docs' into maint

* ci/stripspace-docs:
Update documentation for stripspace

Merge branch 'jh/fast-import-notes' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:35 +0000 (11:32 -0800)

Merge branch 'jh/fast-import-notes' into maint

* jh/fast-import-notes:
fast-import: Fix incorrect fanout level when modifying existing notes refs
t9301: Add 2nd testcase exposing bugs in fast-import's notes fanout handling
t9301: Fix testcase covering up a bug in fast-import's notes fanout handling

Merge branch 'aw/rebase-i-stop-on-failure-to-amend... Junio C Hamano Wed, 28 Dec 2011 19:32:34 +0000 (11:32 -0800)

Merge branch 'aw/rebase-i-stop-on-failure-to-amend' into maint

* aw/rebase-i-stop-on-failure-to-amend:
rebase -i: interrupt rebase when "commit --amend" failed during "reword"

Merge branch 'tj/maint-imap-send-remove-unused' into... Junio C Hamano Wed, 28 Dec 2011 19:32:34 +0000 (11:32 -0800)

Merge branch 'tj/maint-imap-send-remove-unused' into maint

* tj/maint-imap-send-remove-unused:
imap-send: Remove unused 'use_namespace' variable

Merge branch 'jn/branch-move-to-self' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:33 +0000 (11:32 -0800)

Merge branch 'jn/branch-move-to-self' into maint

* jn/branch-move-to-self:
Allow checkout -B <current-branch> to update the current branch
branch: allow a no-op "branch -M <current-branch> HEAD"

Merge branch 'na/strtoimax' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:33 +0000 (11:32 -0800)

Merge branch 'na/strtoimax' into maint

* na/strtoimax:
Support sizes >=2G in various config options accepting 'g' sizes.
Compatibility: declare strtoimax() under NO_STRTOUMAX
Add strtoimax() compatibility function.

Merge branch 'jk/refresh-porcelain-output' into maintJunio C Hamano Wed, 28 Dec 2011 19:32:32 +0000 (11:32 -0800)

Merge branch 'jk/refresh-porcelain-output' into maint

* jk/refresh-porcelain-output:
refresh_index: make porcelain output more specific
refresh_index: rename format variables
read-cache: let refresh_cache_ent pass up changed flags

Fix an incorrect reference to --set-all.Jelmer Vernooij Tue, 27 Dec 2011 02:03:45 +0000 (03:03 +0100)

Fix an incorrect reference to --set-all.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 1.7.8.1 v1.7.8.1Junio C Hamano Wed, 21 Dec 2011 20:02:13 +0000 (12:02 -0800)

Git 1.7.8.1

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

Merge branch 'jl/submodule-status-failure-report' into... Junio C Hamano Wed, 21 Dec 2011 19:42:45 +0000 (11:42 -0800)

Merge branch 'jl/submodule-status-failure-report' into maint

* jl/submodule-status-failure-report:
diff/status: print submodule path when looking for changes fails

Merge branch 'tr/userdiff-c-returns-pointer' into maintJunio C Hamano Wed, 21 Dec 2011 19:42:45 +0000 (11:42 -0800)

Merge branch 'tr/userdiff-c-returns-pointer' into maint

* tr/userdiff-c-returns-pointer:
userdiff: allow * between cpp funcname words

Merge branch 'bc/maint-apply-check-no-patch' into maintJunio C Hamano Wed, 21 Dec 2011 19:42:45 +0000 (11:42 -0800)

Merge branch 'bc/maint-apply-check-no-patch' into maint

* bc/maint-apply-check-no-patch:
builtin/apply.c: report error on failure to recognize input
t/t4131-apply-fake-ancestor.sh: fix broken test

Merge branch 'cn/maint-lf-to-crlf-filter' into maintJunio C Hamano Wed, 21 Dec 2011 19:42:44 +0000 (11:42 -0800)

Merge branch 'cn/maint-lf-to-crlf-filter' into maint

* cn/maint-lf-to-crlf-filter:
lf_to_crlf_filter(): tell the caller we added "\n" when draining
convert: track state in LF-to-CRLF filter

Merge branch 'jk/maint-upload-archive' into maintJunio C Hamano Wed, 21 Dec 2011 19:42:44 +0000 (11:42 -0800)

Merge branch 'jk/maint-upload-archive' into maint

* jk/maint-upload-archive:
archive: don't let remote clients get unreachable commits

clone: the -o option has nothing to do with <branch>Carlos Martín Nieto Wed, 21 Dec 2011 18:14:09 +0000 (18:14 +0000)

clone: the -o option has nothing to do with <branch>

It is to give an alternate <name> instead of "origin" to the remote
we are cloning from.

Signed-off-by: Carlos Martín Nieto <cmn@elego.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/log: remove redundant initializationMichael Schubert Wed, 21 Dec 2011 12:05:27 +0000 (13:05 +0100)

builtin/log: remove redundant initialization

"abbrev" and "commit_format" in struct rev_info get initialized in
init_revisions - no need to reinit in cmd_log_init_defaults.

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'ms/commit-cc-option-helpstring' into... Junio C Hamano Wed, 21 Dec 2011 18:50:20 +0000 (10:50 -0800)

Merge branch 'ms/commit-cc-option-helpstring' into maint

* ms/commit-cc-option-helpstring:
builtin/commit: add missing '/' in help message

builtin/commit: add missing '/' in help messageMichael Schubert Wed, 21 Dec 2011 14:56:00 +0000 (15:56 +0100)

builtin/commit: add missing '/' in help message

Signed-off-by: Michael Schubert <mschub@elegosoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/init-db.c: eliminate -Wformat warning on SolarisÆvar Arnfjörð Bjarmason Tue, 20 Dec 2011 23:27:41 +0000 (23:27 +0000)

builtin/init-db.c: eliminate -Wformat warning on Solaris

On Solaris systems we'd warn about an implicit cast of mode_t when we
printed things out with the %d format. We'd get this warning under GCC
4.6.0 with Solaris headers:

builtin/init-db.c: In function ‘separate_git_dir’:
builtin/init-db.c:354:4: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘mode_t’ [-Wformat]

We've been doing this ever since v1.7.4.1-296-gb57fb80. Just work
around this by adding an explicit cast.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-sh-setup: make require_clean_work_tree part of... Thomas Rast Tue, 20 Dec 2011 21:42:39 +0000 (22:42 +0100)

git-sh-setup: make require_clean_work_tree part of the interface

92c62a3 (Porcelain scripts: Rewrite cryptic "needs update" error
message, 2010-10-19) refactored git's own checking to a function in
git-sh-setup. This is a very useful thing for script writers, so
document it.

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

t/t2023-checkout-m.sh: fix use of test_must_failÆvar Arnfjörð Bjarmason Tue, 20 Dec 2011 20:37:45 +0000 (20:37 +0000)

t/t2023-checkout-m.sh: fix use of test_must_fail

Change an invocation of test_must_fail() to be inside a
test_expect_success() as is our usual pattern. Having it outside
caused our tests to fail under prove(1) since we wouldn't print a
newline before TAP output:

CONFLICT (content): Merge conflict in both.txt
# GETTEXT POISON #ok 2 - -m restores 2-way conflicted+resolved file

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Fix fallback mode of to_utf8 subroutineJakub Narebski Sun, 18 Dec 2011 22:00:58 +0000 (23:00 +0100)

gitweb: Fix fallback mode of to_utf8 subroutine

e5d3de5 (gitweb: use Perl built-in utf8 function for UTF-8 decoding.,
2007-12-04) was meant to make gitweb faster by using Perl's internals
(see subsection "Messing with Perl's Internals" in Encode(3pm) manpage)

Simple benchmark confirms that (old = 00f429a, new = this version):

old new
old -- -65%
new 189% --

Unfortunately it made fallback mode of to_utf8 do not work... except
for default value 'latin1' of $fallback_encoding ('latin1' is Perl
native encoding), which is why it was not noticed for such long time.

utf8::valid(STRING) is an internal function that tests whether STRING
is in a _consistent state_ regarding UTF-8. It returns true is
well-formed UTF-8 and has the UTF-8 flag on _*or*_ if string is held
as bytes (both these states are 'consistent'). For gitweb the second
option was true, as output from git commands is opened without ':utf8'
layer.

What made it work at all for STRING in 'latin1' encoding is the fact
that utf8:decode(STRING) turns on UTF-8 flag only if source string is
valid UTF-8 and contains multi-byte UTF-8 characters... and that if
string doesn't have UTF-8 flag set it is treated as in native Perl
encoding, i.e. 'latin1' / 'iso-8859-1' (unless native encoding it is
EBCDIC ;-)). It was ':utf8' layer that actually converted 'latin1'
(no UTF-8 flag == native == 'latin1) to 'utf8'.

Let's make use of the fact that utf8:decode(STRING) returns false if
STRING is invalid as UTF-8 to check whether to enable fallback mode.

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

remote-curl: don't pass back fake refsJeff King Sat, 17 Dec 2011 10:45:39 +0000 (05:45 -0500)

remote-curl: don't pass back fake refs

When receive-pack advertises its list of refs, it generally hides the
capabilities information after a NUL at the end of the first ref.

However, when we have an empty repository, there are no refs, and
therefore receive-pack writes a fake ref "capabilities^{}" with the
capabilities afterwards.

On the client side, git reads the result with get_remote_heads(). We pick
the capabilities from the end of the line, and then call check_ref() to
make sure the ref name is valid. We see that it isn't, and don't bother
adding it to our list of refs.

However, the call to check_ref() is enabled by passing the REF_NORMAL flag
to get_remote_heads. For the regular git transport, we pass REF_NORMAL in
get_refs_via_connect() if we are doing a push (since only receive-pack
uses this fake ref). But in remote-curl, we never use this flag, and we
accept the fake ref as a real one, passing it back from the helper to the
parent git-push.

Most of the time this bug goes unnoticed, as the fake ref won't match our
refspecs. However, if "--mirror" is used, then we see it as remote cruft
to be pruned, and try to pass along a deletion refspec for it. Of course
this refspec has bogus syntax (because of the ^{}), and the helper
complains, aborting the push.

Let's have remote-curl mirror what the builtin get_refs_via_connect() does
(at least for the case of using git protocol; we can leave the dumb
info/refs reader as it is).

This also fixes pushing with --mirror to a smart-http remote that uses
alternates. The fake ".have" refs the server gives to avoid unnecessary
network transfer has a similar bad interactions with the machinery.

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

advice: Document that they all default to trueJunio C Hamano Mon, 19 Dec 2011 05:35:01 +0000 (21:35 -0800)

advice: Document that they all default to true

By definition, the default value of "advice.*" variables must be true and
they all control various additional help messages that are designed to aid
new users. Setting one to false is to tell Git that the user understands
the nature of the error and does not need the additional verbose help
message.

Also fix the asciidoc markup for linkgit:git-checkout[1] in the
description of the detachedHead advice by removing an excess colon.

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

lf_to_crlf_filter(): resurrect CRLF->CRLF hackJunio C Hamano Fri, 16 Dec 2011 23:44:18 +0000 (15:44 -0800)

lf_to_crlf_filter(): resurrect CRLF->CRLF hack

The non-streaming version of the filter counts CRLF and LF in the whole
buffer, and returns without doing anything when they match (i.e. what is
recorded in the object store already uses CRLF). This was done to help
people who added files from the DOS world before realizing they want to go
cross platform and adding .gitattributes to tell Git that they only want
CRLF in their working tree.

The streaming version of the filter does not want to read the whole thing
before starting to work, as that defeats the whole point of streaming. So
we instead check what byte follows CR whenever we see one, and add CR
before LF only when the LF does not immediately follow CR already to keep
CRLF as is.

Reported-and-tested-by: Ralf Thielow
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Output valid utf8 in git_blame_common('data')Jürgen Kreileder Sat, 17 Dec 2011 09:22:23 +0000 (10:22 +0100)

gitweb: Output valid utf8 in git_blame_common('data')

Otherwise when javascript-actions are enabled gitweb shown broken
author names in the tooltips on blame pages ('blame_incremental'
view).

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: esc_html() site name for title in OPMLJürgen Kreileder Sat, 17 Dec 2011 09:22:22 +0000 (10:22 +0100)

gitweb: esc_html() site name for title in OPML

This escapes the site name in OPML (XML uses the same escaping rules
as HTML). Also fixes encoding issues because esc_html() uses
to_utf8().

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gitweb: Call to_utf8() on input string in chop_and_esca... Jürgen Kreileder Sat, 17 Dec 2011 09:22:21 +0000 (10:22 +0100)

gitweb: Call to_utf8() on input string in chop_and_escape_str()

a) To fix the comparison with the chopped string,
otherwise we compare bytes with characters, as
chop_str() must run to_utf8() for correct operation
b) To give the title attribute correct encoding;
we need to mark strings as UTF-8 before outpur

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
Acked-by: Jakub Narębski <jnareb@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update jk/maint-strbuf-missing-init to builtin/ renameJunio C Hamano Sun, 18 Dec 2011 08:27:59 +0000 (00:27 -0800)

Update jk/maint-strbuf-missing-init to builtin/ rename

commit, merge: initialize static strbufJeff King Sun, 18 Dec 2011 05:03:22 +0000 (00:03 -0500)

commit, merge: initialize static strbuf

Strbufs cannot rely on static all-zero initialization; instead, they must
use STRBUF_INIT to point to the "slopbuf".

Without this patch, "git commit --no-message" segfaults reliably. Fix the
same issue in builtin/merge.c as well.

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

make "git push -v" actually verboseJeff King Sat, 17 Dec 2011 09:37:15 +0000 (04:37 -0500)

make "git push -v" actually verbose

Providing a single "-v" to "git push" currently does
nothing. Giving two flags ("git push -v -v") turns on the
first level of verbosity.

This is caused by a regression introduced in 8afd8dc (push:
support multiple levels of verbosity, 2010-02-24). Before
the series containing 8afd8dc, the verbosity handling for
fetching and pushing was completely separate. Commit bde873c
refactored the verbosity handling out of the fetch side, and
then 8afd8dc converted push to use the refactored code.

However, the fetch and push sides numbered and passed along
their verbosity levels differently. For both, a verbosity
level of "-1" meant "quiet", and "0" meant "default output".
But from there they differed.

For fetch, a verbosity level of "1" indicated to the "fetch"
program that it should make the status table slightly more
verbose, showing up-to-date entries. A verbosity level of
"2" meant that we should pass a verbose flag to the
transport; in the case of fetch-pack, this displays protocol
debugging information.

As a result, the refactored code in bde873c checks for
"verbosity >= 2", and only then passes it on to the
transport. From the transport code's perspective, a
verbosity of 0 or 1 both meant "0".

Push, on the other hand, does not show its own status table;
that is always handled by the transport layer or below
(originally send-pack itself, but these days it is done by
the transport code). So a verbosity level of 1 meant that we
should pass the verbose flag to send-pack, so that it knows
we want a verbose status table. However, once 8afd8dc
switched it to the refactored fetch code, a verbosity level
of 1 was now being ignored. Thus, you needed to
artificially bump the verbosity to 2 (via "-v -v") to have
any effect.

We can fix this by letting the transport code know about the
true verbosity level (i.e., let it distinguish level 0 or
1).

We then have to also make an adjustment to any transport
methods that assumed "verbose > 0" meant they could spew
lots of debugging information. Before, they could only get
"0" or "2", but now they will also receive "1". They need to
adjust their condition for turning on such spew from
"verbose > 0" to "verbose > 1".

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

docs: brush up obsolete bits of git-fsck manpageJeff King Fri, 16 Dec 2011 11:33:10 +0000 (06:33 -0500)

docs: brush up obsolete bits of git-fsck manpage

After the description and options, the fsck manpage contains
some discussion about what it does. Over time, this
discussion has become somewhat obsolete, both in content and
formatting. In particular:

1. There are many options now, so starting the discussion
with "It tests..." makes it unclear whether we are
talking about the last option, or about the tool in
general. Let's start a new "discussion" section and
make our antecedent more clear.

2. It gave an example for --unreachable using for-each-ref
to mention all of the heads, saying that it will do "a
_lot_ of verification". This is hopelessly out-of-date,
as giving no arguments will check much more (reflogs,
the index, non-head refs).

3. It goes on to mention tests "to be added" (like tree
object sorting). We now have these tests.

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

lf_to_crlf_filter(): tell the caller we added "\n"... Junio C Hamano Fri, 16 Dec 2011 22:39:37 +0000 (14:39 -0800)

lf_to_crlf_filter(): tell the caller we added "\n" when draining

This can only happen when the input size is multiple of the
buffer size of the cascade filter (16k) and ends with an LF,
but in such a case, the code forgot to tell the caller that
it added the "\n" it could not add during the last round.

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

use custom rename score during --followJeff King Fri, 16 Dec 2011 11:27:50 +0000 (06:27 -0500)

use custom rename score during --follow

If you provide a custom rename score on the command line,
like:

git log -M50 --follow foo.c

it is completely ignored, and there is no way to --follow
with a looser rename score. Instead, let's use the same
rename score that will be used for generating diffs. This is
convenient, and mirrors what we do with the break-score.

You can see an example of it being useful in git.git:

$ git log --oneline --summary --follow \
Documentation/technical/api-string-list.txt
86d4b52 string-list: Add API to remove an item from an unsorted list
1d2f80f string_list: Fix argument order for string_list_append
e242148 string-list: add unsorted_string_list_lookup()
0dda1d1 Fix two leftovers from path_list->string_list
c455c87 Rename path_list to string_list
create mode 100644 Documentation/technical/api-string-list.txt

$ git log --oneline --summary -M40 --follow \
Documentation/technical/api-string-list.txt
86d4b52 string-list: Add API to remove an item from an unsorted list
1d2f80f string_list: Fix argument order for string_list_append
e242148 string-list: add unsorted_string_list_lookup()
0dda1d1 Fix two leftovers from path_list->string_list
c455c87 Rename path_list to string_list
rename Documentation/technical/{api-path-list.txt => api-string-list.txt} (47%)
328a475 path-list documentation: document all functions and data structures
530e741 Start preparing the API documents.
create mode 100644 Documentation/technical/api-path-list.txt

You could have two separate rename scores, one for following
and one for diff. But almost nobody is going to want that,
and it would just be unnecessarily confusing. Besides which,
we re-use the diff results from try_to_follow_renames for
the actual diff output, which means having them as separate
scores is actively wrong. E.g., with the current code, you
get:

$ git log --oneline --diff-filter=R --name-status \
-M90 --follow git.spec.in
27dedf0 GIT 0.99.9j aka 1.0rc3
R084 git-core.spec.in git.spec.in
f85639c Rename the RPM from "git" to "git-core"
R098 git.spec.in git-core.spec.in

The first one should not be considered a rename by the -M
score we gave, but we print it anyway, since we blindly
re-use the diff information from the follow (which uses the
default score). So this could also be considered simply a
bug-fix, as with the current code "-M" is completely ignored
when using "--follow".

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

checkout_merged(): squelch false warning from some gccJunio C Hamano Thu, 15 Dec 2011 18:10:11 +0000 (10:10 -0800)

checkout_merged(): squelch false warning from some gcc

gcc 4.6.2 (there may be others) does not realize that the variable "mode"
can never be used uninitialized in this function and issues a false warning
under -Wuninitialized option.

Squelch it with an unnecessary initialization; it is not like a single
assignment matters to the performance in this codepath that writes out
to the filesystem with checkout_entry() anyway.

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

compat/setenv.c: error if name contains '='Erik Faye-Lund Wed, 14 Dec 2011 14:07:09 +0000 (15:07 +0100)

compat/setenv.c: error if name contains '='

According to POSIX, setenv should error out with EINVAL if it's
asked to set an environment variable whose name contains an equals
sign. Implement this detail in our compatibility-fallback.

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

compat/setenv.c: update errno when erroring outErik Faye-Lund Wed, 14 Dec 2011 14:07:08 +0000 (15:07 +0100)

compat/setenv.c: update errno when erroring out

Previously, gitsetenv didn't update errno as it should when
erroring out. Fix this.

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

Update draft release notes for 1.7.8.1Junio C Hamano Wed, 14 Dec 2011 06:08:52 +0000 (22:08 -0800)

Update draft release notes for 1.7.8.1

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

Merge branch 'jc/maint-pack-object-cycle' into maintJunio C Hamano Wed, 14 Dec 2011 06:04:50 +0000 (22:04 -0800)

Merge branch 'jc/maint-pack-object-cycle' into maint

* jc/maint-pack-object-cycle:
pack-object: tolerate broken packs that have duplicated objects

Conflicts:
builtin/pack-objects.c

Merge branch 'jc/index-pack-reject-dups' into maintJunio C Hamano Wed, 14 Dec 2011 06:03:36 +0000 (22:03 -0800)

Merge branch 'jc/index-pack-reject-dups' into maint

* jc/index-pack-reject-dups:
receive-pack, fetch-pack: reject bogus pack that records objects twice

Merge branch 'mf/curl-select-fdset' into maintJunio C Hamano Wed, 14 Dec 2011 06:03:17 +0000 (22:03 -0800)

Merge branch 'mf/curl-select-fdset' into maint

* mf/curl-select-fdset:
http: drop "local" member from request struct
http.c: Rely on select instead of tracking whether data was received
http.c: Use timeout suggested by curl instead of fixed 50ms timeout
http.c: Use curl_multi_fdset to select on curl fds instead of just sleeping

Merge branch 'nd/misc-cleanups' into maintJunio C Hamano Wed, 14 Dec 2011 06:02:51 +0000 (22:02 -0800)

Merge branch 'nd/misc-cleanups' into maint

* nd/misc-cleanups:
unpack_object_header_buffer(): clear the size field upon error
tree_entry_interesting: make use of local pointer "item"
tree_entry_interesting(): give meaningful names to return values
read_directory_recursive: reduce one indentation level
get_tree_entry(): do not call find_tree_entry() on an empty tree
tree-walk.c: do not leak internal structure in tree_entry_len()

Merge branch 'maint-1.7.7' into maintJunio C Hamano Wed, 14 Dec 2011 05:58:51 +0000 (21:58 -0800)

Merge branch 'maint-1.7.7' into maint

* maint-1.7.7:
Git 1.7.7.5
Git 1.7.6.5
blame: don't overflow time buffer
fetch: create status table using strbuf
checkout,merge: loosen overwriting untracked file check based on info/exclude
cast variable in call to free() in builtin/diff.c and submodule.c
apply: get rid of useless x < 0 comparison on a size_t type

Conflicts:
Documentation/git.txt
GIT-VERSION-GEN
RelNotes
builtin/fetch.c

Git 1.7.7.5 v1.7.7.5Junio C Hamano Wed, 14 Dec 2011 05:55:31 +0000 (21:55 -0800)

Git 1.7.7.5

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

Merge branch 'ab/clang-lints' into maint-1.7.7Junio C Hamano Wed, 14 Dec 2011 05:47:51 +0000 (21:47 -0800)

Merge branch 'ab/clang-lints' into maint-1.7.7

* ab/clang-lints:
cast variable in call to free() in builtin/diff.c and submodule.c
apply: get rid of useless x < 0 comparison on a size_t type

Merge branch 'nd/maint-ignore-exclude' into maint-1.7.7Junio C Hamano Wed, 14 Dec 2011 05:47:08 +0000 (21:47 -0800)

Merge branch 'nd/maint-ignore-exclude' into maint-1.7.7

* nd/maint-ignore-exclude:
checkout,merge: loosen overwriting untracked file check based on info/exclude

Merge branch 'maint-1.7.6' into maint-1.7.7Junio C Hamano Wed, 14 Dec 2011 05:44:56 +0000 (21:44 -0800)

Merge branch 'maint-1.7.6' into maint-1.7.7

* maint-1.7.6:
Git 1.7.6.5
blame: don't overflow time buffer
fetch: create status table using strbuf

Conflicts:
Documentation/git.txt
GIT-VERSION-GEN
RelNotes

Git 1.7.6.5 v1.7.6.5Junio C Hamano Wed, 14 Dec 2011 05:30:40 +0000 (21:30 -0800)

Git 1.7.6.5

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

Merge branch 'jk/maint-fetch-status-table' into maint... Junio C Hamano Wed, 14 Dec 2011 05:21:30 +0000 (21:21 -0800)

Merge branch 'jk/maint-fetch-status-table' into maint-1.7.6

* jk/maint-fetch-status-table:
fetch: create status table using strbuf

Merge branch 'jc/maint-name-rev-all' into maint-1.7.6Junio C Hamano Wed, 14 Dec 2011 05:12:34 +0000 (21:12 -0800)

Merge branch 'jc/maint-name-rev-all' into maint-1.7.6

* jc/maint-name-rev-all:
name-rev --all: do not even attempt to describe non-commit object

Merge branch 'ml/mailmap' into maint-1.7.6Junio C Hamano Wed, 14 Dec 2011 05:12:14 +0000 (21:12 -0800)

Merge branch 'ml/mailmap' into maint-1.7.6

* ml/mailmap:
mailmap: xcalloc mailmap_info

Conflicts:
mailmap.c

blame: don't overflow time bufferJeff King Thu, 8 Dec 2011 10:25:54 +0000 (05:25 -0500)

blame: don't overflow time buffer

When showing the raw timestamp, we format the numeric
seconds-since-epoch into a buffer, followed by the timezone
string. This string has come straight from the commit
object. A well-formed object should have a timezone string
of only a few bytes, but we could be operating on data
pushed by a malicious user.

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

http-push: enable "proactive auth"Jeff King Wed, 14 Dec 2011 00:11:56 +0000 (19:11 -0500)

http-push: enable "proactive auth"

Before commit 986bbc08, git was proactive about asking for
http passwords. It assumed that if you had a username in
your URL, you would also want a password, and asked for it
before making any http requests.

However, this could interfere with the use of .netrc (see
986bbc08 for details). And it was also unnecessary, since
the http fetching code had learned to recognize an HTTP 401
and prompt the user then. Furthermore, the proactive prompt
could interfere with the usage of .netrc (see 986bbc08 for
details).

Unfortunately, the http push-over-DAV code never learned to
recognize HTTP 401, and so was broken by this change. This
patch does a quick fix of re-enabling the "proactive auth"
strategy only for http-push, leaving the dumb http fetch and
smart-http as-is.

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

t5540: test DAV push with authenticationJeff King Tue, 13 Dec 2011 20:17:04 +0000 (15:17 -0500)

t5540: test DAV push with authentication

We don't currently test this case at all, and instead just
test the DAV mechanism over an unauthenticated push. That
isn't very realistic, as most people will want to
authenticate pushes.

Two of the tests expect_failure as they reveal bugs:

1. Pushing without a username in the URL fails to ask for
credentials when we get an HTTP 401. This has always
been the case, but it would be nice if it worked like
smart-http.

2. Pushing with a username fails to ask for the password
since 986bbc0 (http: don't always prompt for password,
2011-11-04). This is a severe regression in v1.7.8, as
authenticated push-over-DAV is now totally unusable
unless you have credentials in your .netrc.

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

connect.c: drop path_match functionJeff King Tue, 13 Dec 2011 00:49:59 +0000 (19:49 -0500)

connect.c: drop path_match function

This function was used for comparing local and remote ref
names during fetch (which makes it a candidate for "most
confusingly named function of the year").

It no longer has any callers, so let's get rid of it.

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

fetch-pack: match refs exactlyJeff King Tue, 13 Dec 2011 00:48:08 +0000 (19:48 -0500)

fetch-pack: match refs exactly

When we are determining the list of refs to fetch via
fetch-pack, we have two sets of refs to compare: those on
the remote side, and a "match" list of things we want to
fetch. We iterate through the remote refs alphabetically,
seeing if each one is wanted by the "match" list.

Since def88e9 (Commit first cut at "git-fetch-pack",
2005-07-04), we have used the "path_match" function to do a
suffix match, where a remote ref is considered wanted if
any of the "match" elements is a suffix of the remote
refname.

This enables callers of fetch-pack to specify unqualified
refs and have them matched up with remote refs (e.g., ask
for "A" and get remote's "refs/heads/A"). However, if you
provide a fully qualified ref, then there are corner cases
where we provide the wrong answer. For example, given a
remote with two refs:

refs/foo/refs/heads/master
refs/heads/master

asking for "refs/heads/master" will first match
"refs/foo/refs/heads/master" by the suffix rule, and we will
erroneously fetch it instead of refs/heads/master.

As it turns out, all callers of fetch_pack do provide
fully-qualified refs for the match list. There are two ways
fetch_pack can get match lists:

1. Through the transport code (i.e., via git-fetch)

2. On the command-line of git-fetch-pack

In the first case, we will always be providing the names of
fully-qualified refs from "struct ref" objects. We will have
pre-matched those ref objects already (since we have to
handle more advanced matching, like wildcard refspecs), and
are just providing a list of the refs whose objects we need.

In the second case, users could in theory be providing
non-qualified refs on the command-line. However, the
fetch-pack documentation claims that refs should be fully
qualified (and has always done so since it was written in
2005).

Let's change this path_match call to simply check for string
equality, matching what the callers of fetch_pack are
expecting.

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

t5500: give fully-qualified refs to fetch-packJeff King Tue, 13 Dec 2011 00:44:40 +0000 (19:44 -0500)

t5500: give fully-qualified refs to fetch-pack

The fetch-pack documentation is very clear that refs given
on the command line are to be full refs:

<refs>...::
The remote heads to update from. This is relative to
$GIT_DIR (e.g. "HEAD", "refs/heads/master"). When
unspecified, update from all heads the remote side has.

and this has been the case since fetch-pack was originally documented in
8b3d9dc ([PATCH] Documentation: clone/fetch/upload., 2005-07-14).

Let's follow our own documentation to set a good example,
and to avoid breaking when this restriction is enforced in
the next patch.

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

drop "match" parameter from get_remote_headsJeff King Tue, 13 Dec 2011 00:41:37 +0000 (19:41 -0500)

drop "match" parameter from get_remote_heads

The get_remote_heads function reads the list of remote refs
during git protocol session. It dates all the way back to
def88e9 (Commit first cut at "git-fetch-pack", 2005-07-04).
At that time, the idea was to come up with a list of refs we
were interested in, and then filter the list as we got it
from the remote side.

Later, 1baaae5 (Make maximal use of the remote refs,
2005-10-28) stopped filtering at the get_remote_heads layer,
letting us use the non-matching refs to find common history.

As a result, all callers now simply pass an empty match
list (and any future callers will want to do the same). So
let's drop these now-useless parameters.

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

Update documentation for stripspaceConrad Irwin Mon, 12 Dec 2011 23:52:51 +0000 (15:52 -0800)

Update documentation for stripspace

Tell the user what this command is intended for, and expand the
description of what it does.

Signed-off-by: Conrad Irwin <conrad.irwin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mv: be quiet about overwritingJeff King Mon, 12 Dec 2011 21:54:42 +0000 (16:54 -0500)

mv: be quiet about overwriting

When a user asks us to force a mv and overwrite the
destination, we print a warning. However, since a typical
use would be:

$ git mv one two
fatal: destination exists, source=one, destination=two
$ git mv -f one two
warning: overwriting 'two'

this warning is just noise. We already know we're
overwriting; that's why we gave -f!

This patch silences the warning unless "--verbose" is given.

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

mv: improve overwrite warningJeff King Mon, 12 Dec 2011 21:54:17 +0000 (16:54 -0500)

mv: improve overwrite warning

When we try to "git mv" over an existing file, the error
message is fairly informative:

$ git mv one two
fatal: destination exists, source=one, destination=two

When the user forces the overwrite, we give a warning:

$ git mv -f one two
warning: destination exists; will overwrite!

This is less informative, but still sufficient in the simple
rename case, as there is only one rename happening.

But when moving files from one directory to another, it
becomes useless:

$ mkdir three
$ touch one two three/one
$ git add .
$ git mv one two three
fatal: destination exists, source=one, destination=three/one
$ git mv -f one two three
warning: destination exists; will overwrite!

The first message is helpful, but the second one gives us no
clue about what was overwritten. Let's mention the name of
the destination file:

$ git mv -f one two three
warning: overwriting 'three/one'

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

revert: stop creating and removing sequencer-old directoryJonathan Nieder Sat, 10 Dec 2011 13:06:12 +0000 (07:06 -0600)

revert: stop creating and removing sequencer-old directory

Now that "git reset" no longer implicitly removes .git/sequencer that
the operator may or may not have wanted to keep, the logic to write a
backup copy of .git/sequencer and remove it when stale is not needed
any more. Simplify the sequencer API and repository layout by
dropping it.

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

Revert "reset: Make reset remove the sequencer state"Jonathan Nieder Sat, 10 Dec 2011 13:03:48 +0000 (07:03 -0600)

Revert "reset: Make reset remove the sequencer state"

This reverts commit 95eb88d8ee588d89b4f06d2753ed4d16ab13b39f, which
was a UI experiment that did not reflect how "git reset" actually gets
used. The reversion also fixes a test, indicated in the patch.

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

revert: do not remove state until sequence is finishedJonathan Nieder Sat, 10 Dec 2011 13:02:12 +0000 (07:02 -0600)

revert: do not remove state until sequence is finished

As v1.7.8-rc0~141^2~4 (2011-08-04) explains, git cherry-pick removes
the sequencer state just before applying the final patch. In the
single-pick case, that was a good thing, since --abort and --continue
work fine without access to such state and removing it provides a
signal that git should not complain about the need to clobber it ("a
cherry-pick or revert is already in progress") in sequences like the
following:

git cherry-pick foo
git read-tree -m -u HEAD; # forget that; let's try a different one
git cherry-pick bar

After the recent patch "allow single-pick in the middle of cherry-pick
sequence" we don't need that hack any more. In the new regime, a
traditional "git cherry-pick <commit>" command never looks at
.git/sequencer, so we do not need to cripple "git cherry-pick
<commit>..<commit>" for it any more.

So now you can run "git cherry-pick --abort" near the end of a
multi-pick sequence and it will abort the entire sequence, instead of
misbehaving and aborting just the final commit.

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

revert: allow single-pick in the middle of cherry-pick... Jonathan Nieder Sat, 10 Dec 2011 12:59:48 +0000 (06:59 -0600)

revert: allow single-pick in the middle of cherry-pick sequence

After messing up a difficult conflict resolution in the middle of a
cherry-pick sequence, it can be useful to be able to

git checkout HEAD . && git cherry-pick that-one-commit

to restart the conflict resolution. The current code however errors out
saying that another cherry-pick is already in progress.

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

revert: pass around rev-list args in already-parsed... Jonathan Nieder Sat, 13 Aug 2011 17:06:23 +0000 (12:06 -0500)

revert: pass around rev-list args in already-parsed form

Since 7e2bfd3f (revert: allow cherry-picking more than one commit,
2010-07-02), the pick/revert machinery has kept track of the set of
commits to be cherry-picked or reverted using commit_argc and
commit_argv variables, storing the corresponding command-line
parameters.

Future callers as other commands are built in (am, rebase, sequencer)
may find it easier to pass rev-list options to this machinery in
already-parsed form. Teach cmd_cherry_pick and cmd_revert to parse
the rev-list arguments in advance and pass the commit set to
pick_revisions() as a rev_info structure.

Original patch by Jonathan, tweaks and test from Ram.

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