gitweb.git
Merge branch 'jk/format-patch-quote-special-in-from... Junio C Hamano Sun, 15 May 2011 22:56:44 +0000 (15:56 -0700)

Merge branch 'jk/format-patch-quote-special-in-from' into maint

* jk/format-patch-quote-special-in-from:
pretty: quote rfc822 specials in email addresses

Merge branch 'vh/git-svn-doc' into maintJunio C Hamano Sun, 15 May 2011 22:52:40 +0000 (15:52 -0700)

Merge branch 'vh/git-svn-doc' into maint

* vh/git-svn-doc:
git-svn.txt: small typeface improvements
git-svn.txt: move option descriptions
git-svn.txt: fix usage of --add-author-from

git_open_noatime(): drop unused parameterJunio C Hamano Sun, 15 May 2011 19:16:29 +0000 (12:16 -0700)

git_open_noatime(): drop unused parameter

Since commit c793430 (Limit file descriptors used by packs, 2011-02-28),
the extra parameter added in f2e872aa (Work around EMFILE when there are
too many pack files, 2010-11-01) is not used anymore.

Remove it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>

sha1_file: typofixJunio C Hamano Sun, 15 May 2011 19:16:03 +0000 (12:16 -0700)

sha1_file: typofix

The number zero is spelled "zero", not "zer0".

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

read_sha1_file(): allow selective bypassing of replacem... Junio C Hamano Sun, 15 May 2011 19:54:54 +0000 (12:54 -0700)

read_sha1_file(): allow selective bypassing of replacement mechanism

The way "object replacement" mechanism was tucked to the read_sha1_file()
interface was suboptimal in a couple of ways:

- Callers that want it to die with useful diagnosis upon seeing a corrupt
object does not have a way to say that they do not want any object
replacement.

- Callers who do not want it to die but want to handle the errors
themselves are told to arrange to call read_object(), but the function
does not use the replacement mechanism, and also it is a file scope
static function that not many callers can call to begin with.

This adds a read_sha1_file_extended() that takes a set of flags; the
callers of read_sha1_file() passes a flag READ_SHA1_FILE_REPLACE to ask
for object replacement mechanism to kick in.

Later, we could add another flag bit to tell the function to return an
error instead of dying and then remove the misguided "call read_object()
yourself".

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

inline lookup_replace_object() callsJunio C Hamano Sun, 15 May 2011 19:54:53 +0000 (12:54 -0700)

inline lookup_replace_object() calls

In a repository without object replacement, lookup_replace_object() should
be a no-op. Check the flag "read_replace_refs" on the side of the caller,
and bypess a function call when we know we are not dealing with replacement.

Also, even when we are set up to replace objects, if we do not find any
replacement defined, flip that flag off to avoid function call overhead
for all the later object accesses.

As this change the semantics of the flag from "do we need read the
replacement definition?" to "do we need to check with the lookup table?"
the flag needs to be renamed later to something saner, e.g. "use_replace",
when the codebase is calmer, but not now.

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

read_sha1_file(): get rid of read_sha1_file_repl()... Junio C Hamano Sun, 15 May 2011 19:54:52 +0000 (12:54 -0700)

read_sha1_file(): get rid of read_sha1_file_repl() madness

Most callers want to silently get a replacement object, and they do not
care what the real name of the replacement object is. Worse yet, no sane
interface to return the underlying object without replacement is provided.

Remove the function and make only the few callers that want the name of
the replacement object find it themselves.

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

t6050: make sure we test not just commit replacementJunio C Hamano Sun, 15 May 2011 19:54:51 +0000 (12:54 -0700)

t6050: make sure we test not just commit replacement

The replacement mechanism should affect all types of objects not
just commits, so make sure it deals with at least a blob.

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

Declare lookup_replace_object() in cache.h, not in... Junio C Hamano Sun, 15 May 2011 19:54:50 +0000 (12:54 -0700)

Declare lookup_replace_object() in cache.h, not in commit.h

The declaration is misplaced as the replace API is supposed to affect
not just commits, but all types of objects.

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

Merge branch 'maint'Junio C Hamano Sun, 15 May 2011 03:44:09 +0000 (20:44 -0700)

Merge branch 'maint'

* maint:
add, merge, diff: do not use strcasecmp to compare config variable names

Makefile: add xgettext target for *.sh filesÆvar Arnfjörð Bjarmason Sat, 14 May 2011 13:47:45 +0000 (13:47 +0000)

Makefile: add xgettext target for *.sh files

Change the "pot" target to also extract strings from our $(SCRIPT_SH)
files with xgettext(1).

Note that due to Jonathan Nieder's trick of doing "mv $@+ $@" at the
end of the target the "pot" target will now warn:

$ make pot
XGETTEXT po/git.pot
po/git.pot+: warning: Charset "CHARSET" is not a portable encoding name.
Message conversion to user's charset might not work.

This warnings is emitted because xgettext is writing into a non-*.pot
file, it's harmless however. The content that's written out is
equivalent to what it would be if we were writing directly into an
existing POT file with --join-existing.

As part of this change I've eliminated the && chain between xgettext
calls, this is incompatible with $(QUIET_XGETTEXT), if the && is left
in it'll emit:

/bin/sh: @echo: not found

Since it's redundant (the Makefile will stop if there's an error) I've
removed it altogether.

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

git-sh-i18n.sh: add GIT_GETTEXT_POISON supportÆvar Arnfjörð Bjarmason Sat, 14 May 2011 13:47:44 +0000 (13:47 +0000)

git-sh-i18n.sh: add GIT_GETTEXT_POISON support

Change git-sh-i18n.sh to support the GIT_GETTEXT_POISON environment
variable like gettext.c does, this ensures that tests that use
git-sh-i18n.sh will fail under GETTEXT_POISON=YesPlease if they rely
on Git's C locale messages without declaring that they do.

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

git-sh-i18n.sh: add no-op gettext() and eval_gettext... Ævar Arnfjörð Bjarmason Sat, 14 May 2011 13:47:43 +0000 (13:47 +0000)

