gitweb.git
completion: add --no-edit to git-commitYacine Belkadi Sun, 16 Sep 2012 16:06:11 +0000 (18:06 +0200)

completion: add --no-edit to git-commit

Signed-off-by: Yacine Belkadi <yacine.belkadi.1@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Add userdiff patterns for AdaAdrian Johnson Sun, 16 Sep 2012 03:54:15 +0000 (13:24 +0930)

Add userdiff patterns for Ada

Add Ada xfuncname and wordRegex patterns to the list of builtin
patterns.

Signed-off-by: Adrian Johnson <ajohnson@redneon.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: add submit --conflict option and config varaiablePete Wyckoff Sun, 9 Sep 2012 20:16:13 +0000 (16:16 -0400)

git-p4: add submit --conflict option and config varaiable

This allows specifying what to do when a conflict
happens when applying a commit to p4, automating the
interactive prompt.

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

git p4: add submit --prepare-p4-only optionPete Wyckoff Sun, 9 Sep 2012 20:16:12 +0000 (16:16 -0400)

git p4: add submit --prepare-p4-only option

This option can be used to prepare the client workspace for
submission, only. It does not invoke the final "p4 submit".
A message describes how to proceed, either submitting the
changes or reverting.

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

git p4: add submit --dry-run optionPete Wyckoff Sun, 9 Sep 2012 20:16:11 +0000 (16:16 -0400)

git p4: add submit --dry-run option

A new option, "git p4 submit --dry-run" can be used to verify
what commits and labels would be moved into p4.

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

git p4: accept -v for --verbosePete Wyckoff Sun, 9 Sep 2012 20:16:10 +0000 (16:16 -0400)

git p4: accept -v for --verbose

The short form "-v" is common in many git commands as an
alias for "--verbose".

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

git p4: revert deleted files after submit cancelPete Wyckoff Sun, 9 Sep 2012 20:16:09 +0000 (16:16 -0400)

git p4: revert deleted files after submit cancel

The user can decide not to continue with a submission,
by not saving the p4 submit template, then answering "no" to
the "Submit anyway?" prompt. In this case, be sure to
return the p4 client to its initial state.

Deleted files were not reverted; fix this and test all cases.

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

git p4: rearrange submit template constructionPete Wyckoff Sun, 9 Sep 2012 20:16:08 +0000 (16:16 -0400)

git p4: rearrange submit template construction

Put all items in order as they appear, and add comments.

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

git p4: test clean-up after failed submit, fix added... Pete Wyckoff Sun, 9 Sep 2012 20:16:07 +0000 (16:16 -0400)

git p4: test clean-up after failed submit, fix added files

Test a variety of cases where a patch failed to apply to
p4 and had to be cleaned up.

If the patch failed to apply cleanly, do not try to remove
to-be-added files, as they have not really been added yet.

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

git p4: standardize submit cancel due to unchanged... Pete Wyckoff Sun, 9 Sep 2012 20:16:06 +0000 (16:16 -0400)

git p4: standardize submit cancel due to unchanged template

When editing the submit template, if no change was made to it,
git p4 offers a prompt "Submit anyway?". Answering "no" cancels
the submit.

Previously, a "no" answer behaves like a "[s]kip" answer to the
failed-patch prompt, in that it proceeded to try to apply the
rest of the commits. Instead, put users back into the new
"[s]kip / [c]ontinue" loop so that they can decide. This makes
both cases of patch failure behave identically.

The return code of git p4 after a "no" answer is now the same
as that for a "skip" due to failed patch; update a test to
understand this.

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

git p4: move conflict prompt into run, add [q]uit inputPete Wyckoff Sun, 9 Sep 2012 20:16:05 +0000 (16:16 -0400)

git p4: move conflict prompt into run, add [q]uit input

When applying a commit to the p4 workspace fails, a prompt
asks what to do next. This belongs up in run() instead
of in applyCommit(), where run() can notice, for instance,
that the prompt is unnecessary because this is the last commit.

Offer two options about how to continue at conflict: [s]kip or
[q]uit. Having an explicit "quit" option gives git p4 a chance
to clean up, show the applied-commit summary, and do tag export.

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

git p4: remove submit failure options [a]pply and ... Pete Wyckoff Sun, 9 Sep 2012 20:16:04 +0000 (16:16 -0400)

git p4: remove submit failure options [a]pply and [w]rite

When a patch failed to apply, these interactive options offered
to:

1) apply the patch anyway, leaving reject (.rej) files around, or,
2) write the patch to a file (patch.txt)

In both cases it suggested to invoke "git p4 submit --continue",
an unimplemented option.

While manually fixing the rejects and submitting the result might
work, there are many steps that must be done to the job properly:

* apply patch
* invoke p4 add and delete
* change executable bits
* p4 sync -f renamed/copied files
* extract commit message into p4 change description and
move Jobs lines out of description section
* set changelist owner for --preserve-user

Plus the following manual sync/rebase will cause conflicts too,
which must be resolved once again.

Drop these workflows. Instead users should do a sync/rebase in
git, fix the conflicts there, and do a clean "git p4 submit".

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

git p4: gracefully fail if some commits could not be... Pete Wyckoff Sun, 9 Sep 2012 20:16:03 +0000 (16:16 -0400)

git p4: gracefully fail if some commits could not be applied

If a commit fails to apply cleanly to the p4 tree, an interactive
prompt asks what to do next. In all cases (skip, apply, write),
the behavior after the prompt had a few problems.

