git
11 years agoMerge branch 'fc/completion'
Junio C Hamano [Thu, 18 Apr 2013 18:46:41 +0000 (11:46 -0700)] 
Merge branch 'fc/completion'

In addition to a user visible change to offer more options to cherry-pick,
generally cleans up and simplifies the code.

* fc/completion:
  completion: small optimization
  completion: inline __gitcomp_1 to its sole callsite
  completion: get rid of compgen
  completion: add __gitcomp_nl tests
  completion: add new __gitcompadd helper
  completion: get rid of empty COMPREPLY assignments
  completion: trivial test improvement
  completion: add more cherry-pick options

11 years agoMerge branch 'kb/co-orphan-suggestion-short-sha1'
Junio C Hamano [Thu, 18 Apr 2013 18:46:33 +0000 (11:46 -0700)] 
Merge branch 'kb/co-orphan-suggestion-short-sha1'

Update the informational message when "git checkout" leaves the
detached head state.

* kb/co-orphan-suggestion-short-sha1:
  checkout: abbreviate hash in suggest_reattach

11 years agoMerge branch 'jc/detached-head-doc'
Junio C Hamano [Thu, 18 Apr 2013 18:46:29 +0000 (11:46 -0700)] 
Merge branch 'jc/detached-head-doc'

* jc/detached-head-doc:
  glossary: extend "detached HEAD" description

11 years agoMerge branch 'tr/packed-object-info-wo-recursion'
Junio C Hamano [Thu, 18 Apr 2013 18:46:23 +0000 (11:46 -0700)] 
Merge branch 'tr/packed-object-info-wo-recursion'

Attempts to reduce the stack footprint of sha1_object_info()
and unpack_entry() codepaths.

* tr/packed-object-info-wo-recursion:
  sha1_file: remove recursion in unpack_entry
  Refactor parts of in_delta_base_cache/cache_or_unpack_entry
  sha1_file: remove recursion in packed_object_info

11 years agoMerge branch 'jk/http-error-messages'
Junio C Hamano [Thu, 18 Apr 2013 18:42:08 +0000 (11:42 -0700)] 
Merge branch 'jk/http-error-messages'

A regression fix for the recently graduated topic.

* jk/http-error-messages:
  http: set curl FAILONERROR each time we select a handle

11 years agoMerge branch 'maint'
Junio C Hamano [Tue, 16 Apr 2013 22:14:44 +0000 (15:14 -0700)] 
Merge branch 'maint'

* maint:
  help.c: add a compatibility comment to cmd_version()

11 years agohelp.c: add a compatibility comment to cmd_version()
David Aguilar [Tue, 16 Apr 2013 20:33:25 +0000 (13:33 -0700)] 
help.c: add a compatibility comment to cmd_version()

External projects have been known to parse the output of
"git version".  Help prevent future authors from changing
its format by adding a comment to its implementation.

Signed-off-by: David Aguilar <davvid@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoconvert: The native line-ending is \r\n on MinGW
Jonathan Nieder [Sat, 4 Sep 2010 08:25:09 +0000 (03:25 -0500)] 
convert: The native line-ending is \r\n on MinGW

If you try this:

 1. Install Git for Windows (from the msysgit project)

 2. Put

[core]
autocrlf = false
eol = native

    in your .gitconfig.

 3. Clone a project with

*.txt text

    in its .gitattributes.

Then with current git, any text files checked out have LF line
endings, instead of the expected CRLF.

Cc: Johannes Schindelin <johannes.schindelin@gmx.de>
Cc: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agohttp: set curl FAILONERROR each time we select a handle
Jeff King [Tue, 16 Apr 2013 00:30:38 +0000 (20:30 -0400)] 
http: set curl FAILONERROR each time we select a handle

Because we reuse curl handles for multiple requests, the
setup of a handle happens in two stages: stable, global
setup and per-request setup. The lifecycle of a handle is
something like:

  1. get_curl_handle; do basic global setup that will last
     through the whole program (e.g., setting the user
     agent, ssl options, etc)

  2. get_active_slot; set up a per-request baseline (e.g.,
     clearing the read/write functions, making it a GET
     request, etc)

  3. perform the request with curl_*_perform functions

  4. goto step 2 to perform another request

Breaking it down this way means we can avoid doing global
setup from step (1) repeatedly, but we still finish step (2)
with a predictable baseline setup that callers can rely on.

Until commit 6d052d7 (http: add HTTP_KEEP_ERROR option,
2013-04-05), setting curl's FAILONERROR option was a global
setup; we never changed it. However, 6d052d7 introduced an
option where some requests might turn off FAILONERROR. Later
requests using the same handle would have the option
unexpectedly turned off, which meant they would not notice
http failures at all.

This could easily be seen in the test-suite for the
"half-auth" cases of t5541 and t5551. The initial requests
turned off FAILONERROR, which meant it was erroneously off
for the rpc POST. That worked fine for a successful request,
but meant that we failed to react properly to the HTTP 401
(instead, we treated whatever the server handed us as a
successful message body).

The solution is simple: now that FAILONERROR is a
per-request setting, we move it to get_active_slot to make
sure it is reset for each request.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-bzr: fix prefix of tags
Felipe Contreras [Mon, 15 Apr 2013 21:47:28 +0000 (16:47 -0500)] 
remote-bzr: fix prefix of tags