git-sh-i18n.sh: add no-op gettext() and eval_gettext() wrappers

Add a no-op wrapper library for Git's shell scripts. To split up the
gettext series I'm first submitting patches to gettextize the source
tree before I add any of the Makefile and Shell library changes needed
to actually use them.

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

git-sh-i18n--envsubst: our own envsubst(1) for eval_get... Ævar Arnfjörð Bjarmason Sat, 14 May 2011 13:47:42 +0000 (13:47 +0000)

git-sh-i18n--envsubst: our own envsubst(1) for eval_gettext()

Add a git-sh-i18n--envsubst program which is a stripped-down version
of the GNU envsubst(1) program that comes with GNU gettext for use in
the eval_gettext() fallback.

We need a C helper program because implementing eval_gettext() purely
in shell turned out to be unworkable. Digging through the Git mailing
list archives will reveal two shell implementations of eval_gettext
that are almost good enough, but fail on an edge case which is tested
for in the tests which are part of this patch.

These are the modifications I made to envsubst.c as I turned it into
sh-i18n--envsubst.c:

* Added our git-compat-util.h header for xrealloc() and friends.

* Removed inclusion of gettext-specific headers.

* Removed most of main() and replaced it with my own. The modified
version only does option parsing for --variables. That's all it
needs.

* Modified error() invocations to use our error() instead of
error(3).

* Replaced the gettext XNMALLOC(n, size) macro with just
xmalloc(n). Since XNMALLOC() only allocated char's.

* Removed the string_list_destroy function. It's redundant (also in
the upstream code).

* Replaced the use of stdbool.h (a C99 header) by doing the following
replacements on the code:

* s/bool/unsigned short int/g
* s/true/1/g
* s/false/0/g

Reported-by: Johannes Sixt <j.sixt@viscovery.net>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

add, merge, diff: do not use strcasecmp to compare... Jonathan Nieder Sat, 14 May 2011 20:19:21 +0000 (15:19 -0500)

add, merge, diff: do not use strcasecmp to compare config variable names

The config machinery already makes section and variable names
lowercase when parsing them, so using strcasecmp for comparison just
feels wasteful. No noticeable change intended.

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

Submodules: Don't parse .gitmodules when it contains... Jens Lehmann Sat, 14 May 2011 16:26:58 +0000 (18:26 +0200)

Submodules: Don't parse .gitmodules when it contains, merge conflicts

Commands like "git status", "git diff" and "git fetch" would fail when the
.gitmodules file contained merge conflicts because the config parser would
call die() when hitting the conflict markers:

"fatal: bad config file line <n> in <path>/.gitmodules"

While this behavior was on the safe side, it is really unhelpful to the
user to have commands like status and diff fail, as these are needed to
find out what's going on. And the error message is only mildly helpful,
as it points to the right file but doesn't mention that it is unmerged.
Users of git gui were not shown any conflicts at all when this happened.

Improve the situation by checking if the index records .gitmodules as
unmerged. When that is the case we can't make any assumptions about the
configuration to be found there after the merge conflict is resolved by
the user, so assume that all recursion is disabled unless .git/config or
the global config say otherwise.

As soon as the merge conflict is resolved and the .gitmodules file has
been staged subsequent commands again honor any configuration done there.

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

test that git status works with merge conflict in,... Heiko Voigt Sat, 14 May 2011 16:26:30 +0000 (18:26 +0200)

test that git status works with merge conflict in, .gitmodules

For example: Two users independently adding a submodule will result in a
merge conflict in .gitmodules. Since configuration of the status and
diff machinery depends on the file being parseable they currently
fail to produce useable output in case .gitmodules is marked with a
merge conflict.

Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Bigfile: teach "git add" to send a large file straight... Junio C Hamano Sun, 8 May 2011 08:47:35 +0000 (01:47 -0700)

Bigfile: teach "git add" to send a large file straight to a pack

When adding a new content to the repository, we have always slurped
the blob in its entirety in-core first, and computed the object name
and compressed it into a loose object file. Handling large binary
files (e.g. video and audio asset for games) has been problematic
because of this design.

At the middle level of "git add" callchain is an internal API
index_fd() that takes an open file descriptor to read from the
working tree file being added with its size. Teach it to call out to
fast-import when adding a large blob.

The write-out codepath in entry.c::write_entry() should be taught to
stream, instead of reading everything in core. This should not be so
hard to implement, especially if we limit ourselves only to loose
object files and non-delta representation in packfiles.

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

git-p4: warn if git authorship won't be retainedLuke Diamand Fri, 13 May 2011 19:46:00 +0000 (20:46 +0100)

git-p4: warn if git authorship won't be retained

If the git commits you are submitting contain changes made by
other people, the authorship will not be retained. Change git-p4
to warn of this and to note that --preserve-user can be used
to solve the problem (if you have suitable permissions).
The warning can be disabled.

Add a test case and update documentation.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Update draft release notes to 1.7.6Junio C Hamano Fri, 13 May 2011 18:14:07 +0000 (11:14 -0700)

Update draft release notes to 1.7.6

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

Merge branch 'bf/commit-template-no-cleanup'Junio C Hamano Fri, 13 May 2011 18:03:08 +0000 (11:03 -0700)

Merge branch 'bf/commit-template-no-cleanup'

* bf/commit-template-no-cleanup:
Do not strip empty lines / trailing spaces from a commit message template

Merge branch 'jc/t1506-shell-param-expansion-gotcha'Junio C Hamano Fri, 13 May 2011 18:02:47 +0000 (11:02 -0700)

Merge branch 'jc/t1506-shell-param-expansion-gotcha'

* jc/t1506-shell-param-expansion-gotcha:
t1507: avoid "${parameter<op>'word'}" inside double-quotes

Merge branch 'rr/rerere-libify-clear-gc'Junio C Hamano Fri, 13 May 2011 18:02:40 +0000 (11:02 -0700)