Change it so that it does not claim erroneously that all commits
were applied. Instead list the set of the patches under
consideration, and mark with an asterisk those that were
applied successfully. Like this example:

Applying 592f1f9 line5 in file1 will conflict
...
Unfortunately applying the change failed!
What do you want to do?
[s]kip this patch / [a]pply the patch forcibly and with .rej files / [w]rite the patch to a file (patch.txt) s
Skipping! Good luck with the next patches...
//depot/file1#4 - was edit, reverted
Applying b8db1c6 okay_commit_after_skip
...
Change 6 submitted.
Applied only the commits marked with '*':
592f1f9 line5 in file1 will conflict
* b8db1c6 okay_commit_after_skip

Do not try to sync and rebase unless all patches were applied.
If there was a conflict during the submit, there is sure to be one
at the rebase. Let the user to do the sync and rebase manually.

This changes how a couple tets in t9810-git-p4-rcs.sh behave:

- git p4 now does not leave files open and edited in the
client

- If a git commit contains a change to a file that was
deleted in p4, the test used to check that the sync/rebase
loop happened after the failure to apply the change. Since
now sync/rebase does not happen after failure, do not test
this. Normal rebase machinery, outside of git p4, will let
rebase --skip work.

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

git p4 test: remove bash-ism of combined export/assignmentPete Wyckoff Sun, 9 Sep 2012 20:16:02 +0000 (16:16 -0400)

git p4 test: remove bash-ism of combined export/assignment

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

t7810-grep: test --all-match with multiple --grep and... Michael J Gruber Fri, 14 Sep 2012 09:46:43 +0000 (11:46 +0200)

t7810-grep: test --all-match with multiple --grep and --author options

The code used to have a bug that ignores "--all-match", that requires
all "--grep" to have matched, when "--author" or "--committer" was used.

Make sure the bug will not be reintroduced.

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

t7810-grep: test interaction of multiple --grep and... Michael J Gruber Fri, 14 Sep 2012 09:46:42 +0000 (11:46 +0200)

t7810-grep: test interaction of multiple --grep and --author options

There are tests for this interaction already. Restructure slightly and
avoid any claims about --all-match.

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

t7810-grep: test multiple --author with --all-matchMichael J Gruber Fri, 14 Sep 2012 09:46:41 +0000 (11:46 +0200)

t7810-grep: test multiple --author with --all-match

The "--all-match" option is about "--grep", and does not affect how
"--author" or "--committer" limitation is applied.

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

t7810-grep: test multiple --grep with and without ... Michael J Gruber Fri, 14 Sep 2012 09:46:40 +0000 (11:46 +0200)

t7810-grep: test multiple --grep with and without --all-match

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

t7810-grep: bring log --grep tests in common formMichael J Gruber Fri, 14 Sep 2012 09:46:39 +0000 (11:46 +0200)

t7810-grep: bring log --grep tests in common form

The log --grep tests generate the expected out in different ways.
Make them all use command blocks so that subshells are avoided and the
expected output is easier to grasp visually.

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

grep.c: mark private file-scope symbols as staticJunio C Hamano Sat, 15 Sep 2012 21:04:36 +0000 (14:04 -0700)

grep.c: mark private file-scope symbols as static

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

test-string-list.c: Fix some sparse warningsRamsay Jones Sat, 15 Sep 2012 16:18:42 +0000 (17:18 +0100)

test-string-list.c: Fix some sparse warnings

In particular, sparse complains as follows:

SP test-string-list.c
test-string-list.c:10:6: warning: symbol 'parse_string_list' was not \
declared. Should it be static?
test-string-list.c:18:6: warning: symbol 'write_list' was not \
declared. Should it be static?
test-string-list.c:25:6: warning: symbol 'write_list_compact' was not \
declared. Should it be static?
test-string-list.c:38:5: warning: symbol 'prefix_cb' was not \
declared. Should it be static?

In order to suppress the warnings, since the above symbols do not
need more than file scope, we simply include the static modifier
in their declaration.

Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer.c: mark a private file-scope symbol as staticJunio C Hamano Sun, 16 Sep 2012 06:20:40 +0000 (23:20 -0700)

sequencer.c: mark a private file-scope symbol as static

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

ident.c: mark private file-scope symbols as staticJunio C Hamano Sun, 16 Sep 2012 05:50:09 +0000 (22:50 -0700)

ident.c: mark private file-scope symbols as static

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

trace.c: mark a private file-scope symbol as staticJunio C Hamano Sun, 16 Sep 2012 05:47:42 +0000 (22:47 -0700)

trace.c: mark a private file-scope symbol as static

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

wt-status.c: mark a private file-scope symbol as staticJunio C Hamano Sun, 16 Sep 2012 05:46:26 +0000 (22:46 -0700)

wt-status.c: mark a private file-scope symbol as static

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

read-cache.c: mark a private file-scope symbol as staticJunio C Hamano Sun, 16 Sep 2012 05:44:31 +0000 (22:44 -0700)

read-cache.c: mark a private file-scope symbol as static

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

strbuf.c: mark a private file-scope symbol as staticJunio C Hamano Sun, 16 Sep 2012 05:43:15 +0000 (22:43 -0700)

strbuf.c: mark a private file-scope symbol as static

Also remove an unused function.

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