In the current transport-helper code, refs without namespaced refspecs don't
work correctly, so let's always use them.

Some people reported issues with 'git clone --mirror', and this fixes them, as
well as possibly others.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes to 1.8.3
Junio C Hamano [Mon, 15 Apr 2013 19:45:15 +0000 (12:45 -0700)] 
Update draft release notes to 1.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'jk/diff-graph-submodule-summary'
Junio C Hamano [Mon, 15 Apr 2013 19:41:01 +0000 (12:41 -0700)] 
Merge branch 'jk/diff-graph-submodule-summary'

Make "git diff --graph" work better with submodule log output.

* jk/diff-graph-submodule-summary:
  submodule: print graph output next to submodule log

11 years agoMerge branch 'jk/diff-algo-finishing-touches'
Junio C Hamano [Mon, 15 Apr 2013 19:40:58 +0000 (12:40 -0700)] 
Merge branch 'jk/diff-algo-finishing-touches'

"git diff --diff-algorithm algo" is also understood as "git diff
--diff-algorithm=algo".

* jk/diff-algo-finishing-touches:
  diff: allow unstuck arguments with --diff-algorithm
  git-merge(1): document diff-algorithm option to merge-recursive

11 years agoMerge branch 'rt/commentchar-fmt-merge-msg'
Junio C Hamano [Mon, 15 Apr 2013 19:40:56 +0000 (12:40 -0700)] 
Merge branch 'rt/commentchar-fmt-merge-msg'

The new core.commentchar configuration was not applied to a few
places.

* rt/commentchar-fmt-merge-msg:
  fmt-merge-msg: use core.commentchar in tag signatures completely
  fmt-merge-msg: respect core.commentchar in people credits

11 years agoMerge branch 'lf/bundle-with-tip-wo-message'
Junio C Hamano [Mon, 15 Apr 2013 19:40:51 +0000 (12:40 -0700)] 
Merge branch 'lf/bundle-with-tip-wo-message'

"git bundle" did not like a bundle created using a commit without
any message as its one of the prerequistes.

* lf/bundle-with-tip-wo-message:
  bundle: Accept prerequisites without commit messages

11 years agoMerge branch 'jk/show-branch-strbuf'
Junio C Hamano [Mon, 15 Apr 2013 19:40:49 +0000 (12:40 -0700)] 
Merge branch 'jk/show-branch-strbuf'

"git show-branch" was not prepared to show a very long run of
ancestor operators e.g. foobar^2~2^2^2^2...^2~4 correctly.

* jk/show-branch-strbuf:
  show-branch: use strbuf instead of static buffer

11 years agoMerge branch 'jk/http-error-messages'
Junio C Hamano [Mon, 15 Apr 2013 19:40:46 +0000 (12:40 -0700)] 
Merge branch 'jk/http-error-messages'

Improve error reporting from the http transfer clients.

* jk/http-error-messages:
  http: drop http_error function
  remote-curl: die directly with http error messages
  http: re-word http error message
  http: simplify http_error helper function
  remote-curl: consistently report repo url for http errors
  remote-curl: always show friendlier 404 message
  remote-curl: let servers override http 404 advice
  remote-curl: show server content on http errors
  http: add HTTP_KEEP_ERROR option

11 years agoMerge branch 'tr/perl-keep-stderr-open'
Junio C Hamano [Mon, 15 Apr 2013 19:40:41 +0000 (12:40 -0700)] 
Merge branch 'tr/perl-keep-stderr-open'

Closing (not redirecting to /dev/null) the standard error stream is
not a very smart thing to do.  Later open may return file
descriptor #2 for unrelated purpose, and error reporting code may
write into them.

* tr/perl-keep-stderr-open:
  t9700: do not close STDERR
  perl: redirect stderr to /dev/null instead of closing

11 years agoMerge branch 'po/help-guides'
Junio C Hamano [Mon, 15 Apr 2013 06:33:17 +0000 (23:33 -0700)] 
Merge branch 'po/help-guides'

Finishing touches.

* po/help-guides:
  help: mark common_guides[] as translatable

11 years agocompletion: small optimization
Felipe Contreras [Wed, 10 Apr 2013 06:57:57 +0000 (01:57 -0500)] 
completion: small optimization

No need to calculate a new $c with a space if we are not going to do
anything it with it.

There should be no functional changes, except that a word "foo " with no
suffixes can't be matched. But $cur cannot have a space at the end
anyway. So it's safe.

Based on the code from SZEDER Gábor.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocompletion: inline __gitcomp_1 to its sole callsite
Felipe Contreras [Wed, 10 Apr 2013 06:57:56 +0000 (01:57 -0500)] 
completion: inline __gitcomp_1 to its sole callsite

There is no point in calling a separate function that is only used
in one place. Especially considering that there's no need to call
compgen, and we traverse the words ourselves both in __gitcompadd,
and __gitcomp_1.

Let's squash the functions together, and traverse only once.

This improves performance. For N number of words:

  == 1 ==
  original: 0.002s
  new: 0.000s
  == 10 ==
  original: 0.005s
  new: 0.001s
  == 100 ==
  original: 0.009s
  new: 0.006s
  == 1000 ==
  original: 0.027s
  new: 0.019s
  == 10000 ==
  original: 0.163s
  new: 0.151s
  == 100000 ==
  original: 1.555s
  new: 1.497s

No functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocompletion: get rid of compgen
Felipe Contreras [Wed, 10 Apr 2013 06:57:55 +0000 (01:57 -0500)] 
completion: get rid of compgen

The functionality we use from compgen is not much, we can do the same
manually, with drastic improvements in speed, especially when dealing
with only a few words.

This patch also has the sideffect that brekage reported by Jeroen Meijer
and SZEDER Gábor gets fixed because we no longer expand the resulting
words.

Here are some numbers filtering N amount of words:

  == 1 ==
  original: 0.002s
  new: 0.000s
  == 10 ==
  original: 0.002s
  new: 0.000s
  == 100 ==
  original: 0.003s
  new: 0.002s
  == 1000 ==
  original: 0.012s
  new: 0.011s
  == 10000 ==
  original: 0.056s
  new: 0.066s
  == 100000 ==
  original: 2.669s
  new: 0.622s

If the results are not narrowed:

  == 1 ==
  original: 0.002s
  new: 0.000s
  == 10 ==
  original: 0.002s
  new: 0.001s
  == 100 ==
  original: 0.004s
  new: 0.004s
  == 1000 ==
  original: 0.020s
  new: 0.015s
  == 10000 ==
  original: 0.101s
  new: 0.355s
  == 100000 ==
  original: 2.850s
  new: 31.941s

So, unless 'git checkout <tab>' usually gives you more than 10000
results, you'll get an improvement :)

Other possible solutions perform better after 1000 words, but worst if
less than that:

  COMPREPLY=($(awk -v cur="$3" -v pre="$2" -v suf="$4"
'$0 ~ cur { print pre$0suf }' <<< "$1" ))

  COMPREPLY=($(printf -- "$2%s$4\n" $1 | grep "^$2$3"))

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocompletion: add __gitcomp_nl tests
Felipe Contreras [Wed, 10 Apr 2013 06:57:54 +0000 (01:57 -0500)] 
completion: add __gitcomp_nl tests

Original patch by SZEDER Gábor.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocompletion: add new __gitcompadd helper
Felipe Contreras [Wed, 10 Apr 2013 06:57:53 +0000 (01:57 -0500)] 
completion: add new __gitcompadd helper

The idea is to never touch the COMPREPLY variable directly.

This allows other completion systems (i.e. zsh) to override
__gitcompadd, and do something different instead.

Also, this allows further optimizations down the line.

There should be no functional changes.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agotest-bzr: portable shell and utf-8 strings for Mac OS
Torsten Bögershausen [Fri, 12 Apr 2013 21:18:20 +0000 (23:18 +0200)] 
test-bzr: portable shell and utf-8 strings for Mac OS

Make the shell script more portable:
- Split export X=Y into 2 lines
- Use printf instead of echo -e

Use UTF-8 code points which are not decomposed by the filesystem:
 Code points like "á" will be decomposed by Mac OS X.
 bzr is unable to find the file "á" on disk.
 Use code points from unicode which can not be decomposed.
 In other words, the precompsed form use the same bytes as decomposed.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Acked-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoSync with 'maint'
Junio C Hamano [Fri, 12 Apr 2013 20:54:01 +0000 (13:54 -0700)] 
Sync with 'maint'

* maint:
  Correct common spelling mistakes in comments and tests
  kwset: fix spelling in comments
  precompose-utf8: fix spelling of "want" in error message
  compat/nedmalloc: fix spelling in comments
  compat/regex: fix spelling and grammar in comments
  obstack: fix spelling of similar
  contrib/subtree: fix spelling of accidentally
  git-remote-mediawiki: spelling fixes
  doc: various spelling fixes
  fast-export: fix argument name in error messages
  Documentation: distinguish between ref and offset deltas in pack-format
  i18n: make the translation of -u advice in one go

11 years agoMerge branch 'rr/test-3200-style' into maint
Junio C Hamano [Fri, 12 Apr 2013 20:41:48 +0000 (13:41 -0700)] 
Merge branch 'rr/test-3200-style' into maint

* rr/test-3200-style:
  t3200 (branch): modernize style

Conflicts:
t/t3200-branch.sh

11 years agoMerge branch 'mg/texinfo-5' into maint
Junio C Hamano [Fri, 12 Apr 2013 20:41:48 +0000 (13:41 -0700)] 
Merge branch 'mg/texinfo-5' into maint

* mg/texinfo-5:
  Documentation: Strip texinfo anchors to avoid duplicates

11 years agoMerge branch 'jk/diffcore-break-divzero' into maint
Junio C Hamano [Fri, 12 Apr 2013 20:41:47 +0000 (13:41 -0700)] 
Merge branch 'jk/diffcore-break-divzero' into maint

* jk/diffcore-break-divzero:
  diffcore-break: don't divide by zero

11 years agoMerge branch 'cn/commit-amend-doc' into maint
Junio C Hamano [Fri, 12 Apr 2013 20:41:47 +0000 (13:41 -0700)] 
Merge branch 'cn/commit-amend-doc' into maint

* cn/commit-amend-doc:
  Documentation/git-commit: reword the --amend explanation

11 years agoMerge branch 'jk/bisect-prn-unsigned' into maint
Junio C Hamano [Fri, 12 Apr 2013 20:41:46 +0000 (13:41 -0700)] 
Merge branch 'jk/bisect-prn-unsigned' into maint