Merge branch 'rr/rerere-libify-clear-gc'

* rr/rerere-libify-clear-gc:
rerere: libify rerere_clear() and rerere_gc()

Merge branch 'js/maint-send-pack-stateless-rpc-deadlock... Junio C Hamano Fri, 13 May 2011 18:02:29 +0000 (11:02 -0700)

Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix'

* js/maint-send-pack-stateless-rpc-deadlock-fix:
send-pack: unbreak push over stateless rpc
send-pack: avoid deadlock when pack-object dies early

Merge branch 'jh/dirstat-lines'Junio C Hamano Fri, 13 May 2011 18:01:32 +0000 (11:01 -0700)

Merge branch 'jh/dirstat-lines'

* jh/dirstat-lines:
Mark dirstat error messages for translation
Improve error handling when parsing dirstat parameters
New --dirstat=lines mode, doing dirstat analysis based on diffstat
Allow specifying --dirstat cut-off percentage as a floating point number
Add config variable for specifying default --dirstat behavior
Refactor --dirstat parsing; deprecate --cumulative and --dirstat-by-file
Make --dirstat=0 output directories that contribute < 0.1% of changes
Add several testcases for --dirstat and friends

Merge branch 'jc/fix-add-u-unmerged'Junio C Hamano Fri, 13 May 2011 18:01:15 +0000 (11:01 -0700)

Merge branch 'jc/fix-add-u-unmerged'

* jc/fix-add-u-unmerged:
Fix "add -u" that sometimes fails to resolve unmerged paths

Merge branch 'jn/setup-revisions-glob-and-friends-passthru'Junio C Hamano Fri, 13 May 2011 18:00:25 +0000 (11:00 -0700)

Merge branch 'jn/setup-revisions-glob-and-friends-passthru'

* jn/setup-revisions-glob-and-friends-passthru:
revisions: allow --glob and friends in parse_options-enabled commands
revisions: split out handle_revision_pseudo_opt function

Merge branch 'cn/log-parse-opt'Junio C Hamano Fri, 13 May 2011 17:59:57 +0000 (10:59 -0700)

Merge branch 'cn/log-parse-opt'

* cn/log-parse-opt:
log: convert to parse-options

Merge branch 'maint'Junio C Hamano Fri, 13 May 2011 17:58:10 +0000 (10:58 -0700)

Merge branch 'maint'

* maint:
Prepare for 1.7.5.2
t5400: Fix a couple of typos

Conflicts:
RelNotes

Prepare for 1.7.5.2Junio C Hamano Fri, 13 May 2011 17:57:09 +0000 (10:57 -0700)

Prepare for 1.7.5.2

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

Merge branch 'aw/maint-rebase-i-p-no-ff' into maintJunio C Hamano Fri, 13 May 2011 17:45:21 +0000 (10:45 -0700)

Merge branch 'aw/maint-rebase-i-p-no-ff' into maint

* aw/maint-rebase-i-p-no-ff:
git-rebase--interactive.sh: preserve-merges fails on merges created with no-ff

Merge branch 'js/blame-parsename' into maintJunio C Hamano Fri, 13 May 2011 17:45:00 +0000 (10:45 -0700)

Merge branch 'js/blame-parsename' into maint

* js/blame-parsename:
t/annotate-tests: Use echo & cat instead of sed
blame: tolerate bogus e-mail addresses a bit better

Merge branch 'gr/cvsimport-alternative-cvspass-location... Junio C Hamano Fri, 13 May 2011 17:44:54 +0000 (10:44 -0700)

Merge branch 'gr/cvsimport-alternative-cvspass-location' into maint

* gr/cvsimport-alternative-cvspass-location:
Look for password in both CVS and CVSNT password files.

Merge branch 'cj/p4merge' into maintJunio C Hamano Fri, 13 May 2011 17:44:46 +0000 (10:44 -0700)

Merge branch 'cj/p4merge' into maint

* cj/p4merge:
Pass empty file to p4merge where no base is suitable.

Merge branch 'jk/merge-one-file-working-tree' into... Junio C Hamano Fri, 13 May 2011 17:44:19 +0000 (10:44 -0700)

Merge branch 'jk/merge-one-file-working-tree' into maint

* jk/merge-one-file-working-tree:
merge-one-file: fix broken merges with alternate work trees
add tests for merge-index / merge-one-file

Merge branch 'jc/fix-diff-files-unmerged' into maintJunio C Hamano Fri, 13 May 2011 17:41:54 +0000 (10:41 -0700)

Merge branch 'jc/fix-diff-files-unmerged' into maint

* jc/fix-diff-files-unmerged:
diff-files: show unmerged entries correctly
diff: remove often unused parameters from diff_unmerge()
diff.c: return filepair from diff_unmerge()
test: use $_z40 from test-lib

Merge branch 'mz/maint-rename-unmerged' into maintJunio C Hamano Fri, 13 May 2011 17:41:24 +0000 (10:41 -0700)

Merge branch 'mz/maint-rename-unmerged' into maint

* mz/maint-rename-unmerged:
diffcore-rename: don't consider unmerged path as source

t5400: Fix a couple of typosJohan Herland Fri, 13 May 2011 16:43:29 +0000 (18:43 +0200)

t5400: Fix a couple of typos

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

Merge branch 'nd/struct-pathspec'Junio C Hamano Fri, 13 May 2011 05:36:41 +0000 (22:36 -0700)

Merge branch 'nd/struct-pathspec'

* nd/struct-pathspec:
Tweak t3102-ls-tree-wildcards to run on Windows

Tweak t3102-ls-tree-wildcards to run on WindowsJohannes Sixt Thu, 12 May 2011 08:37:22 +0000 (10:37 +0200)

Tweak t3102-ls-tree-wildcards to run on Windows

The test case fails on Windows, because "a*" is an invalid file name.
Therefore, use "a[a]" instead.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Acked-by: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3703: Skip tests using directory name ":" on WindowsJohannes Sixt Thu, 12 May 2011 08:21:33 +0000 (10:21 +0200)