sha1-array.c: mark a private file-scope symbol as staticJunio C Hamano Sun, 16 Sep 2012 05:39:43 +0000 (22:39 -0700)

sha1-array.c: mark a private file-scope symbol as static

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

symlinks.c: mark private file-scope symbols as staticJunio C Hamano Sun, 16 Sep 2012 05:38:28 +0000 (22:38 -0700)

symlinks.c: mark private file-scope symbols as static

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

notes.c: mark a private file-scope symbol as staticJunio C Hamano Sat, 15 Sep 2012 21:08:39 +0000 (14:08 -0700)

notes.c: mark a private file-scope symbol as static

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

rerere.c: mark private file-scope symbols as staticJunio C Hamano Sat, 15 Sep 2012 21:06:00 +0000 (14:06 -0700)

rerere.c: mark private file-scope symbols as static

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

graph.c: mark private file-scope symbols as staticJunio C Hamano Sat, 15 Sep 2012 21:02:52 +0000 (14:02 -0700)

graph.c: mark private file-scope symbols as static

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

diff.c: mark a private file-scope symbol as staticJunio C Hamano Sat, 15 Sep 2012 20:59:59 +0000 (13:59 -0700)

diff.c: mark a private file-scope symbol as static

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

commit.c: mark a file-scope private symbol as staticJunio C Hamano Sat, 15 Sep 2012 20:58:15 +0000 (13:58 -0700)

commit.c: mark a file-scope private symbol as static

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

builtin/notes.c: mark file-scope private symbols as... Junio C Hamano Sat, 15 Sep 2012 20:56:07 +0000 (13:56 -0700)

builtin/notes.c: mark file-scope private symbols as static

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

Draft release notes to 1.8.0Junio C Hamano Sat, 15 Sep 2012 04:44:37 +0000 (21:44 -0700)

Draft release notes to 1.8.0

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

Merge branch 'jc/ll-merge-binary-ours'Junio C Hamano Sat, 15 Sep 2012 04:39:56 +0000 (21:39 -0700)

Merge branch 'jc/ll-merge-binary-ours'

"git merge -Xtheirs" did not help content-level merge of binary
files; it should just take their version. Also "*.jpg binary" in
the attributes did not imply they should use the binary ll-merge
driver.

* jc/ll-merge-binary-ours:
ll-merge: warn about inability to merge binary files only when we can't
attr: "binary" attribute should choose built-in "binary" merge driver
merge: teach -Xours/-Xtheirs to binary ll-merge driver

Merge branch 'cn/branch-set-upstream-to'Junio C Hamano Sat, 15 Sep 2012 04:39:47 +0000 (21:39 -0700)

Merge branch 'cn/branch-set-upstream-to'

Finishing touches to the recently graduated topic to introduce
"git branch --set-upstream-to" option.

* cn/branch-set-upstream-to:
completion: complete branch name for "branch --set-upstream-to="
completion: add --set-upstream-to and --unset-upstream

Merge branch 'sl/autoconf'Junio C Hamano Sat, 15 Sep 2012 04:39:42 +0000 (21:39 -0700)

Merge branch 'sl/autoconf'

Reduces repetition in configure.ac.

* sl/autoconf:
build: don't duplicate substitution of make variables
build: improve GIT_CONF_SUBST signature

Merge branch 'dg/run-command-child-cleanup'Junio C Hamano Sat, 15 Sep 2012 04:39:37 +0000 (21:39 -0700)

Merge branch 'dg/run-command-child-cleanup'

The code to wait for subprocess and remove it from our internal queue
wasn't quite right.

* dg/run-command-child-cleanup:
run-command.c: fix broken list iteration in clear_child_for_cleanup

Merge branch 'jc/mailinfo-RE'Junio C Hamano Sat, 15 Sep 2012 04:39:27 +0000 (21:39 -0700)

Merge branch 'jc/mailinfo-RE'

We strip the prefix from "Re: subject" and also from a less common
"re: subject", but left even less common "RE: subject" intact.

* jc/mailinfo-RE:
mailinfo: strip "RE: " prefix

Merge branch 'maint'Junio C Hamano Sat, 15 Sep 2012 04:38:20 +0000 (21:38 -0700)

Merge branch 'maint'

Draft release notes to 1.7.12.1Junio C Hamano Sat, 15 Sep 2012 04:37:51 +0000 (21:37 -0700)

Draft release notes to 1.7.12.1

We are almost there...

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

Merge branch 'sb/send-email-reconfirm-fix' into maintJunio C Hamano Sat, 15 Sep 2012 04:32:07 +0000 (21:32 -0700)

Merge branch 'sb/send-email-reconfirm-fix' into maint

* sb/send-email-reconfirm-fix:
send-email: initial_to and initial_reply_to are both optional

Merge branch 'jc/send-email-reconfirm' into maintJunio C Hamano Sat, 15 Sep 2012 04:32:01 +0000 (21:32 -0700)

Merge branch 'jc/send-email-reconfirm' into maint

* jc/send-email-reconfirm:
send-email: validate & reconfirm interactive responses

Merge branch 'mz/cherry-pick-cmdline-order' into maintJunio C Hamano Sat, 15 Sep 2012 04:24:18 +0000 (21:24 -0700)

Merge branch 'mz/cherry-pick-cmdline-order' into maint

* mz/cherry-pick-cmdline-order:
cherry-pick/revert: respect order of revisions to pick
demonstrate broken 'git cherry-pick three one two'
teach log --no-walk=unsorted, which avoids sorting

