gitweb.git
Merge branch 'rs/reflog-exists'Junio C Hamano Fri, 6 Jun 2014 18:23:04 +0000 (11:23 -0700)

Merge branch 'rs/reflog-exists'

* rs/reflog-exists:
checkout.c: use ref_exists instead of file_exist
refs.c: add new functions reflog_exists and delete_reflog

Merge branch 'tg/tag-state-tag-name-in-editor-hints'Junio C Hamano Fri, 6 Jun 2014 18:22:24 +0000 (11:22 -0700)

Merge branch 'tg/tag-state-tag-name-in-editor-hints'

* tg/tag-state-tag-name-in-editor-hints:
builtin/tag.c: show tag name to hint in the message editor

Merge branch 'jk/grep-tell-run-command-to-cd-when-runni... Junio C Hamano Fri, 6 Jun 2014 18:21:49 +0000 (11:21 -0700)

Merge branch 'jk/grep-tell-run-command-to-cd-when-running-pager'

* jk/grep-tell-run-command-to-cd-when-running-pager:
grep: use run-command's "dir" option for --open-files-in-pager

Merge branch 'fc/status-printf-squelch-format-zero... Junio C Hamano Fri, 6 Jun 2014 18:21:47 +0000 (11:21 -0700)

Merge branch 'fc/status-printf-squelch-format-zero-length-warnings'

* fc/status-printf-squelch-format-zero-length-warnings:
silence a bunch of format-zero-length warnings

Merge branch 'jk/squelch-compiler-warning-from-funny... Junio C Hamano Fri, 6 Jun 2014 18:21:36 +0000 (11:21 -0700)

Merge branch 'jk/squelch-compiler-warning-from-funny-error-macro'

* jk/squelch-compiler-warning-from-funny-error-macro:
let clang use the constant-return error() macro
inline constant return from error() function

Merge branch 'dk/raise-core-deltabasecachelimit'Junio C Hamano Fri, 6 Jun 2014 18:18:34 +0000 (11:18 -0700)

Merge branch 'dk/raise-core-deltabasecachelimit'

The `core.deltabasecachelimit` used to default to 16 MiB , but this
proved to be too small, and has been bumped to 96 MiB.

* dk/raise-core-deltabasecachelimit:
Bump core.deltaBaseCacheLimit to 96m

Merge branch 'tl/relax-in-poll-emulation'Junio C Hamano Fri, 6 Jun 2014 18:18:29 +0000 (11:18 -0700)

Merge branch 'tl/relax-in-poll-emulation'

* tl/relax-in-poll-emulation:
compat/poll: sleep 1 millisecond to avoid busy wait

Merge branch 'jk/utf8-switch-between-nfd-and-nfc'Junio C Hamano Fri, 6 Jun 2014 18:18:26 +0000 (11:18 -0700)

Merge branch 'jk/utf8-switch-between-nfd-and-nfc'

Document a known breakage with a test.

* jk/utf8-switch-between-nfd-and-nfc:
t3910: show failure of core.precomposeunicode with decomposed filenames

Merge branch 'da/imap-send-use-credential-helper'Junio C Hamano Fri, 6 Jun 2014 18:17:56 +0000 (11:17 -0700)

Merge branch 'da/imap-send-use-credential-helper'

"git imap-send" learns to ask the credential helper for
authentication material.

* da/imap-send-use-credential-helper:
imap-send: use git-credential

Merge branch 'je/pager-do-not-recurse'Junio C Hamano Fri, 6 Jun 2014 18:16:59 +0000 (11:16 -0700)

Merge branch 'je/pager-do-not-recurse'

We used to unconditionally disable the pager in the pager process
we spawn to feed out output, but that prevented people who want to
run "less" within "less" from doing so.

* je/pager-do-not-recurse:
pager: do allow spawning pager recursively

Merge branch 'jk/commit-C-pick-empty'Junio C Hamano Fri, 6 Jun 2014 18:16:04 +0000 (11:16 -0700)

Merge branch 'jk/commit-C-pick-empty'

"git commit --allow-empty-message -C $commit" did not work when the
commit did not have any log message.

* jk/commit-C-pick-empty:
commit: do not complain of empty messages from -C

Merge branch 'mm/pager-less-sans-S'Junio C Hamano Fri, 6 Jun 2014 18:02:59 +0000 (11:02 -0700)

Merge branch 'mm/pager-less-sans-S'

Since the very beginning of Git, we gave the LESS environment a
default value "FRSX" when we spawn "less" as the pager. "S" (chop
long lines instead of wrapping) has been removed from this default
set of options, because it is more or less a personal taste thing,
as opposed to others that have good justifications (i.e. "R" is very
much justified because many kinds of output we produce are colored
and "FX" is justified because output we produce is often shorter
than a page).

Existing users who prefer not to see line-wrapped output may want to
set

$ git config core.pager "less -S"

to restore the traditional behaviour. It is expected that people
find output from the most subcommands easier to read with the new
default, except for "blame" which tends to produce really long
lines. To override the new default only for "git blame", you can do
this:

$ git config pager.blame "less -S"

* mm/pager-less-sans-S:
pager: remove 'S' from $LESS by default

refs.c: optimize check_refname_component()David Turner Wed, 4 Jun 2014 03:38:10 +0000 (23:38 -0400)

refs.c: optimize check_refname_component()

In a repository with many refs, check_refname_component can be a major
contributor to the runtime of some git commands. One such command is

git rev-parse HEAD

Timings for one particular repo, with about 60k refs, almost all
packed, are:

Old: 35 ms
New: 29 ms

Many other commands which read refs are also sped up.

Signed-off-by: David Turner <dturner@twitter.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch: allow explicit --refmap to override configurationJunio C Hamano Thu, 29 May 2014 22:21:31 +0000 (15:21 -0700)

fetch: allow explicit --refmap to override configuration

Since the introduction of opportunisitic updates of remote-tracking
branches, started at around f2690487 (fetch: opportunistically
update tracking refs, 2013-05-11) with a few updates in v1.8.4 era,
the remote.*.fetch configuration always kicks in even when a refspec
to specify what to fetch is given on the command line, and there is
no way to disable or override it per-invocation.

