Commit graph

38994 commits

Author SHA1 Message Date
Junio C Hamano c12eca7ed2 Merge branch 'jk/smart-http-hide-refs'
The transfer.hiderefs support did not quite work for smart-http
transport.

* jk/smart-http-hide-refs:
  upload-pack: do not check NULL return of lookup_unknown_object
  upload-pack: fix transfer.hiderefs over smart-http
2015-03-23 11:28:08 -07:00
Junio C Hamano a633651d21 Merge branch 'jk/tag-h-column-is-a-listing-option'
"git tag -h" used to show the "--column" and "--sort" options
that are about listing in a wrong section.

* jk/tag-h-column-is-a-listing-option:
  tag: fix some mis-organized options in "-h" listing
2015-03-23 11:28:02 -07:00
Junio C Hamano e80e85a52a Post 2.3 cycle (batch #11)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-20 13:53:26 -07:00
Junio C Hamano 46d403f13e Merge branch 'mg/log-decorate-HEAD'
Output from "git log --decorate" mentions HEAD when it points at a
tip of an branch differently from a detached HEAD.

This is a potentially backward-incompatible change.

* mg/log-decorate-HEAD:
  log: decorate HEAD with branch name
2015-03-20 13:51:24 -07:00
Junio C Hamano 5f456b3c26 Merge branch 'jc/decorate-leaky-separator-color'
"git log --decorate" did not reset colors correctly around the
branch names.

* jc/decorate-leaky-separator-color:
  log --decorate: do not leak "commit" color into the next item
  Documentation/config.txt: simplify boolean description in the syntax section
  Documentation/config.txt: describe 'color' value type in the "Values" section
  Documentation/config.txt: have a separate "Values" section
  Documentation/config.txt: describe the structure first and then meaning
  Documentation/config.txt: explain multi-valued variables once
  Documentation/config.txt: avoid unnecessary negation
2015-03-20 13:50:51 -07:00
Junio C Hamano cfe96b38fd Merge branch 'sb/leaks'
Code cleanup.

* sb/leaks:
  builtin/help.c: fix memory leak
  bundle.c: fix memory leak
  connect.c: do not leak "conn" after showing diagnosis
2015-03-20 13:11:53 -07:00
Junio C Hamano daea6fca35 Merge branch 'rs/use-isxdigit'
Code cleanup.

* rs/use-isxdigit:
  use isxdigit() for checking if a character is a hexadecimal digit
2015-03-20 13:11:52 -07:00
Junio C Hamano 4c24385e80 Merge branch 'mg/verify-commit'
Workarounds for certain build of GPG that triggered false breakage
in a test.

* mg/verify-commit:
  t7510: do not fail when gpg warns about insecure memory
2015-03-20 13:11:51 -07:00
Junio C Hamano 0a81977239 Merge branch 'km/imap-send-libcurl-options'
"git imap-send" learned to optionally talk with an IMAP server via
libcURL; because there is no other option when Git is built with
NO_OPENSSL option, use that codepath by default under such
configuration.

* km/imap-send-libcurl-options:
  imap-send: use cURL automatically when NO_OPENSSL defined
2015-03-20 13:11:50 -07:00
Junio C Hamano 551fc7aec1 Merge branch 'km/bsd-sysctl'
We now detect number of CPUs on older BSD-derived systems.

* km/bsd-sysctl:
  thread-utils.c: detect CPU count on older BSD-like systems
  configure: support HAVE_BSD_SYSCTL option
2015-03-20 13:11:49 -07:00
Junio C Hamano ec0465ade8 Merge branch 'km/bsd-shells'
Portability fixes and workarounds for shell scripts have been added
to help BSD-derived systems.

* km/bsd-shells:
  t5528: do not fail with FreeBSD shell
  help.c: use SHELL_PATH instead of hard-coded "/bin/sh"
  git-compat-util.h: move SHELL_PATH default into header
  git-instaweb: use @SHELL_PATH@ instead of /bin/sh
  git-instaweb: allow running in a working tree subdirectory
2015-03-20 13:11:48 -07:00
Junio C Hamano 89ebf97c11 Merge branch 'rs/daemon-hostname-in-strbuf'
Code in "git daemon" to parse out and hold hostnames used in
request interpolation has been simplified.

* rs/daemon-hostname-in-strbuf:
  daemon: deglobalize hostname information
  daemon: use strbuf for hostname info
2015-03-20 13:11:47 -07:00
Junio C Hamano 38f6ae90de Merge branch 'mg/detached-head-report'
"git branch" on a detached HEAD always said "(detached from xyz)",
even when "git status" would report "detached at xyz".  The HEAD is
actually at xyz and haven't been moved since it was detached in
such a case, but the user cannot read what the current value of
HEAD is when "detached from" is used.

* mg/detached-head-report:
  branch: name detached HEAD analogous to status
  wt-status: refactor detached HEAD analysis
2015-03-20 13:11:46 -07:00
Junio C Hamano d6c988ddfa Merge branch 'kn/git-cd-to-empty'
"git -C '' subcmd" refused to work in the current directory, unlike
"cd ''" which silently behaves as a no-op.

* kn/git-cd-to-empty:
  git: treat "git -C '<path>'" as a no-op when <path> is empty
2015-03-20 13:11:46 -07:00
Junio C Hamano f57610a1ff Merge branch 'nd/versioncmp-prereleases'
The versionsort.prerelease configuration variable can be used to
specify that v1.0-pre1 comes before v1.0.

* nd/versioncmp-prereleases:
  config.txt: update versioncmp.prereleaseSuffix
  versionsort: support reorder prerelease suffixes
2015-03-20 13:11:45 -07:00
Junio C Hamano 9ab698f400 Post 2.3 cyce (batch #10)
Also declare that the next one will be called v2.4 ;-)

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-17 16:05:12 -07:00
Junio C Hamano 2a39bdb9a1 Merge branch 'mg/doc-status-color-slot'
Documentation fixes.

* mg/doc-status-color-slot:
  config,completion: add color.status.unmerged
2015-03-17 16:01:34 -07:00
Junio C Hamano 9bb56e4753 Merge branch 'mg/status-v-v'
"git status" now allows the "-v" to be given twice to show the
differences that are left in the working tree not to be committed.

* mg/status-v-v:
  commit/status: show the index-worktree diff with -v -v
  t7508: test git status -v
  t7508: .gitignore 'expect' and 'output' files
2015-03-17 16:01:33 -07:00
Junio C Hamano 795b01422d Merge branch 'mg/sequencer-commit-messages-always-verbatim'
"git cherry-pick" used to clean-up the log message even when it is
merely replaying an existing commit.  It now replays the message
verbatim unless you are editing the message of resulting commits.

* mg/sequencer-commit-messages-always-verbatim:
  sequencer: preserve commit messages
2015-03-17 16:01:32 -07:00
Junio C Hamano e5b8ce243c Merge branch 'sg/completion-remote'
Code simplification.

* sg/completion-remote:
  completion: simplify __git_remotes()
  completion: add a test for __git_remotes() helper function
2015-03-17 16:01:30 -07:00
Junio C Hamano fbcbcee51c Merge branch 'es/rebase-i-count-todo'
"git rebase -i" recently started to include the number of
commits in the insn sheet to be processed, but on a platform
that prepends leading whitespaces to "wc -l" output, the numbers
are shown with extra whitespaces that aren't necessary.

* es/rebase-i-count-todo:
  rebase-interactive: re-word "item count" comment
  rebase-interactive: suppress whitespace preceding item count
2015-03-17 16:01:29 -07:00
Junio C Hamano 860b05b77b Merge branch 'ak/git-done-help-cleanup'
Code simplification.

* ak/git-done-help-cleanup:
  git: make was_alias and done_help non-static
2015-03-17 16:01:28 -07:00
Junio C Hamano f0b7ab3513 Merge branch 'rs/zip-text'
"git archive" can now be told to set the 'text' attribute in the
resulting zip archive.

* rs/zip-text:
  archive-zip: mark text files in archives
2015-03-17 16:01:27 -07:00
Junio C Hamano 6902c4da58 Merge branch 'rs/deflate-init-cleanup'
Code simplification.

* rs/deflate-init-cleanup:
  zlib: initialize git_zstream in git_deflate_init{,_gzip,_raw}
2015-03-17 16:01:26 -07:00
Junio C Hamano 52cae643c5 Sync with 2.3.3 2015-03-13 23:11:50 -07:00
Junio C Hamano bb8577532a Git 2.3.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-13 22:57:25 -07:00
Junio C Hamano 4b23b5d1af Merge branch 'mr/doc-clean-f-f' into maint
Documentation update.

* mr/doc-clean-f-f:
  Documentation/git-clean.txt: document that -f may need to be given twice
2015-03-13 22:56:12 -07:00
Junio C Hamano 113bc16094 Merge branch 'ak/t5516-typofix' into maint
* ak/t5516-typofix:
  t5516: correct misspelled pushInsteadOf
2015-03-13 22:56:11 -07:00
Junio C Hamano bb8f6de064 Merge branch 'jc/diff-test-updates' into maint
Test clean-up.

* jc/diff-test-updates:
  test_ln_s_add: refresh stat info of fake symbolic links
  t4008: modernise style
  t/diff-lib: check exact object names in compare_diff_raw
  tests: do not borrow from COPYING and README from the real source
  t4010: correct expected object names
  t9300: correct expected object names
  t4008: correct stale comments
2015-03-13 22:56:10 -07:00
Junio C Hamano 3aab60b3ba Merge branch 'jk/diffcore-rename-duplicate' into maint
A corrupt input to "git diff -M" can cause us to segfault.

* jk/diffcore-rename-duplicate:
  diffcore-rename: avoid processing duplicate destinations
  diffcore-rename: split locate_rename_dst into two functions
2015-03-13 22:56:08 -07:00
Junio C Hamano ae8ada450a Merge branch 'bw/kwset-use-unsigned' into maint
The borrowed code in kwset API did not follow our usual convention
to use "unsigned char" to store values that range from 0-255.

* bw/kwset-use-unsigned:
  kwset: use unsigned char to store values with high-bit set
2015-03-13 22:56:07 -07:00
Junio C Hamano 2408f3b74b Merge branch 'nd/grep-exclude-standard-help-fix' into maint
Description given by "grep -h" for its --exclude-standard option
was phrased poorly.

* nd/grep-exclude-standard-help-fix:
  grep: correct help string for --exclude-standard
2015-03-13 22:56:06 -07:00
Junio C Hamano 3af1bcafff Merge branch 'mg/doc-remote-tags-or-not' into maint
"git remote add" mentioned "--tags" and "--no-tags" and was not
clear that fetch from the remote in the future will use the default
behaviour when neither is given to override it.

* mg/doc-remote-tags-or-not:
  git-remote.txt: describe behavior without --tags and --no-tags
2015-03-13 22:56:05 -07:00
Junio C Hamano a4b4f9b8e3 Merge branch 'mk/diff-shortstat-dirstat-fix' into maint
"git diff --shortstat --dirstat=changes" showed a dirstat based on
lines that was never asked by the end user in addition to the
dirstat that the user asked for.

* mk/diff-shortstat-dirstat-fix:
  diff --shortstat --dirstat: remove duplicate output
2015-03-13 22:56:04 -07:00
Junio C Hamano 30a52c1dcb Merge branch 'ms/submodule-update-config-doc' into maint
The interaction between "git submodule update" and the
submodule.*.update configuration was not clearly documented.

* ms/submodule-update-config-doc:
  submodule: improve documentation of update subcommand
2015-03-13 22:56:03 -07:00
Junio C Hamano 5244a31039 Merge branch 'jc/apply-beyond-symlink' into maint
"git apply" was not very careful about reading from, removing,
updating and creating paths outside the working tree (under
--index/--cached) or the current directory (when used as a
replacement for GNU patch).

* jc/apply-beyond-symlink:
  apply: do not touch a file beyond a symbolic link
  apply: do not read from beyond a symbolic link
  apply: do not read from the filesystem under --index
  apply: reject input that touches outside the working area
2015-03-13 22:56:02 -07:00
Junio C Hamano 1469d99068 Merge branch 'rs/daemon-interpolate' into maint
"git daemon" looked up the hostname even when "%CH" and "%IP"
interpolations are not requested, which was unnecessary.

* rs/daemon-interpolate:
  daemon: use callback to build interpolated path
  daemon: look up client-supplied hostname lazily
2015-03-13 22:56:01 -07:00
Junio C Hamano c722ba4814 Merge branch 'jk/daemon-interpolate' into maint
The "interpolated-path" option of "git daemon" inserted any string
client declared on the "host=" capability request without checking.
Sanitize and limit %H and %CH to a saner and a valid DNS name.

* jk/daemon-interpolate:
  daemon: sanitize incoming virtual hostname
  t5570: test git-daemon's --interpolated-path option
  git_connect: let user override virtual-host we send to daemon
2015-03-13 22:55:59 -07:00
Jeff King 8ddf3ca74f upload-pack: do not check NULL return of lookup_unknown_object
We check whether the return value of lookup_unknown_object
is NULL, but some code paths dereference it before our
check. This turns out not to be capable of causing a
segfault, though. The lookup_unknown_object function will
never return NULL, since the whole point is to allocate an
object struct if it does not find an existing one. So the
code here is not wrong, it is just confusing. Let's just
drop the NULL check.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-12 23:21:16 -07:00
Jeff King e172755b1e upload-pack: fix transfer.hiderefs over smart-http
When upload-pack advertises the refs (either for a normal,
non-stateless request, or for the initial contact in a
stateless one), we call for_each_ref with the send_ref
function as its callback. send_ref, in turn, calls
mark_our_ref, which checks whether the ref is hidden, and
sets OUR_REF or HIDDEN_REF on the object as appropriate.  If
it is hidden, mark_our_ref also returns "1" to signal
send_ref that the ref should not be advertised.

If we are not advertising refs, (i.e., the follow-up
invocation by an http client to send its "want" lines), we
use mark_our_ref directly as a callback to for_each_ref. Its
marking does the right thing, but when it then returns "1"
to for_each_ref, the latter interprets this as an error and
stops iterating. As a result, we skip marking all of the
refs that come lexicographically after it. Any "want" lines
from the client asking for those objects will fail, as they
were not properly marked with OUR_REF.

To solve this, we introduce a wrapper callback around
mark_our_ref which always returns 0 (even if the ref is
hidden, we want to keep iterating). We also tweak the
signature of mark_our_ref to exclude unnecessary parameters
that were present only to conform to the callback interface.
This should make it less likely for somebody to accidentally
use it as a callback in the future.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-12 23:18:33 -07:00
Jeff King dd059c6c07 tag: fix some mis-organized options in "-h" listing
Running "git tag -h" currently prints:

  [...]
  Tag creation options
      [...]
      --column[=<style>]    show tag list in columns
      --sort <type>         sort tags

  Tag listing options
      --contains <commit>   print only tags that contain the commit
      --points-at <object>  print only tags of the object

The "--column" and "--sort" options should go under the "Tag listing" group.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-12 11:54:55 -07:00
Stefan Beller fd2014d42b builtin/help.c: fix memory leak
Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-10 20:56:51 -07:00
Stefan Beller c8a571d8bc bundle.c: fix memory leak
There was one continue statement without an accompanying `free(ref)`.
Instead of adding that, replace all the free&&continue with a goto
just after writing the refs, where we'd do the free anyway and then
reloop.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-10 20:53:52 -07:00
René Scharfe 6f75d45b24 use isxdigit() for checking if a character is a hexadecimal digit
Use the standard function isxdigit() to make the intent clearer and
avoid using magic constants.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-10 15:44:41 -07:00
Stefan Beller 04f20c04c6 connect.c: do not leak "conn" after showing diagnosis
When git_connect() is called to see how the URL is parsed for
debugging purposes with CONNECT_DIAG_URL set, the variable conn is
leaked.  At this point in the codeflow, it only has its memory and
no other resource is associated with it, so it is sufficient to
clean it up by just freeing it.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-10 15:36:03 -07:00
Michael J Gruber 0d6accc01d config,completion: add color.status.unmerged
Reported-by: "Mladen B." <mladen074@gmail.com>
Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-10 15:27:59 -07:00
Kyle J. McKay 3f88c1b524 t7510: do not fail when gpg warns about insecure memory
Depending on how gpg was built, it may issue the following
message to stderr when run:

  Warning: using insecure memory!

When the test is collecting gpg output it is therefore not
enough to just match on a "gpg: " prefix it must also match
on a "Warning: " prefix wherever it needs to match lines
that have been produced by gpg.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Acked-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-10 15:25:22 -07:00
Kyle J. McKay ce026cc7e2 t5528: do not fail with FreeBSD shell
The FreeBSD shell converts this expression:

  git ${1:+-c push.default="$1"} push

to this when "$1" is not empty:

  git "-c push.default=$1" push

which causes git to fail.  To avoid this we simply break up the
expansion into two parts so that the whitespace which creates
two arguments instead of one is outside the ${...} like so:

  git ${1:+-c} ${1:+push.default="$1"} push

This has the desired effect on all platforms allowing the test
to pass on FreeBSD.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-10 15:23:28 -07:00
Kyle J. McKay dcd01ea187 imap-send: use cURL automatically when NO_OPENSSL defined
If both USE_CURL_FOR_IMAP_SEND and NO_OPENSSL are defined do
not force the user to add --curl to get a working git imap-send
command.

Instead automatically select --curl and warn and ignore the
--no-curl option.  And while we're in there, correct the
warning message when --curl is requested but not supported.

Signed-off-by: Kyle J. McKay <mackyle@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-10 15:19:05 -07:00
Junio C Hamano 51ff0f27bc log: decorate HEAD with branch name
Currently, log decorations do not indicate which branch is checked out
and whether HEAD is detached.

When branch foo is checked out, change the "HEAD, foo" part of the
decorations to "HEAD -> foo". This serves to indicate both ref
decorations (helped by the spacing) as well as their relationshsip.
As a consequence, "HEAD" without any " -> " denotes a detached HEAD now.

Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-03-10 15:17:48 -07:00