Sync with 1.7.11.7Junio C Hamano Sat, 15 Sep 2012 04:20:40 +0000 (21:20 -0700)

Sync with 1.7.11.7

Git 1.7.11.7 v1.7.11.7Junio C Hamano Sat, 15 Sep 2012 03:57:23 +0000 (20:57 -0700)

Git 1.7.11.7

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

Merge branch 'jk/maint-quiet-is-synonym-to-s-in-log... Junio C Hamano Sat, 15 Sep 2012 03:48:31 +0000 (20:48 -0700)

Merge branch 'jk/maint-quiet-is-synonym-to-s-in-log' into maint-1.7.11

* jk/maint-quiet-is-synonym-to-s-in-log:
log: fix --quiet synonym for -s

Merge branch 'jc/maint-ident-missing-human-name' into... Junio C Hamano Sat, 15 Sep 2012 03:48:22 +0000 (20:48 -0700)

Merge branch 'jc/maint-ident-missing-human-name' into maint-1.7.11

* jc/maint-ident-missing-human-name:
split_ident_line(): make best effort when parsing author/committer line

Merge branch 'rj/test-regex' into maint-1.7.11Junio C Hamano Sat, 15 Sep 2012 03:46:39 +0000 (20:46 -0700)

Merge branch 'rj/test-regex' into maint-1.7.11

* rj/test-regex:
test-regex: Add a test to check for a bug in the regex routines

Merge branch 'da/gitk-reload-tag-contents' into maint... Junio C Hamano Sat, 15 Sep 2012 03:45:55 +0000 (20:45 -0700)

Merge branch 'da/gitk-reload-tag-contents' into maint-1.7.11

* da/gitk-reload-tag-contents:
gitk: Rename 'tagcontents' to 'cached_tagcontent'
gitk: Teach "Reread references" to reload tags
gitk: Avoid Meta1-F5

Merge branch 'jc/maint-checkout-fileglob-doc' into... Junio C Hamano Sat, 15 Sep 2012 03:45:03 +0000 (20:45 -0700)

Merge branch 'jc/maint-checkout-fileglob-doc' into maint-1.7.11

* jc/maint-checkout-fileglob-doc:
gitcli: contrast wildcard given to shell and to git
gitcli: formatting fix
Document file-glob for "git checkout -- '*.c'"

Add MALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the... Elia Pinto Fri, 14 Sep 2012 16:54:22 +0000 (09:54 -0700)

Add MALLOC_CHECK_ and MALLOC_PERTURB_ libc env to the test suite for detecting heap corruption

Recent versions of Linux libc (later than 5.4.23) and glibc (2.x)
include a malloc() implementation which is tunable via environment
variables. When MALLOC_CHECK_ is set, a special (less efficient)
implementation is used which is designed to be tolerant against
simple errors, such as double calls of free() with the same argument,
or overruns of a single byte (off-by-one bugs). When MALLOC_CHECK_
is set to 3, a diagnostic message is printed on stderr
and the program is aborted.

Setting the MALLOC_PERTURB_ environment variable causes the malloc
functions in libc to return memory which has been wiped and clear
memory when it is returned.
Of course this does not affect calloc which always does clear the memory.

The reason for this exercise is, of course, to find code which uses
memory returned by malloc without initializing it and code which uses
code after it is freed. valgrind can do this but it's costly to run.
The MALLOC_PERTURB_ exchanges the ability to detect problems in 100%
of the cases with speed.

The byte value used to initialize values returned by malloc is the byte
value of the environment value. The value used to clear memory is the
bitwise inverse. Setting MALLOC_PERTURB_ to zero disables the feature.

This technique can find hard to detect bugs.
It is therefore suggested to always use this flag (at least temporarily)
when testing out code or a new distribution.

But the test suite can use also valgrind(memcheck) via 'make valgrind'
or 'make GIT_TEST_OPTS="--valgrind"'.

Memcheck wraps client calls to malloc(), and puts a "red zone" on
each end of each block in order to detect access overruns.
Memcheck already detects double free() (up to the limit of the buffer
which remembers pending free()). Thus memcheck subsumes all the
documented coverage of MALLOC_CHECK_.

If MALLOC_CHECK_ is set non-zero when running memcheck, then the
overruns that might be detected by MALLOC_CHECK_ would be overruns
on the wrapped blocks which include the red zones. Thus MALLOC_CHECK_
would be checking memcheck, and not the client. This is not useful,
and actually is wasteful. The only possible [documented] advantage
of using MALLOC_CHECK_ and memcheck together, would be if MALLOC_CHECK_
detected duplicate free() in more cases than memcheck because memcheck's
buffer is too small.

Therefore we don't use MALLOC_CHECK_ and valgrind(memcheck) at the
same time.

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch: align per-ref summary report in UTF-8 localesNguyễn Thái Ngọc Duy Tue, 4 Sep 2012 10:39:35 +0000 (17:39 +0700)

fetch: align per-ref summary report in UTF-8 locales

fetch does printf("%-*s", width, "foo") where "foo" can be a utf-8
string, but width is in bytes, not columns. For ASCII it's fine as one
byte takes one column. For utf-8, this may result in misaligned ref
summary table.

Introduce gettext_width() function that returns the string length in
columns (currently only supports utf-8 locales). Make the code use
TRANSPORT_SUMMARY(x) where the length is compensated properly in
non-English locales.

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