t3703: Skip tests using directory name ":" on Windows

":" is not allowed in file names on Windows. Detect this case and skip a
test if necessary.

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

Merge branch 'jc/maint-1.7.4-pathspec-stdin-and-cmdline'Junio C Hamano Wed, 11 May 2011 22:05:01 +0000 (15:05 -0700)

Merge branch 'jc/maint-1.7.4-pathspec-stdin-and-cmdline'

Update the fix for 1.7.5 maintenance track.

* jc/maint-1.7.4-pathspec-stdin-and-cmdline:
setup_revisions(): take pathspec from command line and --stdin correctly

Merge branch 'jc/maint-1.6.6-pathspec-stdin-and-cmdline'Junio C Hamano Wed, 11 May 2011 21:57:45 +0000 (14:57 -0700)

Merge branch 'jc/maint-1.6.6-pathspec-stdin-and-cmdline'

Update the fix for 1.7.4 maintenance track.

* jc/maint-1.6.6-pathspec-stdin-and-cmdline:
setup_revisions(): take pathspec from command line and --stdin correctly

revision.c: leave a note for "a lone :" enhancementJunio C Hamano Wed, 11 May 2011 22:23:25 +0000 (15:23 -0700)

revision.c: leave a note for "a lone :" enhancement

If we later add a command in the log family that by default limit
its operation to the current subdirectory, we would need to resurrect
the "a lone ':' on the command line means no pathspec whatsoever".

Now the codepath was cleaned up, we can do so in one place. Leave a
note to mark where it is for later generations.

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

Merge branch 'jc/maint-1.6.6-pathspec-stdin-and-cmdline'Junio C Hamano Wed, 11 May 2011 22:14:13 +0000 (15:14 -0700)

Merge branch 'jc/maint-1.6.6-pathspec-stdin-and-cmdline'

* jc/maint-1.6.6-pathspec-stdin-and-cmdline:
setup_revisions(): take pathspec from command line and --stdin correctly

Merge branch 'jc/maint-1.6.6-pathspec-stdin-and-cmdline'Junio C Hamano Wed, 11 May 2011 21:57:45 +0000 (14:57 -0700)

Merge branch 'jc/maint-1.6.6-pathspec-stdin-and-cmdline'

Update the fix for 1.7.4 maintenance track.

* jc/maint-1.6.6-pathspec-stdin-and-cmdline:
setup_revisions(): take pathspec from command line and --stdin correctly

setup_revisions(): take pathspec from command line... Junio C Hamano Wed, 11 May 2011 21:01:19 +0000 (14:01 -0700)

setup_revisions(): take pathspec from command line and --stdin correctly

When the command line has "--" disambiguator, we take the remainder of
argv[] as "prune_data", but when --stdin is given at the same time,
we need to append to the existing prune_data and end up attempting to
realloc(3) it. That would not work.

Fix it by consistently using append_prune_data() throughout the input
processing. Also avoid counting the number of existing paths in the
function over and over again.

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

Update draft release notes to 1.7.6Junio C Hamano Wed, 11 May 2011 18:56:11 +0000 (11:56 -0700)

Update draft release notes to 1.7.6

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

Merge branch 'jn/gitweb-dependency'Junio C Hamano Wed, 11 May 2011 18:38:39 +0000 (11:38 -0700)

Merge branch 'jn/gitweb-dependency'

* jn/gitweb-dependency:
Remove gitweb/gitweb.cgi and other legacy targets from main Makefile
git-instaweb: Simplify build dependency on gitweb

Merge branch 'jc/maint-branch-mergeoptions'Junio C Hamano Wed, 11 May 2011 18:38:36 +0000 (11:38 -0700)

Merge branch 'jc/maint-branch-mergeoptions'

* jc/maint-branch-mergeoptions:
merge: make branch.<name>.mergeoptions correctly override merge.<option>

Conflicts:
builtin/merge.c

Merge branch 'jn/maint-test-merge-verify-parents'Junio C Hamano Wed, 11 May 2011 18:38:10 +0000 (11:38 -0700)

Merge branch 'jn/maint-test-merge-verify-parents'

* jn/maint-test-merge-verify-parents:
tests: teach verify_parents to check for extra parents
tests: eliminate unnecessary setup test assertions

Merge branch 'vh/config-interactive-singlekey-doc'Junio C Hamano Wed, 11 May 2011 18:38:06 +0000 (11:38 -0700)

Merge branch 'vh/config-interactive-singlekey-doc'

* vh/config-interactive-singlekey-doc:
git-reset.txt: better docs for '--patch'
git-checkout.txt: better docs for '--patch'
git-stash.txt: better docs for '--patch'
git-add.txt: document 'interactive.singlekey'
config.txt: 'interactive.singlekey; is used by...

Merge branch 'jc/maint-add-p-overlapping-hunks'Junio C Hamano Wed, 11 May 2011 18:37:46 +0000 (11:37 -0700)

Merge branch 'jc/maint-add-p-overlapping-hunks'

* jc/maint-add-p-overlapping-hunks:
t3701: add-p-fix makes the last test to pass
"add -p": work-around an old laziness that does not coalesce hunks
add--interactive.perl: factor out repeated --recount option
t3701: Editing a split hunk in an "add -p" session
add -p: 'q' should really quit

Merge branch 'sr/maint-fast-import-tighten-option-parsing'Junio C Hamano Wed, 11 May 2011 18:37:41 +0000 (11:37 -0700)

Merge branch 'sr/maint-fast-import-tighten-option-parsing'

* sr/maint-fast-import-tighten-option-parsing:
fast-import: fix option parser for no-arg options

Merge branch 'dm/http-cleanup'Junio C Hamano Wed, 11 May 2011 18:37:38 +0000 (11:37 -0700)

Merge branch 'dm/http-cleanup'

* dm/http-cleanup:
t5541-http-push: add test for chunked
http-push: refactor curl_easy_setup madness
http-push: use const for strings in signatures
http: make curl callbacks match contracts from curl header