* jk/bisect-prn-unsigned:
  bisect: avoid signed integer overflow

11 years agoMerge branch 'jk/no-more-self-assignment' into maint
Junio C Hamano [Fri, 12 Apr 2013 20:41:46 +0000 (13:41 -0700)] 
Merge branch 'jk/no-more-self-assignment' into maint

* jk/no-more-self-assignment:
  match-trees: simplify score_trees() using tree_entry()
  submodule: clarify logic in show_submodule_summary

11 years agoMerge branch 'rr/send-email-perl-critique' into maint
Junio C Hamano [Fri, 12 Apr 2013 20:41:46 +0000 (13:41 -0700)] 
Merge branch 'rr/send-email-perl-critique' into maint

* rr/send-email-perl-critique:
  send-email: use the three-arg form of open in recipients_cmd
  send-email: drop misleading function prototype
  send-email: use "return;" not "return undef;" on error codepaths

11 years agoMerge branch 'jc/t5516-pushInsteadOf-vs-pushURL' into maint
Junio C Hamano [Fri, 12 Apr 2013 20:41:45 +0000 (13:41 -0700)] 
Merge branch 'jc/t5516-pushInsteadOf-vs-pushURL' into maint

* jc/t5516-pushInsteadOf-vs-pushURL:
  t5516: test interaction between pushURL and pushInsteadOf correctly

11 years agoCorrect common spelling mistakes in comments and tests
Stefano Lattarini [Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)] 
Correct common spelling mistakes in comments and tests

Most of these were found using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agokwset: fix spelling in comments
Stefano Lattarini [Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)] 
kwset: fix spelling in comments

Correct spelling mistakes noticed using Lucas De Marchi's codespell
tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoprecompose-utf8: fix spelling of "want" in error message
Stefano Lattarini [Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)] 
precompose-utf8: fix spelling of "want" in error message

Noticed using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocompat/nedmalloc: fix spelling in comments
Stefano Lattarini [Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)] 
compat/nedmalloc: fix spelling in comments

Correct some typos found using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocompat/regex: fix spelling and grammar in comments
Stefano Lattarini [Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)] 
compat/regex: fix spelling and grammar in comments

Some of these were found using Lucas De Marchi's codespell tool.
Others noticed by Eric Sunshine.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoobstack: fix spelling of similar
Stefano Lattarini [Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)] 
obstack: fix spelling of similar

Noticed using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocontrib/subtree: fix spelling of accidentally
Stefano Lattarini [Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)] 
contrib/subtree: fix spelling of accidentally

Noticed with Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogit-remote-mediawiki: spelling fixes
Stefano Lattarini [Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)] 
git-remote-mediawiki: spelling fixes

Most of these were found using Lucas De Marchi's codespell tool.
Others were pointed out by Eric Sunshine.

Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Acked-by: Matthieu Moy <Matthieu.Moy@imag.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agodoc: various spelling fixes
Stefano Lattarini [Thu, 11 Apr 2013 22:36:10 +0000 (00:36 +0200)] 
doc: various spelling fixes

Most of these were found using Lucas De Marchi's codespell tool.

Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'maint-1.8.1' into maint
Junio C Hamano [Fri, 12 Apr 2013 18:48:38 +0000 (11:48 -0700)] 
Merge branch 'maint-1.8.1' into maint

* maint-1.8.1:
  fast-export: fix argument name in error messages
  Documentation: distinguish between ref and offset deltas in pack-format

11 years agocompletion: get rid of empty COMPREPLY assignments
Felipe Contreras [Wed, 10 Apr 2013 06:57:52 +0000 (01:57 -0500)] 
completion: get rid of empty COMPREPLY assignments

There's no functional reason for those, the only purpose they are
supposed to serve is to say "we don't provide any words here", but
even for that it's not used consistently.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocompletion: trivial test improvement
Felipe Contreras [Wed, 10 Apr 2013 06:57:51 +0000 (01:57 -0500)] 
completion: trivial test improvement

Instead of passing a dummy "", let's check if the last character is a
space, and then move the _cword accordingly.

Apparently we were passing "" all the way to compgen, which fortunately
expanded it to nothing.

Lets do the right thing though.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocompletion: add more cherry-pick options
Felipe Contreras [Wed, 10 Apr 2013 09:08:18 +0000 (04:08 -0500)] 
completion: add more cherry-pick options

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agohelp: mark common_guides[] as translatable
Simon Ruderich [Fri, 12 Apr 2013 13:51:42 +0000 (15:51 +0200)] 
help: mark common_guides[] as translatable

Signed-off-by: Simon Ruderich <simon@ruderich.org>
Acked-by: Philip Oakley <philipoakley@iee.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agofast-export: fix argument name in error messages
Paul Price [Fri, 12 Apr 2013 14:05:55 +0000 (10:05 -0400)] 
fast-export: fix argument name in error messages

The --signed-tags argument is plural, while error messages referred
to --signed-tag (singular).  Tweak error messages to correspond to the
argument.

Signed-off-by: Paul Price <price@astro.princeton.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoDocumentation: distinguish between ref and offset deltas in pack-format
Stefan Saasen [Fri, 12 Apr 2013 05:56:24 +0000 (15:56 +1000)] 
Documentation: distinguish between ref and offset deltas in pack-format