Teach the command to pay attention to the --refmap=<lhs>:<rhs>
command-line options that can be used to override the use of
configured remote.*.fetch as the refmap.

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

fetch doc: add a section on configured remote-tracking... Junio C Hamano Thu, 29 May 2014 21:24:23 +0000 (14:24 -0700)

fetch doc: add a section on configured remote-tracking branches

To resurrect a misleading mention removed in the previous step,
add a section to explain how the remote-tracking configuration
interacts with the refspecs given as the command-line arguments.

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

t/t7810-grep.sh: remove duplicate test_config()Jeremiah Mahler Thu, 5 Jun 2014 05:18:18 +0000 (22:18 -0700)

t/t7810-grep.sh: remove duplicate test_config()

t/t7810-grep.sh had its own test_config() function which served the
same purpose as the one in t/test-lib-functions.sh. Removed, all tests
pass.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch doc: remove "short-cut" sectionJunio C Hamano Thu, 29 May 2014 20:22:01 +0000 (13:22 -0700)

fetch doc: remove "short-cut" section

It is misleading to mention that <ref> that does not store is to
fetch the ref into FETCH_HEAD, because a refspec that does store is
also to fetch the LHS into FETCH_HEAD. It is doubly misleading to
list it as part of "short-cut". <ref> stands for a refspec that has
it on the LHS with a colon and an empty RHS, and that definition
should be given at the beginning of the entry where the format is
defined.

Tentatively remove this misleading description, which leaves the
`tag <tag>` as the only true short-hand, so move it at the beginning
of the entry.

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

fetch doc: update refspec format descriptionJunio C Hamano Thu, 29 May 2014 20:28:21 +0000 (13:28 -0700)

fetch doc: update refspec format description

The text made it sound as if the leading plus is the only thing that
is optional, and forgot that <lhs> is the same as <lhs>:, i.e. fetch
it and do not store anywhere.

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

fetch doc: on pulling multiple refspecsJunio C Hamano Thu, 29 May 2014 20:07:44 +0000 (13:07 -0700)

fetch doc: on pulling multiple refspecs

Replace desription of old-style "Pull:" lines in remotes/
configuration with modern remote.*.fetch variables.

As this note applies only to "git pull", enable it only
in git-pull manual page.

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

shortlog: allow --exclude=<glob> to be passedJunio C Hamano Fri, 30 May 2014 19:57:25 +0000 (12:57 -0700)

shortlog: allow --exclude=<glob> to be passed

These two commands are supposed to be equivalent:

$ git log --exclude=refs/notes/\* --all --no-merges --since=2.days |
git shortlog
$ git shortlog --exclude=refs/notes/\* --all --no-merges --since=2.days

However, the latter does not understand the ref-exclusion command
line option, even though other options understood by "log", such as
"--all" and "--no-merges", are understood.

This was because e7b432c5 (revision: introduce --exclude=<glob> to
tame wildcards, 2013-08-30) did not wire the new option fully to the
machinery. A new option understood by handle_revision_pseudo_opt()
must be told to handle_revision_opt() as well.

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

t5000, t5003: do not use test_cmp to compare binary... Stepan Kasal Wed, 4 Jun 2014 15:57:52 +0000 (17:57 +0200)

t5000, t5003: do not use test_cmp to compare binary files

test_cmp() is primarily meant to compare text files (and display the
difference for debug purposes).

Raw "cmp" is better suited to compare binary files (tar, zip, etc.).

On MinGW, test_cmp is a shell function mingw_test_cmp that tries to
read both files into environment, stripping CR characters (introduced
in commit 4d715ac0).

This function usually speeds things up, as fork is extremly slow on
Windows. But no wonder that this function is extremely slow and
sometimes even crashes when comparing large tar or zip files.

Signed-off-by: Stepan Kasal <kasal@ucw.cz>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

update-index: fix segfault with missing --cacheinfo... Jeff King Wed, 4 Jun 2014 07:11:11 +0000 (03:11 -0400)

update-index: fix segfault with missing --cacheinfo argument

Running "git update-index --cacheinfo" without any further
arguments results in a segfault rather than an error
message. Commit ec160ae (update-index: teach --cacheinfo a
new syntax "mode,sha1,path", 2014-03-23) added code to
examine the format of the argument, but forgot to handle the
NULL case.

Returning an error from the parser is enough, since we then
treat it as an old-style "--cacheinfo <mode> <sha1> <path>",
and complain that we have less than 3 arguments to read.

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

First batch for 2.1Junio C Hamano Tue, 3 Jun 2014 19:08:37 +0000 (12:08 -0700)

First batch for 2.1

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

Merge branch 'sk/msvc-dynlink-crt'Junio C Hamano Tue, 3 Jun 2014 19:06:46 +0000 (12:06 -0700)

Merge branch 'sk/msvc-dynlink-crt'

* sk/msvc-dynlink-crt:
MSVC: link dynamically to the CRT

Merge branch 'ew/config-protect-mode'Junio C Hamano Tue, 3 Jun 2014 19:06:46 +0000 (12:06 -0700)

Merge branch 'ew/config-protect-mode'

* ew/config-protect-mode:
config: preserve config file permissions on edits

Merge branch 'bg/strbuf-trim'Junio C Hamano Tue, 3 Jun 2014 19:06:46 +0000 (12:06 -0700)

Merge branch 'bg/strbuf-trim'

* bg/strbuf-trim:
api-strbuf.txt: add docs for _trim and _ltrim
strbuf: use _rtrim and _ltrim in strbuf_trim

Merge branch 'jk/commit-date-approxidate'Junio C Hamano Tue, 3 Jun 2014 19:06:46 +0000 (12:06 -0700)

Merge branch 'jk/commit-date-approxidate'

* jk/commit-date-approxidate:
commit: accept more date formats for "--date"
commit: print "Date" line when the user has set date
pretty: make show_ident_date public
commit: use split_ident_line to compare author/committer

Merge branch 'ep/shell-command-substitution'Junio C Hamano Tue, 3 Jun 2014 19:06:45 +0000 (12:06 -0700)

Merge branch 'ep/shell-command-substitution'

Adjust shell scripts to use $(cmd) instead of `cmd`.