Merge branch 'jn/ctags'Junio C Hamano Wed, 11 May 2011 18:37:32 +0000 (11:37 -0700)

Merge branch 'jn/ctags'

* jn/ctags:
gitweb: Mark matched 'ctag' / contents tag (?by_tag=foo)
gitweb: Change the way "content tags" ('ctags') are handled
gitweb: Restructure projects list generation

Do not strip empty lines / trailing spaces from a commi... Boris Faure Sun, 8 May 2011 10:31:02 +0000 (12:31 +0200)

Do not strip empty lines / trailing spaces from a commit message template

Templates should be just that: A form that the user fills out, and forms
have blanks. If people are attached to not having extra whitespace in the
editor, they can simply clean up their templates.

Added test with editor adding even more whitespace.

Signed-off-by: Boris Faure <billiob@gmail.com>
Based-on-patch-by:Sebastian Schuberth <sschuberth@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'fc/completion-zsh' into sg/completion... Junio C Hamano Tue, 10 May 2011 20:14:58 +0000 (13:14 -0700)

Merge branch 'fc/completion-zsh' into sg/completion-updates

* fc/completion-zsh:
git-completion: fix regression in zsh support

Revert "completion: don't declare 'local words' to... Junio C Hamano Tue, 10 May 2011 20:13:50 +0000 (13:13 -0700)

Revert "completion: don't declare 'local words' to make zsh happy"

This reverts commit 3bee6a4733a1ff03b9cc659ea026c6dc17567d4d, as the fix
that will be used by upstream zsh folks should make it unnecessary.

git-completion: fix regression in zsh supportFelipe Contreras Tue, 10 May 2011 12:20:39 +0000 (15:20 +0300)

git-completion: fix regression in zsh support

The zsh support of git-completion script in contrib/ is broken for current
versions of zsh, and does not notice when there's a subcommand.

For example: "git log origi<TAB>" gives no completions because it would
try to find a "git origi..." command. This will be fixed by zsh 4.3.12,
but for now we can workaround it by backporting the same fix as zsh folks
implemented.

The problem started after commit v1.7.4-rc0~11^2~2 (bash: get
--pretty=m<tab> completion to work with bash v4), which introduced
_get_comp_words_by_ref() that comes from bash-completion[1] scripts, and
relies on the 'words' variable.

However, it turns out 'words' is a special variable used by zsh
completion. From zshcompwid(1):

[...] the parameters are reset on each function exit (including nested
function calls from within the completion widget) to the values they had
when the function was entered.

As a result, subcommand words are lost. Ouch.

This is now fixed in the latest master branch of zsh[2] by simply defining
'words' as hidden (typeset -h), which removes the special meaning inside
the emulated bash function. So let's do the same.

Jonathan Nieder helped on the commit message.

[1] http://bash-completion.alioth.debian.org/
[2] http://zsh.git.sourceforge.net/git/gitweb.cgi?p=zsh/zsh;a=commitdiff;h=e880604f029088f32fb1ecc39213d720ae526aaa

Reported-by: Stefan Haller <lists@haller-berlin.de>
Comments-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Test atomic git-commit --interactiveConrad Irwin Tue, 10 May 2011 19:12:31 +0000 (12:12 -0700)

Test atomic git-commit --interactive

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

t3703, t4208: add test cases for magic pathspecNguyễn Thái Ngọc Duy Sun, 8 May 2011 11:08:26 +0000 (18:08 +0700)

t3703, t4208: add test cases for magic pathspec

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

rev/path disambiguation: further restrict "misspelled... Junio C Hamano Tue, 10 May 2011 19:05:01 +0000 (12:05 -0700)

rev/path disambiguation: further restrict "misspelled index entry" diag

A colon followed by anything !isalnum() (e.g. ":/heh") at this point is
known not to be an existing rev. Just give a generic "neither a rev nor
a path" error message.

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

fix overslow :/no-such-string-ever-existed diagnosticsJunio C Hamano Tue, 10 May 2011 19:02:54 +0000 (12:02 -0700)

fix overslow :/no-such-string-ever-existed diagnostics