eb32d236 introduced the OBJ_OFS_DELTA object that uses a relative offset to
identify the base object instead of the 20-byte SHA1 reference. The pack file
documentation only mentions the SHA1 based reference in its description of the
deltified object entry.

Update the pack format documentation to clarify that the deltified object
representation refers to its base using either a relative negative offset or
the absolute SHA1 identifier.

Signed-off-by: Stefan Saasen <ssaasen@atlassian.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'tb/document-status-u-tradeoff' into maint
Junio C Hamano [Fri, 12 Apr 2013 15:12:47 +0000 (08:12 -0700)] 
Merge branch 'tb/document-status-u-tradeoff' into maint

* tb/document-status-u-tradeoff:
  i18n: make the translation of -u advice in one go

11 years agoi18n: make the translation of -u advice in one go
Jiang Xin [Fri, 12 Apr 2013 03:53:01 +0000 (11:53 +0800)] 
i18n: make the translation of -u advice in one go

The advice (consider use of -u when read_directory takes too long) is
separated into 3 different status_printf_ln() calls, and which brings
trouble for translators.

Since status_vprintf() called by status_printf_ln() can handle eol in
buffer, we could simply join these lines into one paragraph.

Signed-off-by: Jiang Xin <worldhello.net@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'maint'
Junio C Hamano [Fri, 12 Apr 2013 00:41:48 +0000 (17:41 -0700)] 
Merge branch 'maint'

* maint:
  Typo fix: replacing it's -> its
  t: make PIPE a standard test prerequisite
  archive: clarify explanation of --worktree-attributes
  t/README: --immediate skips cleanup commands for failed tests

11 years agoUpdate dtaft release notes to 1.8.3
Junio C Hamano [Thu, 11 Apr 2013 23:03:55 +0000 (16:03 -0700)] 
Update dtaft release notes to 1.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'ap/combine-diff-coalesce-lost'
Junio C Hamano [Fri, 12 Apr 2013 00:41:05 +0000 (17:41 -0700)] 
Merge branch 'ap/combine-diff-coalesce-lost'

Attempts to minimize "diff -c/--cc" output by coalescing the same
lines removed from the parents better, but with an O(n^2)
complexity.

* ap/combine-diff-coalesce-lost:
  combine-diff: coalesce lost lines optimally

11 years agoMerge branch 'sr/log-SG-no-textconv'
Junio C Hamano [Fri, 12 Apr 2013 00:41:04 +0000 (17:41 -0700)] 
Merge branch 'sr/log-SG-no-textconv'

"git log -S/-G" started paying attention to textconv filter, but
there was no way to disable this.  Make it honor --no-textconv
option.

* sr/log-SG-no-textconv:
  diffcore-pickaxe: unify code for log -S/-G
  diffcore-pickaxe: fix leaks in "log -S<block>" and "log -G<pattern>"
  diffcore-pickaxe: port optimization from has_changes() to diff_grep()
  diffcore-pickaxe: respect --no-textconv
  diffcore-pickaxe: remove fill_one()
  diffcore-pickaxe: remove unnecessary call to get_textconv()

11 years agoMerge branch 'js/rerere-forget-protect-against-NUL'
Junio C Hamano [Fri, 12 Apr 2013 00:41:02 +0000 (17:41 -0700)] 
Merge branch 'js/rerere-forget-protect-against-NUL'

A few bugfixes to "git rerere" working on corner case merge
conflicts.

* js/rerere-forget-protect-against-NUL:
  rerere forget: do not segfault if not all stages are present
  rerere forget: grok files containing NUL

11 years agoMerge branch 'po/help-guides'
Junio C Hamano [Fri, 12 Apr 2013 00:41:00 +0000 (17:41 -0700)] 
Merge branch 'po/help-guides'

"git help" learned "-g" option to show the list of guides just like
list of commands are given with "-a".

* po/help-guides:
  doc: include --guide option description for "git help"
  help: mention -a and -g option, and 'git help <concept>' usage.
  builtin/help.c: add list_common_guides_help() function
  builtin/help.c: add --guide option
  builtin/help.c: split "-a" processing into two

11 years agoTypo fix: replacing it's -> its
Benoit Bourbie [Sat, 13 Apr 2013 16:47:21 +0000 (10:47 -0600)] 
Typo fix: replacing it's -> its

Signed-off-by: Benoit Bourbie <benoit.bourbie@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot: make PIPE a standard test prerequisite
Adam Spiers [Thu, 11 Apr 2013 02:07:04 +0000 (03:07 +0100)] 
t: make PIPE a standard test prerequisite

The 'PIPE' test prerequisite was already defined identically by t9010
and t9300, therefore it makes sense to make it a predefined
prerequisite.

Signed-off-by: Adam Spiers <git@adamspiers.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoarchive: clarify explanation of --worktree-attributes
René Scharfe [Wed, 10 Apr 2013 17:49:57 +0000 (19:49 +0200)] 
archive: clarify explanation of --worktree-attributes

Make it a bit clearer that --worktree-attributes is about files in the
working tree (checked out files, possibly changed) and not the current
working directory ($PWD).  Link to the ATTRIBUTES section, which has
more details.

Reported-by: Amit Bakshi <ambakshi@gmail.com>
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agot/README: --immediate skips cleanup commands for failed tests
Simon Ruderich [Tue, 9 Apr 2013 21:48:36 +0000 (23:48 +0200)] 
t/README: --immediate skips cleanup commands for failed tests