* ep/shell-command-substitution: (41 commits)
t5000-tar-tree.sh: use the $( ... ) construct for command substitution
t4204-patch-id.sh: use the $( ... ) construct for command substitution
t4119-apply-config.sh: use the $( ... ) construct for command substitution
t4116-apply-reverse.sh: use the $( ... ) construct for command substitution
t4057-diff-combined-paths.sh: use the $( ... ) construct for command substitution
t4038-diff-combined.sh: use the $( ... ) construct for command substitution
t4036-format-patch-signer-mime.sh: use the $( ... ) construct for command substitution
t4014-format-patch.sh: use the $( ... ) construct for command substitution
t4013-diff-various.sh: use the $( ... ) construct for command substitution
t4012-diff-binary.sh: use the $( ... ) construct for command substitution
t4010-diff-pathspec.sh: use the $( ... ) construct for command substitution
t4006-diff-mode.sh: use the $( ... ) construct for command substitution
t3910-mac-os-precompose.sh: use the $( ... ) construct for command substitution
t3905-stash-include-untracked.sh: use the $( ... ) construct for command substitution
t1050-large.sh: use the $( ... ) construct for command substitution
t1020-subdirectory.sh: use the $( ... ) construct for command substitution
t1004-read-tree-m-u-wf.sh: use the $( ... ) construct for command substitution
t1003-read-tree-prefix.sh: use the $( ... ) construct for command substitution
t1002-read-tree-m-u-2way.sh: use the $( ... ) construct for command substitution
t1001-read-tree-m-2way.sh: use the $( ... ) construct for command substitution
...

Merge branch 'fc/rerere-conflict-style'Junio C Hamano Tue, 3 Jun 2014 19:06:45 +0000 (12:06 -0700)

Merge branch 'fc/rerere-conflict-style'

* fc/rerere-conflict-style:
rerere: fix for merge.conflictstyle

Merge branch 'dt/api-doc-setup-gently'Junio C Hamano Tue, 3 Jun 2014 19:06:45 +0000 (12:06 -0700)

Merge branch 'dt/api-doc-setup-gently'

* dt/api-doc-setup-gently:
docs: document RUN_SETUP_GENTLY and clarify RUN_SETUP

Merge branch 'fc/mergetool-prompt'Junio C Hamano Tue, 3 Jun 2014 19:06:44 +0000 (12:06 -0700)

Merge branch 'fc/mergetool-prompt'

mergetool.prompt used to default to 'true', always causing a confirmation
"do you really want to run the tool on this path" to be shown.

Among the two purposes the prompt serves, ignore the use case to
confirm that the user wants to view particular path with the named
tool, and make the prompt only to confirm the choice of the tool
made by autodetection and defaulting. For those who configured the
tool explicitly, the prompt shown for the latter purpose is simply
annoying.

Strictly speaking, this is a backward incompatible change and the
users need to explicitly set the variable to 'true' if they want to
resurrect the now-ignored use case.

* fc/mergetool-prompt:
mergetool: document the default for --[no-]prompt
mergetool: run prompt only if guessed tool

Merge branch 'mm/mediawiki-encoding-fix'Junio C Hamano Tue, 3 Jun 2014 19:06:44 +0000 (12:06 -0700)

Merge branch 'mm/mediawiki-encoding-fix'

* mm/mediawiki-encoding-fix:
git-remote-mediawiki: fix encoding issue for UTF-8 media files
git-remote-mediawiki: allow stop/start-ing the test server

Merge branch 'sk/tag-contains-wo-recursion'Junio C Hamano Tue, 3 Jun 2014 19:06:44 +0000 (12:06 -0700)

Merge branch 'sk/tag-contains-wo-recursion'

* sk/tag-contains-wo-recursion:
git tag --contains: avoid stack overflow

Merge branch 'ef/send-email-absolute-path-to-the-command'Junio C Hamano Tue, 3 Jun 2014 19:06:44 +0000 (12:06 -0700)

Merge branch 'ef/send-email-absolute-path-to-the-command'

* ef/send-email-absolute-path-to-the-command:
send-email: windows drive prefix (e.g. C:) appears only at the beginning
send-email: recognize absolute path on Windows

Merge branch 'jx/blame-align-relative-time'Junio C Hamano Tue, 3 Jun 2014 19:06:43 +0000 (12:06 -0700)

Merge branch 'jx/blame-align-relative-time'

"git blame" miscounted number of columns needed to show localized
timestamps, resulting in jaggy left-side-edge of the source code
lines in its output.

* jx/blame-align-relative-time:
blame: dynamic blame_date_width for different locales
blame: fix broken time_buf paddings in relative timestamp

Merge branch 'lr/git-run-setup-gently'Junio C Hamano Tue, 3 Jun 2014 19:06:43 +0000 (12:06 -0700)

Merge branch 'lr/git-run-setup-gently'

* lr/git-run-setup-gently:
git.c: treat RUN_SETUP_GENTLY and RUN_SETUP as mutually exclusive

Merge branch 'fc/mergetools-vimdiff3'Junio C Hamano Tue, 3 Jun 2014 19:06:43 +0000 (12:06 -0700)

Merge branch 'fc/mergetools-vimdiff3'

* fc/mergetools-vimdiff3:
mergetools: add vimdiff3 mode

Merge branch 'fc/merge-default-to-upstream'Junio C Hamano Tue, 3 Jun 2014 19:06:43 +0000 (12:06 -0700)

Merge branch 'fc/merge-default-to-upstream'

"git merge" without argument, even when there is an upstream
defined for the current branch, refused to run until
merge.defaultToUpstream is set to true. Flip the default of that
configuration variable to true.

* fc/merge-default-to-upstream:
merge: enable defaulttoupstream by default

Merge branch 'jk/external-diff-use-argv-array'Junio C Hamano Tue, 3 Jun 2014 19:06:42 +0000 (12:06 -0700)

Merge branch 'jk/external-diff-use-argv-array'

Code clean-up (and a bugfix which has been merged for 2.0).

* jk/external-diff-use-argv-array:
run_external_diff: refactor cmdline setup logic
run_external_diff: hoist common bits out of conditional
run_external_diff: drop fflush(NULL)
run_external_diff: clean up error handling
run_external_diff: use an argv_array for the environment