The sixth batch for 1.8.0Junio C Hamano Fri, 14 Sep 2012 19:34:11 +0000 (12:34 -0700)

The sixth batch for 1.8.0

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

Merge branch 'nd/checkout-option-parsing-fix'Junio C Hamano Fri, 14 Sep 2012 18:54:34 +0000 (11:54 -0700)

Merge branch 'nd/checkout-option-parsing-fix'

The option parsing of "git checkout" had error checking, dwim and
defaulting missing options, all mixed in the code, and issuing an
appropriate error message with useful context was getting harder.
Reorganize the code and allow giving a proper diagnosis when the
user says "git checkout -b -t foo bar" (e.g. "-t" is not a good name
for a branch).

* nd/checkout-option-parsing-fix:
checkout: reorder option handling
checkout: move more parameters to struct checkout_opts
checkout: pass "struct checkout_opts *" as const pointer

Merge branch 'mh/abspath'Junio C Hamano Fri, 14 Sep 2012 18:54:28 +0000 (11:54 -0700)

Merge branch 'mh/abspath'

* mh/abspath:
t0060: split absolute path test in two to exercise some of it on Windows
t0060: verify that real_path() removes extra slashes
real_path(): properly handle nonexistent top-level paths
t0060: verify that real_path() works correctly with absolute paths
real_path(): reject the empty string
t0060: verify that real_path() fails if passed the empty string
absolute_path(): reject the empty string
t0060: verify that absolute_path() fails if passed the empty string
t0060: move tests of real_path() from t0000 to here

Merge branch 'dj/fetch-all-tags'Junio C Hamano Fri, 14 Sep 2012 18:54:19 +0000 (11:54 -0700)

Merge branch 'dj/fetch-all-tags'

"git fetch --all", when passed "--no-tags", did not honor the
"--no-tags" option while fetching from individual remotes (the same
issue existed with "--tags", but combination "--all --tags" makes
much less sense than "--all --no-tags").

* dj/fetch-all-tags:
fetch --all: pass --tags/--no-tags through to each remote

Merge branch 'sn/ls-remote-get-url-doc'Junio C Hamano Fri, 14 Sep 2012 18:54:12 +0000 (11:54 -0700)

Merge branch 'sn/ls-remote-get-url-doc'

* sn/ls-remote-get-url-doc:
ls-remote: document the '--get-url' option

Merge branch 'nd/i18n-status'Junio C Hamano Fri, 14 Sep 2012 18:54:04 +0000 (11:54 -0700)

Merge branch 'nd/i18n-status'

* nd/i18n-status:
status: remove i18n legos

Merge branch 'rj/path-cleanup'Junio C Hamano Fri, 14 Sep 2012 18:53:53 +0000 (11:53 -0700)

Merge branch 'rj/path-cleanup'

* rj/path-cleanup:
Call mkpathdup() rather than xstrdup(mkpath(...))
Call git_pathdup() rather than xstrdup(git_path("..."))
path.c: Use vsnpath() in the implementation of git_path()
path.c: Don't discard the return value of vsnpath()
path.c: Remove the 'git_' prefix from a file scope function

Merge branch 'rj/tap-fix'Junio C Hamano Fri, 14 Sep 2012 18:53:45 +0000 (11:53 -0700)

Merge branch 'rj/tap-fix'

* rj/tap-fix:
test-lib.sh: Suppress the "passed all ..." message if no tests run
test-lib.sh: Add check for invalid use of 'skip_all' facility
test-lib.sh: Fix some shell coding style violations
t4016-*.sh: Skip all tests rather than each test
t3902-*.sh: Skip all tests rather than each test
t3300-*.sh: Fix a TAP parse error

log: document use of multiple commit limiting optionsJunio C Hamano Fri, 14 Sep 2012 01:54:30 +0000 (18:54 -0700)

log: document use of multiple commit limiting options

Generally speaking, using more options will further narrow the
selection, but there are a few exceptions. Document them.

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

log --grep/--author: honor --all-match honored for... Junio C Hamano Thu, 13 Sep 2012 23:26:57 +0000 (16:26 -0700)

log --grep/--author: honor --all-match honored for multiple --grep patterns

When we have both header expression (which has to be an OR node by
construction) and a pattern expression (which could be anything), we
create a new top-level OR node to bind them together, and the
resulting expression structure looks like this:

OR
/ \
/ \
pattern OR
/ \ / \
..... committer OR
/ \
author TRUE

The three elements on the top-level backbone that are inspected by
the "all-match" logic are "pattern", "committer" and "author". When
there are more than one elements in the "pattern", the top-level
node of the "pattern" part of the subtree is an OR, and that node is
inspected by "all-match".

The result ends up ignoring the "--all-match" given from the command
line. A match on either side of the pattern is considered a match,
hence:

git log --grep=A --grep=B --author=C --all-match

shows the same "authored by C and has either A or B" that is correct
only when run without "--all-match".

Fix this by turning the resulting expression around when "--all-match"
is in effect, like this:

OR
/ \
/ \
/ OR
committer / \
author \
pattern

The set of nodes on the top-level backbone in the resulting
expression becomes "committer", "author", and the nodes that are on
the top-level backbone of the "pattern" subexpression. This makes
the "all-match" logic inspect the same nodes in "pattern" as the
case without the author and/or the committer restriction, and makes
the earlier "log" example to show "authored by C and has A and has
B", which is what the command line expects.

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