Signed-off-by: Simon Ruderich <simon@ruderich.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agocheckout: abbreviate hash in suggest_reattach
Kevin Bracey [Mon, 8 Apr 2013 15:53:42 +0000 (18:53 +0300)] 
checkout: abbreviate hash in suggest_reattach

After printing the list of left-behind commits (with abbreviated
hashes), use an abbreviated hash in the suggested 'git branch' command;
there's no point in outputting a full 40-character hex string in some
friendly advice.

Signed-off-by: Kevin Bracey <kevin@bracey.fi>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-bzr: improve tag handling
Felipe Contreras [Mon, 8 Apr 2013 18:36:39 +0000 (13:36 -0500)] 
remote-bzr: improve tag handling

revision_history() is deprecated and doesn't do what we want (revno
instead of dotted_revno?).

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-bzr: fix utf-8 support for fetching
Christophe Simonis [Mon, 8 Apr 2013 18:36:38 +0000 (13:36 -0500)] 
remote-bzr: fix utf-8 support for fetching

The previous patches didn't deal with all the scenarios.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoRevert 4b7f53da7618 (simplify-merges: drop merge from irrelevant side branch, 2013...
Junio C Hamano [Mon, 8 Apr 2013 20:10:27 +0000 (13:10 -0700)] 
Revert 4b7f53da7618 (simplify-merges: drop merge from irrelevant side branch, 2013-01-17)

Kevin Bracey reports that the change regresses a case shown in the
user manual.

Trading one fix with another breakage is not worth it.  Just keep
the test to document the existing breakage, and revert the change
for now.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoSync with 1.8.2.1
Junio C Hamano [Sun, 7 Apr 2013 22:28:50 +0000 (15:28 -0700)] 
Sync with 1.8.2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoGit 1.8.2.1 v1.8.2.1
Junio C Hamano [Sun, 7 Apr 2013 22:27:23 +0000 (15:27 -0700)] 
Git 1.8.2.1

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agobundle: Accept prerequisites without commit messages
Lukas Fleischer [Sun, 7 Apr 2013 11:53:15 +0000 (13:53 +0200)] 
bundle: Accept prerequisites without commit messages

While explicitly stating that the commit message in a prerequisite
line is optional, we required all lines with 40 or more characters
to contain a space after the object name, bailing out if a line
consisted of an object name only. This was to allow bundling a
history to a commit without an message, but the code forgot that it
already called rtrim() to remove that whitespace.

As a workaround, only check for SP when the line has more than 40
characters.

Signed-off-by: Lukas Fleischer <git@cryptocrack.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoUpdate draft release notes to 1.8.3
Junio C Hamano [Sun, 7 Apr 2013 21:40:26 +0000 (14:40 -0700)] 
Update draft release notes to 1.8.3

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'jk/rm-removed-paths'
Junio C Hamano [Sun, 7 Apr 2013 21:33:14 +0000 (14:33 -0700)] 
Merge branch 'jk/rm-removed-paths'

A handful of test cases and a corner case bugfix for "git rm".

* jk/rm-removed-paths:
  t3600: document failure of rm across symbolic links
  t3600: test behavior of reverse-d/f conflict
  rm: do not complain about d/f conflicts during deletion

11 years agoMerge branch 'tb/shared-perm'
Junio C Hamano [Sun, 7 Apr 2013 21:33:11 +0000 (14:33 -0700)] 
Merge branch 'tb/shared-perm'

Simplifies adjust_shared_perm() implementation.

* tb/shared-perm:
  path.c: optimize adjust_shared_perm()
  path.c: simplify adjust_shared_perm()

11 years agoMerge branch 'cn/commit-amend-doc'
Junio C Hamano [Sun, 7 Apr 2013 21:33:06 +0000 (14:33 -0700)] 
Merge branch 'cn/commit-amend-doc'

* cn/commit-amend-doc:
  Documentation/git-commit: reword the --amend explanation

11 years agoMerge branch 'fc/remote-helpers-test-updates'
Junio C Hamano [Sun, 7 Apr 2013 21:33:02 +0000 (14:33 -0700)] 
Merge branch 'fc/remote-helpers-test-updates'

* fc/remote-helpers-test-updates:
  remote-hg: fix hg-git test-case
  remote-bzr: remove stale check code for tests
  remote-helpers: fix the run of all tests
  remote-bzr: avoid echo -n

11 years agoMerge branch 'mg/texinfo-5'
Junio C Hamano [Sun, 7 Apr 2013 21:32:59 +0000 (14:32 -0700)] 
Merge branch 'mg/texinfo-5'

Strip @anchor elements in the texinfo output of the documentation,
as a single document created by concatenating our entire manual set
will produce many duplicates that makes newer texinfo unhappy.

* mg/texinfo-5:
  Documentation: Strip texinfo anchors to avoid duplicates

11 years agoMerge branch 'jk/diffcore-break-divzero'
Junio C Hamano [Sun, 7 Apr 2013 21:32:57 +0000 (14:32 -0700)] 
Merge branch 'jk/diffcore-break-divzero'

* jk/diffcore-break-divzero:
  diffcore-break: don't divide by zero

11 years agoMerge branch 'jk/bisect-prn-unsigned'
Junio C Hamano [Sun, 7 Apr 2013 21:32:54 +0000 (14:32 -0700)] 
Merge branch 'jk/bisect-prn-unsigned'