"git cmd :/no-such-string-ever-existed" runs an extra round of get_sha1()
since 009fee4 (Detailed diagnosis when parsing an object name fails.,
2009-12-07). Once without error diagnosis to see there is no commit with
such a string in the log message (hence "it cannot be a ref"), and after
seeing that :/no-such-string-ever-existed is not a filename (hence "it
cannot be a path, either"), another time to give "better diagnosis".

The thing is, the second time it runs, we already know that traversing the
history all the way down to the root will _not_ find any matching commit.

Rename misguided "gently" parameter, which is turned off _only_ when the
"detailed diagnosis" codepath knows that it cannot be a ref and making the
call only for the caller to die with a message. Flip its meaning (and
adjust the callers) and call it "only_to_die", which is not a great name,
but it describes far more clearly what the codepaths that switches their
behaviour based on this variable do.

On my box, the command spends ~1.8 seconds without the patch to make the
report; with the patch it spends ~1.12 seconds.

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

fix overstrict :<path> diagnosisJunio C Hamano Tue, 10 May 2011 18:10:30 +0000 (11:10 -0700)

fix overstrict :<path> diagnosis

Given "git log :", we get a disambiguation message that tries to be
helpful and yet totally misses the point, i.e.

$ git log :
fatal: Path '' does not exist (neither on disk nor in the index).
$ git log :/
fatal: Path '/' exists on disk, but not in the index.

An empty path nor anything that begins with '/' cannot possibly in the
index, and it is wrong to guess that the user might have meant to access
such an index entry.

It should yield the same error message as "git log '*.c'", i.e.

$ git log '*.c'
fatal: ambiguous argument '*.c': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions

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

grep: use get_pathspec() correctlyJunio C Hamano Tue, 10 May 2011 04:34:04 +0000 (21:34 -0700)

grep: use get_pathspec() correctly

When there is no remaining string in argv, get_pathspec(prefix, argv)
will return a two-element array that has prefix as the first element,
so there is no need to re-roll that logic in the code that uses
get_pathspec().

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

pathspec: drop "lone : means no pathspec" from get_path... Junio C Hamano Tue, 10 May 2011 19:07:12 +0000 (12:07 -0700)

pathspec: drop "lone : means no pathspec" from get_pathspec()

We may want to give the pathspec subsystem such a feature, but not while
we are still using get_pathspec() that returns a stupid "char **" that
loses subtle nuances that existed in the input string.

In the meantime, the callers of get_pathspec() that want to support it
could do an equivalent before feeding their argv[] to the function
themselves quite easily.

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

Revert "magic pathspec: add ":(icase)path" to match... Junio C Hamano Tue, 10 May 2011 17:23:41 +0000 (10:23 -0700)

Revert "magic pathspec: add ":(icase)path" to match case insensitively"

This reverts commit d0546e2d488b1ba185c430b638619ab1d91af509, which
was only meant to be a Proof-of-concept used during the discussion.

The real implementation of the feature needs to wait until we migrate
all the code to use "struct pathspec", not "char **", to represent
richer semantics given to pathspec.

sparse checkout: do not eagerly decide the fate for... Nguyễn Thái Ngọc Duy Mon, 9 May 2011 15:43:01 +0000 (22:43 +0700)

sparse checkout: do not eagerly decide the fate for whole directory

Sparse-setting code follows closely how files are excluded in
read_directory(), every entry (including directories) are fed to
excluded_from_list() to decide if the entry is suitable. Directories
are treated no different than files. If a directory is matched (or
not), the whole directory is considered matched (or not) and the
process moves on.

This generally works as long as there are no patterns to exclude parts
of the directory. In case of sparse checkout code, the following patterns

t
!t/t0000-basic.sh

will produce a worktree with full directory "t" even if t0000-basic.sh
is requested to stay out.

By the same reasoning, if a directory is to be excluded, any rules to
re-include certain files within that directory will be ignored.

Fix it by always checking files against patterns. If no pattern can be
used to decide whether an entry is in our out
(ie. excluded_from_list() returns -1), the entry will be
included/excluded the same as their parent directory.

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

t1011: fix sparse-checkout initialization and add new... Nguyễn Thái Ngọc Duy Mon, 2 May 2011 12:47:43 +0000 (19:47 +0700)

t1011: fix sparse-checkout initialization and add new file

Do not append to $GIT_DIR/info/sparse-checkout at each test, overwrite
it instead.

Also add sub/addedtoo for more complex tests later on

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

tag: disallow '-' as tag nameMichael Schubert Mon, 9 May 2011 23:36:36 +0000 (01:36 +0200)

tag: disallow '-' as tag name

Disallow '-' as tag name, as well as tag names starting with '-', as it
would be cumbersome to "git checkout tags/-" because "git checkout -" is
to switch to the previous branch.

Add strbuf_check_tag_ref() as helper to check a refname for a tag.

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

Add commit to list of config.singlekey commandsConrad Irwin Sat, 7 May 2011 17:59:04 +0000 (10:59 -0700)

Add commit to list of config.singlekey commands

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

Add support for -p/--patch to git-commitConrad Irwin Sat, 7 May 2011 17:58:07 +0000 (10:58 -0700)

Add support for -p/--patch to git-commit

The --interactive flag is already shared by git add and git commit,
share the -p and --patch flags too.

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

Allow git commit --interactive with pathsConrad Irwin Sat, 7 May 2011 06:00:00 +0000 (23:00 -0700)

Allow git commit --interactive with paths

Make git commit --interactive feel more like git add --interactive by
allowing the user to restrict the list of files they have to deal with.

A test in t7501 used to ensure that this is not allowed; no need for that
anymore.

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

t7501.8: feed a meaningful commandJeff King Mon, 9 May 2011 23:53:00 +0000 (16:53 -0700)

t7501.8: feed a meaningful command

The command expects "git commit --interactive <path>" to fail because you
cannot (yet) limit "commit --interactive" with a pathspec, but even if the
command allowed to take <path>, the test would have failed as saying just
7:quit would leave the index the same as the current commit, leading to an
attempt to create an empty commit that would fail without --allow-empty.

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

git-p4: small improvements to user-preservationLuke Diamand Sat, 7 May 2011 10:19:43 +0000 (11:19 +0100)

git-p4: small improvements to user-preservation

. Slightly more paranoid checking of results from 'p4 change'
. Remove superfluous "-G"
. Don't modify the username if it is unchanged.
. Add a comment in the change template to show what is
going to be done.

Signed-off-by: Luke Diamand <luke@diamand.org>
Acked-By: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

blame: add --line-porcelain output formatJeff King Mon, 9 May 2011 13:34:42 +0000 (09:34 -0400)

blame: add --line-porcelain output format

This is just like --porcelain, except that we always output
the commit information for each line, not just the first
time it is referenced. This can make quick and dirty scripts
much easier to write; see the example added to the blame
documentation.

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

blame: refactor porcelain outputJeff King Mon, 9 May 2011 13:34:02 +0000 (09:34 -0400)

blame: refactor porcelain output

This is in preparation for adding more porcelain output
options. The three changes are:

1. emit_porcelain now receives the format option flags

2. emit_one_suspect_detail takes an optional "repeat"
parameter to suppress the "show only once" behavior

3. The code for emitting porcelain suspect is factored
into its own function for repeatability.

There should be no functional changes.

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

add tests for various blame formatsJeff King Mon, 9 May 2011 13:33:30 +0000 (09:33 -0400)

add tests for various blame formats

We don't seem to have any tests for "blame --porcelain".
Let's at least do a trivial test on a simple example.

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

Honor $(prefix) set in config.mak* when defining ETC_GIT*Johannes Sixt Mon, 9 May 2011 08:24:55 +0000 (10:24 +0200)

Honor $(prefix) set in config.mak* when defining ETC_GIT*

Notice that the prefix specified for the build influenced the definitions
of ETC_GITCONFIG and ETC_GITATTRIBUTES only when it was exactly '/usr'.
Kacper Kornet noticed that this was furthermore only the case when the
build was triggered using 'make prefix=/usr', i.e., the prefix was given
on the command line; it did not work when the prefix was specified in
config.mak because this file is included much later in the Makefile.

To fix this, move the conditional after the inclusion of config.mak.

Additionally, it is desirable to specify the etc directory for a build
(for example, a build with prefix /usr/local may still want to have the
system configuration in /etc/gitconfig). For this purpose, promote the
variable 'sysconfdir' from a helper variable to a configuration
variable. The prefix check that was moved must now be wrapped so that it
does not override sysconfdir setting given in config.mak.

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

Revert "Honor $(prefix) set in config.mak* when definin... Junio C Hamano Mon, 9 May 2011 22:12:13 +0000 (15:12 -0700)

Revert "Honor $(prefix) set in config.mak* when defining ETC_GIT* and sysconfdir"

This reverts commit 2910bf56a4ffc13c398fb04ba32910cb3b724091, as it
does not really solve the issue of making $(sysconfigdir) any more
useful than it currently is.

convert: make it harder to screw up adding a conversion... Junio C Hamano Mon, 9 May 2011 20:58:31 +0000 (13:58 -0700)

convert: make it harder to screw up adding a conversion attribute

The current internal API requires the callers of setup_convert_check() to
supply the git_attr_check structures (hence they need to know how many to
allocate), but they grab the same set of attributes for given path.

Define a new convert_attrs() API that fills a higher level information that
the callers (convert_to_git and convert_to_working_tree) really want, and
move the common code to interact with the attributes system to it.

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

convert: make it safer to add conversion attributesJunio C Hamano Mon, 9 May 2011 18:23:04 +0000 (11:23 -0700)

convert: make it safer to add conversion attributes

The places that need to pass an array of "struct git_attr_check" needed to
be careful to pass a large enough array and know what index each element
lied. Make it safer and easier to code these.

Besides, the hard-coded sequence of initializing various attributes was
too ugly after we gained more than a few attributes.

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

convert: give saner names to crlf/eol variables, types... Junio C Hamano Mon, 9 May 2011 20:12:57 +0000 (13:12 -0700)

convert: give saner names to crlf/eol variables, types and functions

Back when the conversion was only about the end-of-line convention, it
might have made sense to call what we do upon seeing CR/LF simply an
"action", but these days the conversion routines do a lot more than just
tweaking the line ending. Raname "action" to "crlf_action".

The function that decides what end of line conversion to use on the output
codepath was called "determine_output_conversion", as if there is no other
kind of output conversion. Rename it to "output_eol"; it is a function
that returns what EOL convention is to be used.

A function that decides what "crlf_action" needs to be used on the input
codepath, given what conversion attribute is set to the path and global
end-of-line convention, was called "determine_action". Rename it to
"input_crlf_action".

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

convert: rename the "eol" global variable to "core_eol"Junio C Hamano Mon, 9 May 2011 19:52:12 +0000 (12:52 -0700)

convert: rename the "eol" global variable to "core_eol"

Yes, it is clear that "eol" wants to mean some sort of end-of-line thing,
but as the name of a global variable, it is way too short to describe what
kind of end-of-line thing it wants to represent. Besides, there are many
codepaths that want to use their own local "char *eol" variable to point
at the end of the current line they are processing.

This global variable holds what we read from core.eol configuration
variable. Name it as such.

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

index_fd(): split into two helper functionsJunio C Hamano Sun, 8 May 2011 08:47:34 +0000 (01:47 -0700)

index_fd(): split into two helper functions

Split out the case where we do not know the size of the input (hence we
read everything into a strbuf before doing anything) to index_pipe(), and
the other case where we mmap or read the whole data to index_bulk().

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

index_fd(): turn write_object and format_check argument... Junio C Hamano Sun, 8 May 2011 08:47:33 +0000 (01:47 -0700)

index_fd(): turn write_object and format_check arguments into one flag

The "format_check" parameter tucked after the existing parameters is too
ugly an afterthought to live in any reasonable API.

Combine it with the other boolean parameter "write_object" into a single
"flags" parameter.

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

t1507: avoid "${parameter<op>'word'}" inside double... Junio C Hamano Mon, 9 May 2011 04:43:20 +0000 (21:43 -0700)

t1507: avoid "${parameter<op>'word'}" inside double-quotes

Kacper Kornet noticed that a $variable in "word" in the above construct is
not substituted by his pdksh. Modern POSIX compliant shells (e.g. dash,
ksh, bash) all seem to interpret POSIX "2.6.2 Parameter Expansion" that
says "word shall be subjected to tilde expansion, parameter expansion,
command substitution, and arithmetic expansion" in ${parameter<op>word},
to mean that the word is expanded as if it appeared in dq pairs, so if the
word were "'$variable'" (sans dq) it would expand to a single quote, the
value of the $variable and then a single quote.

Johannes Sixt reports that the behavior of quoting at the right of :- when
the ${...:-...} expansion appears in double-quotes was debated recently at
length at the Austin group. We can avoid this issue and future-proof the
test by a slight rewrite.

Helped-by: Johannes Sixt <j.sixt@viscovery.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: move private shopt shim for zsh to __git_... Jonathan Nieder Wed, 27 Apr 2011 21:27:04 +0000 (16:27 -0500)

completion: move private shopt shim for zsh to __git_ namespace

Most zsh users probably probably do not expect a custom shopt function
to enter their environment just because they ran "source
~/.git-completion.sh".

Such namespace pollution makes development of other scripts confusing
(because it makes the bash-specific shopt utility seem to be available
in zsh) and makes git's tab completion script brittle (since any other
shell snippet implementing some other subset of shopt will break it).
Rename the shopt shim to the more innocuous __git_shopt to be a good
citizen (with two underscores to avoid confusion with completion rules
for a hypothetical "git shopt" command).

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