Merge branch 'sk/svn-parse-datestamp'Junio C Hamano Tue, 3 Jun 2014 19:06:42 +0000 (12:06 -0700)

Merge branch 'sk/svn-parse-datestamp'

* sk/svn-parse-datestamp:
SVN.pm::parse_svn_date: allow timestamps with a single-digit hour

Merge branch 'rs/ref-update-check-errors-early'Junio C Hamano Tue, 3 Jun 2014 19:06:42 +0000 (12:06 -0700)

Merge branch 'rs/ref-update-check-errors-early'

* rs/ref-update-check-errors-early:
commit.c: check for lock error and return early
sequencer.c: check for lock failure and bail early in fast_forward_to

Merge branch 'nd/index-pack-one-fd-per-thread'Junio C Hamano Tue, 3 Jun 2014 19:06:42 +0000 (12:06 -0700)

Merge branch 'nd/index-pack-one-fd-per-thread'

Enable threaded index-pack on platforms without thread-unsafe
pread() emulation.

* nd/index-pack-one-fd-per-thread:
index-pack: work around thread-unsafe pread()

Merge branch 'ym/fix-opportunistic-index-update-race'Junio C Hamano Tue, 3 Jun 2014 19:06:41 +0000 (12:06 -0700)

Merge branch 'ym/fix-opportunistic-index-update-race'

Read-only operations such as "git status" that internally refreshes
the index write out the refreshed index to the disk to optimize
future accesses to the working tree, but this could race with a
"read-write" operation that modify the index while it is running.
Detect such a race and avoid overwriting the index.

Duy raised a good point that we may need to do the same for the
normal writeout codepath, not just the "opportunistic" update
codepath. While that is true, nobody sane would be running two
simultaneous operations that are clearly write-oriented competing
with each other against the same index file. So in that sense that
can be done as a less urgent follow-up for this topic.

* ym/fix-opportunistic-index-update-race:
read-cache.c: verify index file before we opportunistically update it
wrapper.c: add xpread() similar to xread()

Merge branch 'mh/ref-transaction'Junio C Hamano Tue, 3 Jun 2014 19:06:40 +0000 (12:06 -0700)

Merge branch 'mh/ref-transaction'

Update "update-ref --stdin [-z]" and then introduce a transactional
support for (multi-)reference updates.

* mh/ref-transaction: (27 commits)
ref_transaction_commit(): work with transaction->updates in place
struct ref_update: add a type field
struct ref_update: add a lock field
ref_transaction_commit(): simplify code using temporary variables
struct ref_update: store refname as a FLEX_ARRAY
struct ref_update: rename field "ref_name" to "refname"
refs: remove API function update_refs()
update-ref --stdin: reimplement using reference transactions
refs: add a concept of a reference transaction
update-ref --stdin: harmonize error messages
update-ref --stdin: improve the error message for unexpected EOF
t1400: test one mistake at a time
update-ref --stdin -z: deprecate interpreting the empty string as zeros
update-ref.c: extract a new function, parse_next_sha1()
t1400: test that stdin -z update treats empty <newvalue> as zeros
update-ref --stdin: simplify error messages for missing oldvalues
update-ref --stdin: make error messages more consistent
update-ref --stdin: improve error messages for invalid values
update-ref.c: extract a new function, parse_refname()
parse_cmd_verify(): copy old_sha1 instead of evaluating <oldvalue> twice
...

Merge branch 'ks/tree-diff-nway'Junio C Hamano Tue, 3 Jun 2014 19:06:40 +0000 (12:06 -0700)

Merge branch 'ks/tree-diff-nway'

Instead of running N pair-wise diff-trees when inspecting a
N-parent merge, find the set of paths that were touched by walking
N+1 trees in parallel. These set of paths can then be turned into
N pair-wise diff-tree results to be processed through rename
detections and such. And N=2 case nicely degenerates to the usual
2-way diff-tree, which is very nice.

* ks/tree-diff-nway:
mingw: activate alloca
combine-diff: speed it up, by using multiparent diff tree-walker directly
tree-diff: rework diff_tree() to generate diffs for multiparent cases as well
Portable alloca for Git
tree-diff: reuse base str(buf) memory on sub-tree recursion
tree-diff: no need to call "full" diff_tree_sha1 from show_path()
tree-diff: rework diff_tree interface to be sha1 based
tree-diff: diff_tree() should now be static
tree-diff: remove special-case diff-emitting code for empty-tree cases
tree-diff: simplify tree_entry_pathcmp
tree-diff: show_path prototype is not needed anymore
tree-diff: rename compare_tree_entry -> tree_entry_pathcmp
tree-diff: move all action-taking code out of compare_tree_entry()
tree-diff: don't assume compare_tree_entry() returns -1,0,1
tree-diff: consolidate code for emitting diffs and recursion in one place
tree-diff: show_tree() is not needed
tree-diff: no need to pass match to skip_uninteresting()
tree-diff: no need to manually verify that there is no mode change for a path
combine-diff: move changed-paths scanning logic into its own function
combine-diff: move show_log_first logic/action out of paths scanning

Merge branch 'jc/apply-ignore-whitespace'Junio C Hamano Tue, 3 Jun 2014 19:06:40 +0000 (12:06 -0700)

Merge branch 'jc/apply-ignore-whitespace'

"--ignore-space-change" option of "git apply" ignored the
spaces at the beginning of line too aggressively, which is
inconsistent with the option of the same name "diff" and "git diff"
have.

* jc/apply-ignore-whitespace:
apply --ignore-space-change: lines with and without leading whitespaces do not match

Merge branch 'as/grep-fullname-config'Junio C Hamano Tue, 3 Jun 2014 19:06:39 +0000 (12:06 -0700)

Merge branch 'as/grep-fullname-config'

Add a configuration variable to force --full-name to be default for
"git grep".

This may cause regressions on scripted users that do not expect
this new behaviour.

* as/grep-fullname-config:
grep: add grep.fullName config variable

refs.c: change read_ref_at to use the reflog iteratorsRonnie Sahlberg Tue, 3 Jun 2014 16:09:59 +0000 (09:09 -0700)