grep: show --debug output only onceMichael J Gruber Fri, 14 Sep 2012 09:46:35 +0000 (11:46 +0200)

grep: show --debug output only once

When threaded grep is in effect, the patterns are duplicated and
recompiled for each thread. Avoid "--debug" output during the
recompilation so that the output is given once instead of "1+nthreads"
times.

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

grep: teach --debug option to dump the parse treeJunio C Hamano Thu, 13 Sep 2012 21:21:44 +0000 (14:21 -0700)

grep: teach --debug option to dump the parse tree

Our "grep" allows complex boolean expressions to be formed to match
each individual line with operators like --and, '(', ')' and --not.
Introduce the "--debug" option to show the parse tree to help people
who want to debug and enhance it.

Also "log" learns "--grep-debug" option to do the same. The command
line parser to the log family is a lot more limited than the general
"git grep" parser, but it has special handling for header matching
(e.g. "--author"), and a parse tree is valuable when working on it.

Note that "--all-match" is *not* any individual node in the parse
tree. It is an instruction to the evaluator to check all the nodes
in the top-level backbone have matched and reject a document as
non-matching otherwise.

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

cherry-pick: don't forget -s on failureMiklos Vajna Fri, 14 Sep 2012 06:52:03 +0000 (08:52 +0200)

cherry-pick: don't forget -s on failure

In case 'git cherry-pick -s <commit>' failed, the user had to use 'git
commit -s' (i.e. state the -s option again), which is easy to forget
about. Instead, write the signed-off-by line early, so plain 'git
commit' will have the same result.

Also update 'git commit -s', so that in case there is already a relevant
Signed-off-by line before the Conflicts: line, it won't add one more at
the end of the message. If there is no such line, then add it before the
the Conflicts: line.

Signed-off-by: Miklos Vajna <vmiklos@suse.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert diffstat back to EnglishNguyễn Thái Ngọc Duy Thu, 13 Sep 2012 14:16:26 +0000 (21:16 +0700)

Revert diffstat back to English

This reverts the i18n part of 7f81463 (Use correct grammar in diffstat
summary line - 2012-02-01) but still keeps the grammar correctness for
English. It also reverts b354f11 (Fix tests under GETTEXT_POISON on
diffstat - 2012-08-27). The result is diffstat always in English
for all commands.

This helps stop users from accidentally sending localized
format-patch'd patches.

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

attr: failure to open a .gitattributes file is OK with... Junio C Hamano Thu, 13 Sep 2012 19:40:39 +0000 (12:40 -0700)

attr: failure to open a .gitattributes file is OK with ENOTDIR

Often we consult an in-tree .gitattributes file that exists per
directory. Majority of directories do not usually have such a file,
and it is perfectly fine if we cannot open it because there is no
such file, but we do want to know when there is an I/O or permission
error. Earlier, we made the codepath warn when we fail to open it
for reasons other than ENOENT for that reason.

We however sometimes have to attempt to open the .gitattributes file
from a directory that does not exist in the commit that is currently
checked out. "git pack-objects" wants to know if a path is marked
with "-delta" attributes, and "git archive" wants to know about
export-ignore and export-subst attributes. Both commands may and do
need to ask the attributes system about paths in an arbitrary
commit. "git diff", after removing an entire directory, may want to
know textconv on paths that used to be in that directory.

Make sure we also ignore a failure to open per-directory attributes
file due to ENOTDIR.

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

Documentation: describe subject more preciselyJeremy White Thu, 13 Sep 2012 22:27:09 +0000 (17:27 -0500)

Documentation: describe subject more precisely

The discussion of email subject throughout the documentation is
misleading; it indicates that the first line will always become
the subject. In fact, the subject is generally all lines up until
the first full blank line.

This patch refines that, and makes more use of the concept of a
commit title, with the title being all text up to the first blank line.

Signed-off-by: Jeremy White <jwhite@codeweavers.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge git://github.com/git-l10n/git-poJunio C Hamano Wed, 12 Sep 2012 23:14:14 +0000 (16:14 -0700)

Merge git://github.com/git-l10n/git-po

* git://github.com/git-l10n/git-po:
l10n: Update Swedish translation (1166t0f0u)
l10n: vi.po: update to v1.7.12-146-g16d26
l10n: de.po: translate 2 new messages
l10n: zh_CN.po: translate 2 new messages
l10n: Update git.pot (2 new, 4 removed messages)
l10n: vi.po & TEAMS: review Vietnamese translation

l10n: Update Swedish translation (1166t0f0u)Peter Krefting Fri, 7 Sep 2012 09:10:23 +0000 (10:10 +0100)

l10n: Update Swedish translation (1166t0f0u)

Signed-off-by: Peter Krefting <peter@softwolves.pp.se>

Merge git://github.com/vnwildman/gitJiang Xin Wed, 12 Sep 2012 22:32:36 +0000 (06:32 +0800)

Merge git://github.com/vnwildman/git

* git://github.com/vnwildman/git:
l10n: vi.po: update to v1.7.12-146-g16d26

Start merging the sixth batch for 1.8.0Junio C Hamano Wed, 12 Sep 2012 21:33:50 +0000 (14:33 -0700)

Start merging the sixth batch for 1.8.0

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

Merge branch 'maint'Junio C Hamano Wed, 12 Sep 2012 21:36:39 +0000 (14:36 -0700)

Merge branch 'maint'