* jk/bisect-prn-unsigned:
  bisect: avoid signed integer overflow

11 years agoMerge branch 'rr/triangle'
Junio C Hamano [Sun, 7 Apr 2013 21:32:50 +0000 (14:32 -0700)] 
Merge branch 'rr/triangle'

Support "pull from one place, push to another place" workflow
better by introducing remote.pushdefault (overrides the "origin"
thing) and branch.*.pushremote (overrides the branch.*.remote).

* rr/triangle:
  remote.c: introduce branch.<name>.pushremote
  remote.c: introduce remote.pushdefault
  remote.c: introduce a way to have different remotes for fetch/push
  t5516 (fetch-push): drop implicit arguments from helper functions
  t5516 (fetch-push): update test description
  remote.c: simplify a bit of code using git_config_string()

11 years agoMerge branch 'mm/status-during-revert'
Junio C Hamano [Sun, 7 Apr 2013 21:32:03 +0000 (14:32 -0700)] 
Merge branch 'mm/status-during-revert'

"git status" learned to report that you are in the middle of a
revert session, just like it does for a cherry-pick and a bisect
session.

* mm/status-during-revert:
  status: show commit sha1 in "You are currently reverting" message
  status: show 'revert' state and status hint

11 years agoMerge branch 'jk/set-upstream-error-cases'
Junio C Hamano [Sun, 7 Apr 2013 21:31:08 +0000 (14:31 -0700)] 
Merge branch 'jk/set-upstream-error-cases'

The handing by "git branch --set-upstream-to" against various forms
of errorneous inputs were suboptimal.

* jk/set-upstream-error-cases:
  branch: give advice when tracking start-point is missing
  branch: mention start_name in set-upstream error messages
  branch: improve error message for missing --set-upstream-to ref
  branch: factor out "upstream is not a branch" error messages
  t3200: test --set-upstream-to with bogus refs

11 years agoMerge branch 'jk/filter-branch-come-back-to-original'
Junio C Hamano [Sun, 7 Apr 2013 21:29:34 +0000 (14:29 -0700)] 
Merge branch 'jk/filter-branch-come-back-to-original'

When used with "-d temporary-directory" option, "git filter-branch"
failed to come back to the original working tree to perform the
final clean-up procedure.

* jk/filter-branch-come-back-to-original:
  filter-branch: return to original dir after filtering

11 years agoSync with 1.8.1.6
Junio C Hamano [Sun, 7 Apr 2013 16:10:11 +0000 (09:10 -0700)] 
Sync with 1.8.1.6

11 years agofmt-merge-msg: use core.commentchar in tag signatures completely
Ralf Thielow [Sun, 7 Apr 2013 15:25:44 +0000 (17:25 +0200)] 
fmt-merge-msg: use core.commentchar in tag signatures completely

Commit eff80a9 (Allow custom "comment char") introduced a custom
comment character for commit messages but didn't use it completely
in the tag signature part.

This commit fixes that.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agofmt-merge-msg: respect core.commentchar in people credits
Ralf Thielow [Sun, 7 Apr 2013 15:25:43 +0000 (17:25 +0200)] 
fmt-merge-msg: respect core.commentchar in people credits

Commit eff80a9 (Allow custom "comment char") introduced a custom
comment character for commit messages but forgot to use it in
people credits which can be a part of a commit message.

With this commit, the custom comment character is also used
in people credits.

Signed-off-by: Ralf Thielow <ralf.thielow@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoGit 1.8.1.6 v1.8.1.6
Junio C Hamano [Sun, 7 Apr 2013 15:58:30 +0000 (08:58 -0700)] 
Git 1.8.1.6

Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoMerge branch 'jc/directory-attrs-regression-fix' into maint-1.8.1
Junio C Hamano [Sun, 7 Apr 2013 15:45:03 +0000 (08:45 -0700)] 
Merge branch 'jc/directory-attrs-regression-fix' into maint-1.8.1

A pattern "dir" (without trailing slash) in the attributes file
stopped matching a directory "dir" by mistake with an earlier change
that wanted to allow pattern "dir/" to also match.

* jc/directory-attrs-regression-fix:
  t: check that a pattern without trailing slash matches a directory
  dir.c::match_pathname(): pay attention to the length of string parameters
  dir.c::match_pathname(): adjust patternlen when shifting pattern
  dir.c::match_basename(): pay attention to the length of string parameters
  attr.c::path_matches(): special case paths that end with a slash
  attr.c::path_matches(): the basename is part of the pathname

11 years agoremote-helpers/test-bzr.sh: do not use "grep '\s'"
Torsten Bögershausen [Sun, 7 Apr 2013 08:48:30 +0000 (10:48 +0200)] 
remote-helpers/test-bzr.sh: do not use "grep '\s'"

Using grep "devel\s\+3:" to find at least one whitspace is not
portable on all grep versions; not all grep versions understand "\s"
as a "whitespace".

Use a literal TAB followed by SPACE.

The + as a qualifier for "one or more" is not a basic regular
expression; use egrep instead of grep.

Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agogitremote-helpers(1): clarify refspec behaviour
John Keeping [Sat, 6 Apr 2013 18:13:41 +0000 (19:13 +0100)] 
gitremote-helpers(1): clarify refspec behaviour