refs.c: change read_ref_at to use the reflog iterators

read_ref_at has its own parsing of the reflog file for no really good reason
so lets change this to use the existing reflog iterators. This removes one
instance where we manually unmarshall the reflog file format.

Remove the now redundant ref_msg function.

Log messages for errors are changed slightly. We no longer print the file
name for the reflog, instead we refer to it as 'Log for ref <refname>'.
This might be a minor useability regression, but I don't really think so, since
experienced users would know where the log is anyway and inexperienced users
would not know what to do about/how to repair 'Log ... has gap ...' anyway.

Adapt the t1400 test to handle the change in log messages.

Signed-off-by: Ronnie Sahlberg <sahlberg@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

environment.c: enable core.preloadindex by defaultSteve Hoelzer Mon, 2 Jun 2014 16:43:00 +0000 (11:43 -0500)

environment.c: enable core.preloadindex by default

Many people are on filesystems with horrible stat latency (not
limited to Windows but also NFS), which core.preloadindex was
designed to help. We discussed enabling it by default early in 2013
but didn't.

Per

http://thread.gmane.org/gmane.comp.version-control.git/219273/focus=219322

let's enable the setting by default, with the original choice of max
20 threads / min 500 paths per thread parameters.

Signed-off-by: Steve Hoelzer <shoelzer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

error_resolve_conflict: drop quotations around operationJeff King Tue, 3 Jun 2014 07:23:49 +0000 (03:23 -0400)

error_resolve_conflict: drop quotations around operation

When you try to commit with unmerged entries, you get an
error like:

$ git commit
error: 'commit' is not possible because you have unmerged files.

The quotes around "commit" are clunky; the user doesn't care
that this message is a template with the command-name filled
in. Saying:

error: commit is not possible because you have unmerged files

is easier to read. As this code is called from other places,
we may also end up with:

$ git merge
error: merge is not possible because you have unmerged files

$ git cherry-pick foo
error: cherry-pick is not possible because you have unmerged files

$ git revert foo
error: revert is not possible because you have unmerged files

All of which look better without the quotes. This also
happens to match the behavior of "git pull", which generates
a similar message (but does not share code, as it is a shell
script).

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

error_resolve_conflict: rewrap advice messageJeff King Tue, 3 Jun 2014 07:17:17 +0000 (03:17 -0400)

error_resolve_conflict: rewrap advice message

If you try to commit with unresolved conflicts in the index,
you get this message:

$ git commit
U foo
error: 'commit' is not possible because you have unmerged files.
hint: Fix them up in the work tree,
hint: and then use 'git add/rm <file>' as
hint: appropriate to mark resolution and make a commit,
hint: or use 'git commit -a'.
fatal: Exiting because of an unresolved conflict.

The irregular line-wrapping makes this awkward to read, and
it takes up more lines than necessary. Instead, let's rewrap
it to about 60 characters per line:

$ git commit
U foo
error: 'commit' is not possible because you have unmerged files.
hint: Fix them up in the work tree, and then use 'git add/rm <file>'
hint: as appropriate to mark resolution and make a commit, or use
hint: 'git commit -a'.
fatal: Exiting because of an unresolved conflict.

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

dir.c:trim_trailing_spaces(): fix for " \ " sequencePasha Bolokhov Mon, 2 Jun 2014 22:36:56 +0000 (15:36 -0700)

dir.c:trim_trailing_spaces(): fix for " \ " sequence

Discard the unnecessary 'nr_spaces' variable, remove 'strlen()' and
improve the 'if' structure. Switch to pointers instead of integers
to control the loop.

Slightly more rare occurrences of 'text \ ' with a backslash
in between spaces are handled correctly. Namely, the code in
7e2e4b37 (dir: ignore trailing spaces in exclude patterns, 2014-02-09)
does not reset 'last_space' when a backslash is encountered and the above
line stays intact as a result.

Add a test at the end of t/t0008-ignores.sh to exhibit this behavior.

Signed-off-by: Pasha Bolokhov <pasha.bolokhov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: use free()+xcalloc() instead of xrealloc... René Scharfe Sun, 1 Jun 2014 11:07:21 +0000 (13:07 +0200)

pack-objects: use free()+xcalloc() instead of xrealloc()+memset()

Whenever the hash table becomes too small then its size is increased,
the original part (and the added space) is zerod out using memset(),
and the table is rebuilt from scratch.

Simplify this proceess by returning the old memory using free() and
allocating the new buffer using xcalloc(), which already clears the
buffer for us. That way we avoid copying the old hash table contents
needlessly inside xrealloc().

While at it, use the first array member with sizeof instead of a
specific type. The old code used uint32_t and int, while index is
actually an array of int32_t. Their sizes are the same basically
everywhere, so it's not actually a problem, but the new code is
cleaner and doesn't have to be touched should the type be changed.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mailinfo: use strcmp() for string comparisonRené Scharfe Sun, 1 Jun 2014 09:00:40 +0000 (11:00 +0200)

mailinfo: use strcmp() for string comparison

The array header is defined as:

static const char *header[MAX_HDR_PARSED] = {
"From","Subject","Date",
};

When looking for the index of a specfic string in that array, simply
use strcmp() instead of memcmp(). This avoids running over the end of
the string (e.g. with memcmp("Subject", "From", 7)) and gets rid of
magic string length constants.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch doc: remove notes on outdated "mixed layout"Junio C Hamano Thu, 29 May 2014 19:55:50 +0000 (12:55 -0700)

fetch doc: remove notes on outdated "mixed layout"

In old days before Git 1.5, it was customery for "git fetch" to use
the same local branch namespace to keep track of the remote-tracking
branches, and it was necessary to tell users not to check them out
and commit on them. Since everybody uses the separate remote layout
these days, there is no need to warn against the practice to check
out the right-hand side of <refspec> and build on it---the RHS is
typically not even a local branch.