Merge branch 'jc/maint-checkout-fileglob-doc'Junio C Hamano Wed, 12 Sep 2012 21:22:08 +0000 (14:22 -0700)

Merge branch 'jc/maint-checkout-fileglob-doc'

Updated with help from Peff.

* jc/maint-checkout-fileglob-doc:
gitcli: contrast wildcard given to shell and to git
gitcli: formatting fix
Document file-glob for "git checkout -- '*.c'"

Merge branch 'sb/send-email-reconfirm-fix'Junio C Hamano Wed, 12 Sep 2012 21:22:03 +0000 (14:22 -0700)

Merge branch 'sb/send-email-reconfirm-fix'

* sb/send-email-reconfirm-fix:
send-email: initial_to and initial_reply_to are both optional

Merge branch 'nd/maint-remote-remove'Junio C Hamano Wed, 12 Sep 2012 21:21:58 +0000 (14:21 -0700)

Merge branch 'nd/maint-remote-remove'

* nd/maint-remote-remove:
remote: prefer subcommand name 'remove' to 'rm'

Merge branch 'nd/log-n-doc'Junio C Hamano Wed, 12 Sep 2012 21:21:55 +0000 (14:21 -0700)

Merge branch 'nd/log-n-doc'

* nd/log-n-doc:
doc: move rev-list option -<n> from git-log.txt to rev-list-options.txt

Merge branch 'kd/cvsimport-avoid-invalid-tag'Junio C Hamano Wed, 12 Sep 2012 21:21:50 +0000 (14:21 -0700)

Merge branch 'kd/cvsimport-avoid-invalid-tag'

"cvsimport" tried to create a tag taken from CVS without
sufficiently sanitizing it, causing the import to fail when an
invalid character in the tagname made underlying "git tag" to fail.

* kd/cvsimport-avoid-invalid-tag:
cvsimport: strip all inappropriate tag strings

Merge branch 'js/compat-itimer'Junio C Hamano Wed, 12 Sep 2012 21:21:44 +0000 (14:21 -0700)

Merge branch 'js/compat-itimer'

Pieces to support compilation on __TANDEM.

* js/compat-itimer:
Add a no-op setitimer() wrapper

Merge branch 'js/compat-mkdir'Junio C Hamano Wed, 12 Sep 2012 21:21:39 +0000 (14:21 -0700)

Merge branch 'js/compat-mkdir'

Finishing touches to recently added wrapper for mkdir() that do not
want to see trailing slashes.

* js/compat-mkdir:
Document MKDIR_WO_TRAILING_SLASH in Makefile

Further merging in preparation for 1.7.12.1Junio C Hamano Wed, 12 Sep 2012 21:10:54 +0000 (14:10 -0700)

Further merging in preparation for 1.7.12.1

Describe the following in the draft release notes:

. jc/apply-binary-p0
. jc/dotdot-is-parent-directory
. jc/maint-doc-checkout-b-always-takes-branch-name
. jk/maint-http-half-auth-push
. kk/maint-for-each-ref-multi-sort

Yet to be merged before 1.7.12.1 are:

. jk/config-warn-on-inaccessible-paths
. jk/maint-quiet-is-synonym-to-s-in-log
. mz/cherry-pick-cmdline-order

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

Merge branch 'maint-1.7.11' into maintJunio C Hamano Wed, 12 Sep 2012 21:08:05 +0000 (14:08 -0700)

Merge branch 'maint-1.7.11' into maint

Merge branch 'jc/apply-binary-p0' into maint-1.7.11Junio C Hamano Wed, 12 Sep 2012 21:00:52 +0000 (14:00 -0700)

Merge branch 'jc/apply-binary-p0' into maint-1.7.11

"git apply -p0" did not parse pathnames on "diff --git" line
correctly. This caused patches that had pathnames in no other
places to be mistakenly rejected (most notably, binary patch that
does not rename nor change mode). Textual patches, renames or mode
changes have preimage and postimage pathnames in different places in
a form that can be parsed unambiguously and did not suffer from this
problem.

* jc/apply-binary-p0:
apply: compute patch->def_name correctly under -p0

Merge branch 'jc/dotdot-is-parent-directory' into maint... Junio C Hamano Wed, 12 Sep 2012 21:00:34 +0000 (14:00 -0700)

Merge branch 'jc/dotdot-is-parent-directory' into maint-1.7.11

"git log .." errored out saying it is both rev range and a path when
there is no disambiguating "--" is on the command line. Update the
command line parser to interpret ".." as a path in such a case.

* jc/dotdot-is-parent-directory:
specifying ranges: we did not mean to make ".." an empty set

Merge branch 'jc/maint-doc-checkout-b-always-takes... Junio C Hamano Wed, 12 Sep 2012 20:59:58 +0000 (13:59 -0700)

Merge branch 'jc/maint-doc-checkout-b-always-takes-branch-name' into maint-1.7.11

The synopsis said "checkout [-B branch]" to make it clear the
branch name is a parameter to the option, but the heading for the
option description was "-B::", not "-B branch::", making the
documentation misleading.

* jc/maint-doc-checkout-b-always-takes-branch-name:
doc: "git checkout -b/-B/--orphan" always takes a branch name

Merge branch 'jk/maint-http-half-auth-push' into maint... Junio C Hamano Wed, 12 Sep 2012 20:58:22 +0000 (13:58 -0700)