The documentation says that "If no 'refspec' capability is advertised,
there is an implied `refspec *:*`" but this is only the case for the
"import" command.

Since there is a comment in transport-helper.c indicating that this
default is for historical reasons, change the documentation to clarify
that a refspec should always be specified.

Signed-off-by: John Keeping <john@keeping.me.uk>
Acked-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agofast-export: Allow pruned-references in mark file
Antoine Pelisse [Sat, 6 Apr 2013 17:04:31 +0000 (19:04 +0200)] 
fast-export: Allow pruned-references in mark file

fast-export can fail because of some pruned-reference when importing a
mark file.

The problem happens in the following scenario:

    $ git fast-export --export-marks=MARKS master
    (rewrite master)
    $ git prune
    $ git fast-export --import-marks=MARKS master

This might fail if some references have been removed by prune
because some marks will refer to no longer existing commits.
git-fast-export will not need these objects anyway as they were no
longer reachable.

We still need to update last_numid so we don't change the mapping
between marks and objects for remote-helpers.
Unfortunately, the mark file should not be rewritten without lost marks
if no new objects has been exported, as we could lose track of the last
last_numid.

Signed-off-by: Antoine Pelisse <apelisse@gmail.com>
Reviewed-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-bzr: add utf-8 support for pushing
Felipe Contreras [Sat, 6 Apr 2013 03:49:23 +0000 (21:49 -0600)] 
remote-bzr: add utf-8 support for pushing

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-bzr: add utf-8 support for fetching
Timotheus Pokorra [Sat, 6 Apr 2013 03:49:22 +0000 (21:49 -0600)] 
remote-bzr: add utf-8 support for fetching

[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-bzr: avoid unreferred tags
Felipe Contreras [Sat, 6 Apr 2013 03:49:21 +0000 (21:49 -0600)] 
remote-bzr: avoid unreferred tags

They have no content, there's nothing we can do with them.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-bzr: only update workingtree on local repos
Felipe Contreras [Sat, 6 Apr 2013 03:49:20 +0000 (21:49 -0600)] 
remote-bzr: only update workingtree on local repos

Apparently, that's the only way it's possible.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-bzr: set author if available
David Engster [Sat, 6 Apr 2013 03:49:19 +0000 (21:49 -0600)] 
remote-bzr: set author if available

[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-bzr: remove files before modifications
Christophe Simonis [Sat, 6 Apr 2013 03:49:18 +0000 (21:49 -0600)] 
remote-bzr: remove files before modifications

Allow re-add of a deleted file in the same commit.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-bzr: fix directory renaming
Christophe Simonis [Sat, 6 Apr 2013 03:49:17 +0000 (21:49 -0600)] 
remote-bzr: fix directory renaming

Git does not handle directories, renaming a directory is renaming every
files in this directory.

[fc: added tests]

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoshow-branch: use strbuf instead of static buffer
Jeff King [Fri, 5 Apr 2013 21:15:50 +0000 (17:15 -0400)] 
show-branch: use strbuf instead of static buffer

When we generate relative names (e.g., "master~20^2"), we
format the name into a static buffer, then xstrdup the
result to attach it to the commit. Since the first thing we
add into the static buffer is the already-computed name of
the child commit, the names may get longer and longer as
the traversal gets deeper, and we may eventually overflow
the fixed-size buffer.

Fix this by converting the fixed-size buffer into a dynamic
strbuf.  The performance implications should be minimal, as
we end up allocating a heap copy of the name anyway (and now
we can just detach the heap copy from the strbuf).

Reported-by: Eric Roman <eroman@chromium.org>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agohttp: drop http_error function
Jeff King [Fri, 5 Apr 2013 22:22:31 +0000 (18:22 -0400)] 
http: drop http_error function

This function is a single-liner and is only called from one
place. Just inline it, which makes the code more obvious.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agoremote-curl: die directly with http error messages
Jeff King [Fri, 5 Apr 2013 22:22:15 +0000 (18:22 -0400)] 
remote-curl: die directly with http error messages

When we encounter an unknown http error (e.g., a 403), we
hand the error code to http_error, which then prints it with
error(). After that we die with the redundant message "HTTP
request failed".

Instead, let's just drop http_error entirely, which does
nothing but pass arguments to error(), and instead die
directly with a useful message.

So before:

  $ git clone https://example.com/repo.git
  Cloning into 'repo'...
  error: unable to access 'https://example.com/repo.git': The requested URL returned error: 403 Forbidden
  fatal: HTTP request failed

and after:

  $ git clone https://example.com/repo.git
  Cloning into 'repo'...
  fatal: unable to access 'https://example.com/repo.git': The requested URL returned error: 403 Forbidden

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
11 years agohttp: re-word http error message
Jeff King [Fri, 5 Apr 2013 22:22:01 +0000 (18:22 -0400)] 
http: re-word http error message

When we report an http error code, we say something like:

  error: The requested URL reported failure: 403 Forbidden while accessing http://example.com/repo.git

Everything between "error:" and "while" is written by curl,
and the resulting sentence is hard to read (especially
because there is no punctuation between curl's sentence and
the remainder of ours). Instead, let's re-order this to give
better flow:

  error: unable to access 'http://example.com/repo.git: The requested URL reported failure: 403 Forbidden

This is still annoyingly long, but at least reads more
clearly left to right.

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