t3701: add-p-fix makes the last test to passJunio C Hamano Sun, 8 May 2011 20:43:04 +0000 (13:43 -0700)

t3701: add-p-fix makes the last test to pass

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

rerere: libify rerere_clear() and rerere_gc()Junio C Hamano Sun, 8 May 2011 19:55:34 +0000 (12:55 -0700)

rerere: libify rerere_clear() and rerere_gc()

This moves the two features from builtin/rerere.c to a more library-ish
portion of the codebase. No behaviour change.

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

Use a temporary index for git commit --interactiveConrad Irwin Sat, 7 May 2011 05:59:59 +0000 (22:59 -0700)

Use a temporary index for git commit --interactive

Change the behaviour of git commit --interactive so that when you abort
the commit (by leaving the commit message empty) the index remains
unchanged.

Hitherto an aborted commit --interactive has added the selected hunks to
the index regardless of whether the commit succeeded or not.

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

Remove gitweb/gitweb.cgi and other legacy targets from... Jakub Narebski Sat, 7 May 2011 12:45:21 +0000 (14:45 +0200)

Remove gitweb/gitweb.cgi and other legacy targets from main Makefile

Now that there is gitweb/Makefile, let's leave only "gitweb" and
"install-gitweb" targets in main Makefile. Those targets just
delegate to gitweb's Makefile.

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