Incidentally, this also kills one mention of "Pull:" line of
$GIT_DIR/remotes/* configuration, which is a lot less familiar to
new people than the more modern remote.*.fetch configuration
variable.

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

fetch doc: update note on '+' in front of the refspecJunio C Hamano Thu, 29 May 2014 19:53:28 +0000 (12:53 -0700)

fetch doc: update note on '+' in front of the refspec

While it is not *wrong* per-se to say that pulling a rewound/rebased
branch will lead to an unnecessary merge conflict, that is not what
the leading "+" sign to allow non-fast-forward update of remote-tracking
branch is at all.

Helped-by: Marc Branchaud <marcnarc@xiplink.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch doc: move FETCH_HEAD material lower and add an... Marc Branchaud Mon, 2 Jun 2014 15:21:47 +0000 (11:21 -0400)

fetch doc: move FETCH_HEAD material lower and add an example

Signed-off-by: Marc Branchaud <marcnarc@xiplink.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fix brown paper bag breakage in t5150-request-pull.shJohannes Sixt Mon, 2 Jun 2014 07:06:56 +0000 (09:06 +0200)

fix brown paper bag breakage in t5150-request-pull.sh

The recent addition to the test case 'pull request format' interrupted
the single-quoted text, effectively adding a third argument to the
test_expect_success command. Since we do not have a prerequisite named
"pull request format", the test is skipped, no matter what. Additionally,
the file name argument to the grep command is missing. Fix both issues.

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

sideband.c: do not use ANSI control sequence on non... Michael Naumov Wed, 28 May 2014 03:12:15 +0000 (03:12 +0000)

sideband.c: do not use ANSI control sequence on non-terminal

Diagnostic messages received on the sideband #2 from the server side
are sent to the standard error with ANSI terminal control sequence
"\033[K" that erases to the end of line appended at the end of each
line.

However, some programs (e.g. GitExtensions for Windows) read and
interpret and/or show the message without understanding the terminal
control sequences, resulting them to be shown to their end users.
To help these programs, squelch the control sequence when the
standard error stream is not being sent to a tty.

NOTE: I considered to cover the case that a pager has already been
started. But decided that is probably not worth worrying about here,
though, as we shouldn't be using a pager for commands that do network
communications (and if we do, omitting the magic line-clearing signal
is probably a sane thing to do).

Thanks-to: Erik Faye-Lund <kusmabite@gmail.com>
Thanks-to: Jeff King <peff@peff.net>
Signed-off-by: Michael Naumov <mnaoumov@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git log: support "auto" decorationsLinus Torvalds Thu, 29 May 2014 22:19:40 +0000 (15:19 -0700)

git log: support "auto" decorations

This works kind of like "--color=auto" - add decorations for interactive
use, but do not change defaults when scripting or when piping the output
to anything but a terminal.

You can use either

[log]
decorate=auto

in the git config files, or the "--decorate=auto" command line option to
choose this behavior.

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

compat/bswap.h: fix endianness detectionBen Walton Fri, 30 May 2014 15:22:40 +0000 (16:22 +0100)

compat/bswap.h: fix endianness detection

The changes to make detection of endianness more portable had a bug
that breaks on (at least) Solaris x86.

The bug appears to be a simple copy/paste typo. It checks for
_BIG_ENDIAN and not _LITTLE_ENDIAN for both the case where we would
decide the system is big endian and little endian. Instead, the
second test should be for _LITTLE_ENDIAN and not _BIG_ENDIAN.

Two fixes were possible:

1. Change the negation order of the conditions in the second test.
2. Reverse the order of the conditions in the second test.

Use the second option so that the condition we expect is always a
positive check.

Signed-off-by: Ben Walton <bdwalton@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t5538: move http push tests out to t5542Nick Alcock Fri, 30 May 2014 17:36:21 +0000 (13:36 -0400)

t5538: move http push tests out to t5542

As 0232852b, but for the push tests instead: this avoids a start_httpd
in the middle of the file, which fails under GIT_TEST_HTTPD=false.

Note that we have to munge the test in a few ways while
moving it:

1. We drop the `test -z "$GIT_TEST_HTTPD"` check; this is
too simplistic since 83d842d, and we should let
lib-httpd.sh handle it.

2. We have to port over some of the old setup from t5538.

3. In the final test, we no longer expect the extra commit
"1" built on top of "4". This was a side effect from an
earlier test in t5538 which was not ported over.

Signed-off-by: Nick Alcock <nick.alcock@oracle.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fetch doc: update introductory part for clarityJunio C Hamano Thu, 29 May 2014 19:36:47 +0000 (12:36 -0700)

fetch doc: update introductory part for clarity

- "Branches" is a more common way to say "heads" in these days.

- Remote-tracking branches are used a lot more these days and it is
worth mentioning that it is one of the primary side effects of
the command to update them.

- Avoid "X. That means Y." If Y is easier to understand to
readers, just say that upfront.

- Use of explicit refspec to fetch tags does not have much to do
with turning "auto following" on or off. It is a way to fetch
tags that otherwise would not be fetched by auto-following.

Helped-by: Marc Branchaud <marcnarc@xiplink.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with 1.9.4Junio C Hamano Fri, 30 May 2014 17:57:52 +0000 (10:57 -0700)

Sync with 1.9.4

Git 1.9.4 v1.9.4Junio C Hamano Wed, 28 May 2014 22:50:22 +0000 (15:50 -0700)

Git 1.9.4

This is expected to be the final maintenance release for 1.9 series,
merging the remaining fixes that are relevant and are already in 2.0.

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

t5537: re-drop http testsJeff King Fri, 30 May 2014 01:34:19 +0000 (21:34 -0400)

t5537: re-drop http tests

These were originally removed by 0232852 (t5537: move
http tests out to t5539, 2014-02-13). However, they were
accidentally re-added in 1ddb4d7 (Merge branch
'nd/upload-pack-shallow', 2014-03-21).

This looks like an error in manual conflict resolution.
Here's what happened:

1. v1.9.0 shipped with the http tests in t5537.

2. We realized that this caused problems, and built
0232852 on top to move the tests to their own file.
This fix made it into v1.9.1.

3. We later had another fix in nd/upload-pack-shallow that
also touched t5537. It was built directly on v1.9.0.

When we merged nd/upload-pack-shallow to master, we got a
conflict; it was built on a version with the http tests, but
we had since removed them. The correct resolution was to
drop the http tests and keep the new ones, but instead we
kept everything.

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

Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname... Junio C Hamano Wed, 28 May 2014 22:46:36 +0000 (15:46 -0700)

Merge branch 'rh/prompt-pcmode-avoid-eval-on-refname' into maint

* rh/prompt-pcmode-avoid-eval-on-refname:
git-prompt.sh: don't assume the shell expands the value of PS1

Merge branch 'mw/symlinks' into maintJunio C Hamano Wed, 28 May 2014 22:45:57 +0000 (15:45 -0700)

Merge branch 'mw/symlinks' into maint

* mw/symlinks:
setup: fix windows path buffer over-stepping
setup: don't dereference in-tree symlinks for absolute paths
setup: add abspath_part_inside_repo() function
t0060: add tests for prefix_path when path begins with work tree
t0060: add test for prefix_path when path == work tree
t0060: add test for prefix_path on symlinks via absolute paths
t3004: add test for ls-files on symlinks via absolute paths

How to keep a project's canonical history correct.Stephen P. Smith Fri, 9 May 2014 06:08:41 +0000 (23:08 -0700)

How to keep a project's canonical history correct.

During the mail thread about "Pull is mostly evil" a user asked how
the first parent could become reversed.

This howto explains how the first parent can get reversed when viewed
by the project and then explains a method to keep the history correct.

Signed-off-by: Stephen P. Smith <ischis2@cox.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git 2.0 v2.0.0Junio C Hamano Wed, 28 May 2014 18:04:19 +0000 (11:04 -0700)

Git 2.0

Documentation: wording fixes in the user manual and... Jeremiah Mahler Wed, 28 May 2014 02:23:32 +0000 (19:23 -0700)

Documentation: wording fixes in the user manual and glossary

Re-word the section on "Updating a repository with git fetch" in the
user manual.

Various other minor fixes in the manual and glossary.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport-helper.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:56 +0000 (00:33 +0900)

transport-helper.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
transport_helper_init passes the arguments in reverse order, passing the
size of a helper_data*, followed by the number to allocate.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:55 +0000 (00:33 +0900)

remote.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
parse_refspec_internal passes the arguments in reverse order, passing the
size of a refspec, followed by the number to allocate.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

reflog-walk.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:54 +0000 (00:33 +0900)

reflog-walk.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
reflog-walk.c includes several calls to xcalloc() that pass the arguments
in reverse order.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-revindex.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:53 +0000 (00:33 +0900)

pack-revindex.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
init_pack_revindex() passes the arguments in reverse order, passing the
size of a pack_revindex, followed by the number to allocate.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

notes.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:52 +0000 (00:33 +0900)

notes.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
notes.c includes several calls to xcalloc() that pass the arguments in
reverse order.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:51 +0000 (00:33 +0900)

imap-send.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
imap_open_store() passes the arguments in reverse order, passing the
size of an imap_store*, followed by the number to allocate.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http-push.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:50 +0000 (00:33 +0900)

http-push.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
http-push passes the arguments in reverse order, passing the size
of a repo, followed by the number to allocate.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:47 +0000 (00:33 +0900)

diff.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
diffstat_add() passes the arguments in reverse order, passing the
size of a diffstat_file*, followed by the number of diffstat_file* to
be allocated.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:46 +0000 (00:33 +0900)

config.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
config.c includes several calls to xcalloc() that pass the arguments
in reverse order: the size of a struct lock_file*, followed by the
number to allocate.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:45 +0000 (00:33 +0900)

commit.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
reduce_heads() passes the arguments in reverse order, passing the
size of a commit*, followed by the number of commit* to be allocated.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/remote.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:44 +0000 (00:33 +0900)

builtin/remote.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
builtin/remote.c includes several calls to xcalloc() that pass the
arguments in reverse order.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/ls-remote.c: rearrange xcalloc argumentsBrian Gesiak Mon, 26 May 2014 15:33:43 +0000 (00:33 +0900)

builtin/ls-remote.c: rearrange xcalloc arguments

xcalloc() takes two arguments: the number of elements and their size.
cmd_ls_remote() passes the arguments in reverse order, passing the
size of a char*, followed by the number of char* to be allocated.

Rearrange them so they are in the correct order.

Signed-off-by: Brian Gesiak <modocache@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: respect '~' and '~user' in mailmap.fileØystein Walle Tue, 27 May 2014 08:45:58 +0000 (10:45 +0200)

config: respect '~' and '~user' in mailmap.file

git_config_string() does not handle '~' and '~user' as part of the
value. Using git_config_pathname() fixes this.

Signed-off-by: Øystein Walle <oystwa@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-instaweb: add support for Apache 2.4Jonathan McCrohan Tue, 27 May 2014 01:18:10 +0000 (02:18 +0100)

git-instaweb: add support for Apache 2.4

Detect available Apache MPMs and use first available according to
following order of precedence:
mpm_event
mpm_prefork
mpm_worker

Add authz_core module if available to avoid HTTP Error 500 errors.

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

t9138-git-svn-authors-prog.sh fixupsJeremiah Mahler Sun, 25 May 2014 19:24:54 +0000 (12:24 -0700)

t9138-git-svn-authors-prog.sh fixups

Several fixups of the t9138-git-svn-authors-prog.sh test script to
follow current recommendations in t/README.

- Fixed a Perl script with a full "#!/usr/bin/perl" shebang
to use write_script() and $PERL_PATH as per t/README.

- Placed svn-authors data setup inside a test_expect_success.

- Fixed trailing quotes to use the same indentation throughout.

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

format-patch: add "--signature-file=<file>" optionJeremiah Mahler Sat, 24 May 2014 04:08:14 +0000 (21:08 -0700)

format-patch: add "--signature-file=<file>" option

Add an option to format-patch for reading a signature from a file.

$ git format-patch -1 --signature-file=$HOME/.signature

The config variable `format.signaturefile` can also be used to make
this the default.

$ git config format.signaturefile $HOME/.signature

$ git format-patch -1

Signed-off-by: Jeremiah Mahler <jmmahler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: Do not include diff in spec file when just... Maxime Coste Sat, 24 May 2014 17:40:35 +0000 (18:40 +0100)

git-p4: Do not include diff in spec file when just preparing p4

The diff information render the spec file unusable as is by p4,
do not include it when run with --prepare-p4-only so that the
given file can be directly passed to p4.

With --prepare-p4-only, git-p4 already tells the user it can use
p4 submit with the generated spec file. This fails because of the
diff being present in the file. Not including the diff fixes that.

Without --prepare-p4-only, keeping the diff makes sense for a
quick review of the patch before submitting it. And does not cause
problems with p4 as we remove it programmatically.

Signed-off-by: Maxime Coste <frrrwww@gmail.com>
Acked-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

gc --auto: do not lock refs in the backgroundNguyễn Thái Ngọc Duy Sun, 25 May 2014 00:38:29 +0000 (07:38 +0700)

gc --auto: do not lock refs in the background

9f673f9 (gc: config option for running --auto in background -
2014-02-08) puts "gc --auto" in background to reduce user's wait
time. Part of the garbage collecting is pack-refs and pruning
reflogs. These require locking some refs and may abort other processes
trying to lock the same ref. If gc --auto is fired in the middle of a
script, gc's holding locks in the background could fail the script,
which could never happen before 9f673f9.

Keep running pack-refs and "reflog --prune" in foreground to stop
parallel ref updates. The remaining background operations (repack,
prune and rerere) should not impact running git processes.

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

remote prune: optimize "dangling symref" check/warningJens Lindström Fri, 23 May 2014 10:30:25 +0000 (12:30 +0200)

remote prune: optimize "dangling symref" check/warning

When 'git remote prune' was used to delete many refs in a repository
with many refs, a lot of time was spent checking for (now) dangling
symbolic refs pointing to the deleted ref, since warn_dangling_symref()
was once per deleted ref to check all other refs in the repository.

Avoid this using the new warn_dangling_symrefs() function which
makes one pass over all refs and checks for all the deleted refs in
one go, after they have all been deleted.

Signed-off-by: Jens Lindström <jl@opera.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote: repack packed-refs once when deleting multiple... Jens Lindström Fri, 23 May 2014 10:29:45 +0000 (12:29 +0200)

remote: repack packed-refs once when deleting multiple refs

When 'git remote rm' or 'git remote prune' were used in a repository
with many refs, and needed to delete many remote-tracking refs, a lot
of time was spent deleting those refs since for each deleted ref,
repack_without_refs() was called to rewrite packed-refs without just
that deleted ref.

To avoid this, call repack_without_refs() first to repack without all
the refs that will be deleted, before calling delete_ref() to delete
each one completely. The call to repack_without_ref() in delete_ref()
then becomes a no-op, since packed-refs already won't contain any of
the deleted refs.

Signed-off-by: Jens Lindström <jl@opera.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add missing options for git-mergeJohn Keeping Thu, 22 May 2014 13:58:38 +0000 (14:58 +0100)

completion: add missing options for git-merge

The options added to __git_merge_options are those that git-pull passes
to git-merge, since that variable is used by both commands.

Those added directly in _git_merge() are specific to git-merge and
are not passed thru from git-pull.

Reported-by: Haralan Dobrev <hkdobrev@gmail.com>
Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

completion: add a note that merge options are sharedJohn Keeping Thu, 22 May 2014 13:58:37 +0000 (14:58 +0100)

completion: add a note that merge options are shared

This should avoid future confusion after a subsequent patch has added
some options to __git_merge_options and some directly in _git_merge().

Signed-off-by: John Keeping <john@keeping.me.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

http: default text charset to iso-8859-1Jeff King Thu, 22 May 2014 09:36:12 +0000 (05:36 -0400)

http: default text charset to iso-8859-1

This is specified by RFC 2616 as the default if no "charset"
parameter is given.

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

remote-curl: reencode http error messagesJeff King Thu, 22 May 2014 09:30:29 +0000 (05:30 -0400)

remote-curl: reencode http error messages

We currently recognize an error message with a content-type
"text/plain; charset=utf-16" as text, but we ignore the
charset parameter entirely. Let's encode it to
log_output_encoding, which is presumably something the
user's terminal can handle.

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

strbuf: add strbuf_reencode helperJeff King Thu, 22 May 2014 09:30:14 +0000 (05:30 -0400)

strbuf: add strbuf_reencode helper

This is a convenience wrapper around `reencode_string_len`
and `strbuf_attach`.

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

http: optionally extract charset parameter from content... Jeff King Thu, 22 May 2014 09:30:05 +0000 (05:30 -0400)

http: optionally extract charset parameter from content-type

Since the previous commit, we now give a sanitized,
shortened version of the content-type header to any callers
who ask for it.

This patch adds back a way for them to cleanly access
specific parameters to the type. We could easily extract all
parameters and make them available via a string_list, but:

1. That complicates the interface and memory management.

2. In practice, no planned callers care about anything
except the charset.

This patch therefore goes with the simplest thing, and we
can expand or change the interface later if it becomes
necessary.

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

http: extract type/subtype portion of content-typeJeff King Thu, 22 May 2014 09:29:47 +0000 (05:29 -0400)

http: extract type/subtype portion of content-type

When we get a content-type from curl, we get the whole
header line, including any parameters, and without any
normalization (like downcasing or whitespace) applied.
If we later try to match it with strcmp() or even
strcasecmp(), we may get false negatives.

This could cause two visible behaviors:

1. We might fail to recognize a smart-http server by its
content-type.

2. We might fail to relay text/plain error messages to
users (especially if they contain a charset parameter).

This patch teaches the http code to extract and normalize
just the type/subtype portion of the string. This is
technically passing out less information to the callers, who
can no longer see the parameters. But none of the current
callers cares, and a future patch will add back an
easier-to-use method for accessing those parameters.

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

scripts: more "export VAR=VALUE" fixesJunio C Hamano Fri, 23 May 2014 18:19:34 +0000 (11:19 -0700)

scripts: more "export VAR=VALUE" fixes

Found by

git grep '[^-]export [^&]*=' -- \*.sh

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

scripts: "export VAR=VALUE" construct is not portableElia Pinto Fri, 23 May 2014 10:15:31 +0000 (03:15 -0700)

scripts: "export VAR=VALUE" construct is not portable

Found by check-non-portable-shell.pl

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