]> git.ipfire.org Git - thirdparty/git.git/log
thirdparty/git.git
10 years agoMerge branch 'jn/contrib-remove-diffall'
Junio C Hamano [Fri, 6 Jun 2014 18:23:46 +0000 (11:23 -0700)] 
Merge branch 'jn/contrib-remove-diffall'

Spring cleaning of contrib/.

* jn/contrib-remove-diffall:
  contrib: remove git-diffall

10 years agoMerge branch 'dt/merge-recursive-case-insensitive'
Junio C Hamano [Fri, 6 Jun 2014 18:23:13 +0000 (11:23 -0700)] 
Merge branch 'dt/merge-recursive-case-insensitive'

On a case insensitive filesystem, merge-recursive incorrectly
deleted the file that is to be renamed to a name that is the same
except for case differences.

* dt/merge-recursive-case-insensitive:
  mv: allow renaming to fix case on case insensitive filesystems
  merge-recursive.c: fix case-changing merge bug

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge branch 'jk/grep-tell-run-command-to-cd-when-running-pager'
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

10 years agoMerge branch 'fc/status-printf-squelch-format-zero-length-warnings'
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

10 years agoMerge branch 'jk/squelch-compiler-warning-from-funny-error-macro'
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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agorefs.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>
10 years agot/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>
10 years agoshortlog: allow --exclude=<glob> to be passed
Junio 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>
10 years agot5000, t5003: do not use test_cmp to compare binary files
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>
10 years agoupdate-index: fix segfault with missing --cacheinfo argument
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>
10 years agoFirst batch for 2.1
Junio 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>
10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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
  ...

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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()

10 years agoMerge 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()

10 years agoMerge 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
  ...

10 years agoMerge 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

10 years agoMerge 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

10 years agoMerge 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

10 years agorefs.c: change read_ref_at to use the reflog iterators
Ronnie 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>
10 years agoenvironment.c: enable core.preloadindex by default
Steve 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>
10 years agoerror_resolve_conflict: drop quotations around operation
Jeff 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>
10 years agoerror_resolve_conflict: rewrap advice message
Jeff 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>
10 years agodir.c:trim_trailing_spaces(): fix for " \ " sequence
Pasha 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>
10 years agopack-objects: use free()+xcalloc() instead of xrealloc()+memset()
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>
10 years agomailinfo: use strcmp() for string comparison
René 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>
10 years agofix brown paper bag breakage in t5150-request-pull.sh
Johannes 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>
10 years agosideband.c: do not use ANSI control sequence on non-terminal
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>
10 years agogit log: support "auto" decorations
Linus 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>
10 years agocompat/bswap.h: fix endianness detection
Ben 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>
10 years agot5538: move http push tests out to t5542
Nick 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>
10 years agoSync with 1.9.4
Junio C Hamano [Fri, 30 May 2014 17:57:52 +0000 (10:57 -0700)] 
Sync with 1.9.4

10 years agoGit 1.9.4 v1.9.4
Junio 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>
10 years agot5537: re-drop http tests
Jeff 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>
10 years agoMerge branch 'rh/prompt-pcmode-avoid-eval-on-refname' into maint
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

10 years agoMerge branch 'mw/symlinks' into maint
Junio 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

10 years agoHow 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>
10 years agoGit 2.0 v2.0.0
Junio C Hamano [Wed, 28 May 2014 18:04:19 +0000 (11:04 -0700)] 
Git 2.0