Merge branch 'jk/maint-http-half-auth-push' into maint-1.7.11

Pushing to smart HTTP server with recent Git fails without having
the username in the URL to force authentication, if the server is
configured to allow GET anonymously, while requiring authentication
for POST.

* jk/maint-http-half-auth-push:
http: prompt for credentials on failed POST
http: factor out http error code handling
t: test http access to "half-auth" repositories
t: test basic smart-http authentication
t/lib-httpd: recognize */smart/* repos as smart-http
t/lib-httpd: only route auth/dumb to dumb repos
t5550: factor out http auth setup
t5550: put auth-required repo in auth/dumb

Merge branch 'kk/maint-for-each-ref-multi-sort' into... Junio C Hamano Wed, 12 Sep 2012 20:57:43 +0000 (13:57 -0700)

Merge branch 'kk/maint-for-each-ref-multi-sort' into maint-1.7.11

"git for-each-ref" did not honor multiple "--sort=<key>" arguments
correctly.

* kk/maint-for-each-ref-multi-sort:
for-each-ref: Fix sort with multiple keys
t6300: test sort with multiple keys

fetch-pack: eliminate spurious error messagesMichael Haggerty Sun, 9 Sep 2012 06:19:49 +0000 (08:19 +0200)

fetch-pack: eliminate spurious error messages

It used to be that if "--all", "--depth", and also explicit references
were sought, then the explicit references were not handled correctly
in filter_refs() because the "--all --depth" code took precedence over
the explicit reference handling, and the explicit references were
never noted as having been found. So check for explicitly sought
references before proceeding to the "--all --depth" logic.

This fixes two test cases in t5500.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cmd_fetch_pack(): simplify computation of return valueMichael Haggerty Sun, 9 Sep 2012 06:19:48 +0000 (08:19 +0200)

cmd_fetch_pack(): simplify computation of return value

Set the final value at initialization rather than initializing it then
sometimes changing it.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch-pack: report missing refs even if no existing... Michael Haggerty Sun, 9 Sep 2012 06:19:47 +0000 (08:19 +0200)

fetch-pack: report missing refs even if no existing refs were received

This fixes a test in t5500.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

cmd_fetch_pack(): return early if finish_connect()... Michael Haggerty Sun, 9 Sep 2012 06:19:46 +0000 (08:19 +0200)

cmd_fetch_pack(): return early if finish_connect() fails

This simplifies the logic without changing the behavior.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

filter_refs(): simplify logicMichael Haggerty Sun, 9 Sep 2012 06:19:45 +0000 (08:19 +0200)

filter_refs(): simplify logic

Simplify flow within loop: first decide whether to keep the reference,
then keep/free it. This makes it clearer that each ref has exactly
two possible destinies, and removes duplication of the code for
appending the reference to the linked list.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

filter_refs(): build refs list as we goMichael Haggerty Sun, 9 Sep 2012 06:19:44 +0000 (08:19 +0200)

filter_refs(): build refs list as we go

Instead of temporarily storing matched refs to temporary array
"return_refs", simply append them to newlist as we go. This changes
the order of references in newlist to strictly sorted if "--all" and
"--depth" and named references are all specified, but that usage is
broken anyway (see the last two tests in t5500).

This changes the last test in t5500 from segfaulting into just
emitting a spurious error (this will be fixed in a moment).

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

filter_refs(): delete matched refs from sought listMichael Haggerty Sun, 9 Sep 2012 06:19:43 +0000 (08:19 +0200)

filter_refs(): delete matched refs from sought list

Remove any references that are available from the remote from the
sought list (rather than overwriting their names with NUL characters,
as previously). Mark matching entries by writing a non-NULL pointer
to string_list_item::util during the iteration, then use
filter_string_list() later to filter out the entries that have been
marked.

Document this aspect of fetch_pack() in a comment in the header file.
(More documentation is obviously still needed.)

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch_pack(): update sought->nr to reflect number of... Michael Haggerty Sun, 9 Sep 2012 06:19:42 +0000 (08:19 +0200)

fetch_pack(): update sought->nr to reflect number of unique entries

fetch_pack() removes duplicates from the "sought" list, thereby
shrinking the list. But previously, the caller was not informed about
the shrinkage. This would cause a spurious error message to be
emitted by cmd_fetch_pack() if "git fetch-pack" is called with
duplicate refnames.

Instead, remove duplicates using string_list_remove_duplicates(),
which adjusts sought->nr to reflect the new length of the list.

The last test of t5500 inexplicably *required* "git fetch-pack" to
fail when fetching a list of references that contains duplicates;
i.e., it insisted on the buggy behavior. So change the test to expect
the correct behavior.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

filter_refs(): do not check the same sought_pos twiceMichael Haggerty Sun, 9 Sep 2012 06:19:41 +0000 (08:19 +0200)

filter_refs(): do not check the same sought_pos twice

Once a match has been found at sought_pos, the entry is zeroed and no
future attempts will match that entry. So increment sought_pos to
avoid checking against the zeroed-out entry during the next iteration.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Change fetch_pack() and friends to take string_list... Michael Haggerty Sun, 9 Sep 2012 06:19:40 +0000 (08:19 +0200)

Change fetch_pack() and friends to take string_list arguments

Instead of juggling <nr_heads,heads> (sometimes called
<nr_match,match>), pass around the list of references to be sought in
a single string_list variable called "sought". Future commits will
make more use of string_list functionality.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>