git-instaweb: Simplify build dependency on gitwebJakub Narebski Sat, 7 May 2011 12:45:20 +0000 (14:45 +0200)

git-instaweb: Simplify build dependency on gitweb

Since c0cb4ed (git-instaweb: Configure it to work with new gitweb
structure, 2010-05-28) git-instaweb does not re-create gitweb.cgi
etc., but makes use of installed gitweb. Therefore simplify
git-instaweb dependency on gitweb subsystem in main Makefile from
'gitweb/gitweb.cgi gitweb/static/gitweb.css gitweb/static/gitweb.js'
to simply 'gitweb'.

This is preparation for splitting gitweb.perl script, and for
splitting gitweb.js (to be reassembled / combined on build). This way
we don't have to duplicate parts of gitweb/Makefile in main
Makefile... it is also more correct description of git-instaweb
dependency.

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

tests: check git does not barf on merge.ff values for... Jonathan Nieder Fri, 6 May 2011 21:59:47 +0000 (16:59 -0500)

tests: check git does not barf on merge.ff values for future versions of git

Maybe some day in the future we will want to support a syntax
like

[merge]
ff = branch1
ff = branch2
ff = branch3

in addition to the currently permitted "true", "false", and "only"
values. So make sure we continue to treat such configurations as
though an unknown variable had been defined rather than erroring out,
until it is time to implement such a thing, so configuration files
using such a facility can be shared between present and future git.

While at it, add a few missing && and start the "combining --squash
and --no-ff" test with a known state so we can be sure it does not
succeed or fail for the wrong reason.

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

tests: teach verify_parents to check for extra parentsJonathan Nieder Fri, 6 May 2011 21:00:21 +0000 (16:00 -0500)

tests: teach verify_parents to check for extra parents

Currently verify_parents only makes sure that the earlier parents of
HEAD match the commits given, and does not care if there are more
parents. This makes it harder than one would like to check that, for
example, parent reduction works correctly when making an octopus.

Fix it by checking that HEAD^(n+1) is not a valid commit name.
Noticed while working on a new test that was supposed to create a
fast-forward one commit ahead but actually created a merge.

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

merge: introduce merge.ff configuration variableJunio C Hamano Fri, 6 May 2011 19:27:05 +0000 (12:27 -0700)

merge: introduce merge.ff configuration variable

This variable gives the default setting for --ff, --no-ff or --ff-only
options of "git merge" command.

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

Merge branch 'jc/maint-branch-mergeoptions' into mg... Junio C Hamano Fri, 6 May 2011 22:03:25 +0000 (15:03 -0700)

Merge branch 'jc/maint-branch-mergeoptions' into mg/merge-ff-config

* jc/maint-branch-mergeoptions:
merge: make branch.<name>.mergeoptions correctly override merge.<option>

merge: make branch.<name>.mergeoptions correctly overri... Junio C Hamano Thu, 5 May 2011 00:42:51 +0000 (17:42 -0700)

merge: make branch.<name>.mergeoptions correctly override merge.<option>

The parsing of the additional command line parameters supplied to
the branch.<name>.mergeoptions configuration variable was implemented
at the wrong stage. If any merge-related variable came after we read
branch.<name>.mergeoptions, the earlier value was overwritten.

We should first read all the merge.* configuration, override them by
reading from branch.<name>.mergeoptions and then finally read from
the command line.

This patch should fix it, even though I now strongly suspect that
branch.<name>.mergeoptions that gives a single command line that
needs to be parsed was likely to be an ill-conceived idea to begin
with. Sigh...

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

tests: eliminate unnecessary setup test assertionsJonathan Nieder Fri, 6 May 2011 20:58:52 +0000 (15:58 -0500)

tests: eliminate unnecessary setup test assertions

Most of git's tests write files and define shell functions and
variables that will last throughout a test script at the top of
the script, before all test assertions:

. ./test-lib.sh

VAR='some value'
export VAR

>empty

fn () {
do something
}

test_expect_success 'setup' '
... nontrivial commands go here ...
'

Two scripts use a different style with this kind of trivial code
enclosed by a test assertion; fix them. The usual style is easier to
read since there is less indentation to keep track of and no need to
worry about nested quotes; and on the other hand, because the commands
in question are trivial, it should not make the test suite any worse
at catching future bugs in git.

While at it, make some other small tweaks:

- spell function definitions with a space before () for consistency
with other scripts;

- use the self-contained command "git mktree </dev/null" in
preference to "git write-tree" which looks at the index when
writing an empty tree.

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