10 years agoDocumentation: wording fixes in the user manual and glossary
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>
10 years agotransport-helper.c: rearrange xcalloc arguments
Brian 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>
10 years agoremote.c: rearrange xcalloc arguments
Brian 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>
10 years agoreflog-walk.c: rearrange xcalloc arguments
Brian 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>
10 years agopack-revindex.c: rearrange xcalloc arguments
Brian 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>
10 years agonotes.c: rearrange xcalloc arguments
Brian 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>
10 years agoimap-send.c: rearrange xcalloc arguments
Brian 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>
10 years agohttp-push.c: rearrange xcalloc arguments
Brian 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>
10 years agodiff.c: rearrange xcalloc arguments
Brian 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>
10 years agoconfig.c: rearrange xcalloc arguments
Brian 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>
10 years agocommit.c: rearrange xcalloc arguments
Brian 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>
10 years agobuiltin/remote.c: rearrange xcalloc arguments
Brian 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>
10 years agobuiltin/ls-remote.c: rearrange xcalloc arguments
Brian 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>
10 years agoconfig: 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>
10 years agogit-instaweb: add support for Apache 2.4
Jonathan 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>
10 years agot9138-git-svn-authors-prog.sh fixups
Jeremiah 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>
10 years agoformat-patch: add "--signature-file=<file>" option
Jeremiah 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>
10 years agogit-p4: Do not include diff in spec file when just preparing p4
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>
10 years agogc --auto: do not lock refs in the background
Nguyễ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>
10 years agoremote prune: optimize "dangling symref" check/warning
Jens 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>
10 years agoremote: repack packed-refs once when deleting multiple refs
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>
10 years agocompletion: add missing options for git-merge
John 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>
10 years agocompletion: add a note that merge options are shared
John 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>
10 years agohttp: default text charset to iso-8859-1
Jeff 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>
10 years agoremote-curl: reencode http error messages
Jeff 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>
10 years agostrbuf: add strbuf_reencode helper
Jeff 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>
10 years agohttp: optionally extract charset parameter from content-type
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>
10 years agohttp: extract type/subtype portion of content-type
Jeff 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>
10 years agoscripts: more "export VAR=VALUE" fixes
Junio 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>
10 years agoscripts: "export VAR=VALUE" construct is not portable
Elia 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>
10 years agostrbuf: add strbuf_tolower function
Jeff King [Fri, 23 May 2014 20:03:47 +0000 (16:03 -0400)] 
strbuf: add strbuf_tolower function

This is a convenience wrapper to call tolower on each
character of the string.

This makes config's lowercase() function obsolete, though
note that because we have a strbuf, we are careful to
operate over the whole strbuf, rather than assuming that a
NUL is the end-of-string.

We could continue to offer a pure-string lowercase, but
there would be no callers (in most pure-string cases, we
actually duplicate and lowercase the duplicate, for which we
have the xstrdup_tolower wrapper).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot5550: test display of remote http error messages
Jeff King [Thu, 22 May 2014 09:29:03 +0000 (05:29 -0400)] 
t5550: test display of remote http error messages

Since commit 426e70d (remote-curl: show server content on
http errors, 2013-04-05), we relay any text/plain error
messages from the remote server to the user. However, we
never tested it.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agot/lib-httpd: use write_script to copy CGI scripts
Jeff King [Thu, 22 May 2014 09:28:56 +0000 (05:28 -0400)] 
t/lib-httpd: use write_script to copy CGI scripts

Using write_script will set our shebang line appropriately
with $SHELL_PATH. The script that is there now is quite
simple and likely to succeed even with a non-POSIX /bin/sh,
but it does not hurt to be defensive.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agotest-lib: preserve GIT_CURL_VERBOSE from the environment
Jeff King [Thu, 22 May 2014 09:28:50 +0000 (05:28 -0400)] 
test-lib: preserve GIT_CURL_VERBOSE from the environment

Turning on this variable can be useful when debugging http
tests. It does break a few tests in t5541, but it is not
a variable that the user is likely to have enabled
accidentally.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agodaemon/config: factor out duplicate xstrdup_tolower
Jeff King [Thu, 22 May 2014 09:44:09 +0000 (05:44 -0400)] 
daemon/config: factor out duplicate xstrdup_tolower

We have two implementations of the same function; let's drop
that to one. We take the name from daemon.c, but the
implementation (which is just slightly more efficient) from
the config code.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agotest-lint: find unportable sed, echo, test, and export usage after &&
Jonathan Nieder [Fri, 23 May 2014 18:44:05 +0000 (11:44 -0700)] 
test-lint: find unportable sed, echo, test, and export usage after &&

Instead of anchoring these checks with "^\s*", just check that the
usage is preceded by a word boundary.  So now we can catch

test $cond && export foo=bar

just like we already catch

test $cond &&
export foo=bar

As a side effect, this will detect usage of "sed -i", "echo -n", "test
a == b", and "export a=b" in comments.  That is not ideal but it's
potentially useful because people sometimes copy code from comments so
it can be good to also avoid nonportable patterns there.

To avoid false positives, keep the checks for 'declare' and 'which'
anchored.  Those are frequently used words in normal English-language
comments.

Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
10 years agoremote rm: delete remote configuration as the last
Jens Lindström [Fri, 23 May 2014 10:28:43 +0000 (12:28 +0200)] 
remote rm: delete remote configuration as the last

When removing a remote, delete the remote-tracking branches before
deleting the remote configuration.  This way, if the operation fails or
is aborted while deleting the remote-tracking branches, the command can
be rerun to complete the operation.

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