Commit graph

38719 commits

Author SHA1 Message Date
Junio C Hamano f11f76b2bb Merge branch 'ab/merge-file-prefix'
"git merge-file" did not work correctly in a subdirectory.

* ab/merge-file-prefix:
  merge-file: correctly open files when in a subdir
2015-02-22 12:28:25 -08:00
Junio C Hamano 073bb8ebb8 Merge branch 'es/blame-commit-info-fix'
"git blame" died, trying to free an uninitialized piece of memory.

* es/blame-commit-info-fix:
  builtin/blame: destroy initialized commit_info only
2015-02-22 12:28:24 -08:00
Junio C Hamano df3f4ba1a3 Merge branch 'ss/check-builtins-on-windows'
* ss/check-builtins-on-windows:
  check-builtins: strip executable suffix $X when enumerating builtins
2015-02-22 12:28:23 -08:00
Junio C Hamano f3f407747c Post 2.3 cycle (batch #3)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-18 11:53:17 -08:00
Junio C Hamano 74f45dfd78 Merge branch 'jc/push-cert'
"git push --signed" gave an incorrectly worded error message when
the other side did not support the capability.

* jc/push-cert:
  transport-helper: fix typo in error message when --signed is not supported
2015-02-18 11:45:03 -08:00
Junio C Hamano ca00db08da Merge branch 'jk/decimal-width-for-uintmax'
We didn't format an integer that wouldn't fit in "int" but in
"uintmax_t" correctly.

* jk/decimal-width-for-uintmax:
  decimal_width: avoid integer overflow
2015-02-18 11:45:02 -08:00
Junio C Hamano de15bdb058 Merge branch 'jk/config-no-ungetc-eof'
Reading configuration from a blob object, when it ends with a lone
CR, use to confuse the configuration parser.

* jk/config-no-ungetc-eof:
  config_buf_ungetc: warn when pushing back a random character
  config: do not ungetc EOF
2015-02-18 11:45:01 -08:00
Junio C Hamano 2c1f554d0c Merge branch 'jk/pack-bitmap'
The pack bitmap support did not build with older versions of GCC.

* jk/pack-bitmap:
  ewah: fix building with gcc < 3.4.0
2015-02-18 11:45:00 -08:00
Junio C Hamano db30b8333b Merge branch 'jc/remote-set-url-doc'
Clarify in the documentation that "remote.<nick>.pushURL" and
"remote.<nick>.URL" are there to name the same repository accessed
via different transports, not two separate repositories.

* jc/remote-set-url-doc:
  Documentation/git-remote.txt: stress that set-url is not for triangular
2015-02-18 11:44:59 -08:00
Junio C Hamano d3e73b5b31 Merge branch 'ch/new-gpg-drops-rfc-1991'
Older GnuPG implementations may not correctly import the keyring
material we prepare for the tests to use.

* ch/new-gpg-drops-rfc-1991:
  t/lib-gpg: sanity-check that we can actually sign
  t/lib-gpg: include separate public keys in keyring.gpg
2015-02-18 11:44:58 -08:00
Junio C Hamano f18e3896f7 Merge branch 'ye/http-accept-language'
Using environment variable LANGUAGE and friends on the client side,
HTTP-based transports now send Accept-Language when making requests.

* ye/http-accept-language:
  http: add Accept-Language header if possible
2015-02-18 11:44:57 -08:00
Junio C Hamano c2d081ceb9 Merge branch 'av/wincred-with-at-in-username-fix'
The credential helper for Windows (in contrib/) used to mishandle
a user name with an at-sign in it.

* av/wincred-with-at-in-username-fix:
  wincred: fix get credential if username has "@"
2015-02-18 11:44:56 -08:00
Junio C Hamano 3188ab3af6 Post 2.3 cycle (batch #2)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-17 10:22:17 -08:00
Junio C Hamano a158904323 Merge branch 'mg/push-repo-option-doc'
The "git push" documentation made the "--repo=<there>" option
easily misunderstood.

* mg/push-repo-option-doc:
  git-push.txt: document the behavior of --repo
2015-02-17 10:15:31 -08:00
Junio C Hamano 445bb5b74d Merge branch 'jc/t4122-use-test-write-lines'
* jc/t4122-use-test-write-lines:
  t4122: use test_write_lines from test-lib-functions
2015-02-17 10:15:29 -08:00
Junio C Hamano fccf4a0567 Merge branch 'jk/status-read-branch-name-fix'
Code to read branch name from various files in .git/ directory
would have misbehaved if the code to write them left an empty file.

* jk/status-read-branch-name-fix:
  read_and_strip_branch: fix typo'd address-of operator
2015-02-17 10:15:29 -08:00
Junio C Hamano f6b50a8bf4 Merge branch 'jk/remote-curl-an-array-in-struct-cannot-be-null'
Fix a misspelled conditional that is always true.

* jk/remote-curl-an-array-in-struct-cannot-be-null:
  do not check truth value of flex arrays
2015-02-17 10:15:27 -08:00
Junio C Hamano ec8618a7f8 Merge branch 'jc/diff-format-doc'
The documentation incorrectly said that C(opy) and R(ename) are the
only ones that can be followed by the score number in the output in
the --raw format.

* jc/diff-format-doc:
  diff-format doc: a score can follow M for rewrite
2015-02-17 10:15:26 -08:00
Junio C Hamano b93b5b21b5 Merge branch 'jk/dumb-http-idx-fetch-fix'
A broken pack .idx file in the receiving repository prevented the
dumb http transport from fetching a good copy of it from the other
side.

* jk/dumb-http-idx-fetch-fix:
  dumb-http: do not pass NULL path to parse_pack_index
2015-02-17 10:15:25 -08:00
Junio C Hamano d7c8b33a35 Merge branch 'mg/commit-author-no-match-malformed-message'
The error message from "git commit", when a non-existing author
name was given as value to the "--author=" parameter, has been
reworded to avoid misunderstanding.

* mg/commit-author-no-match-malformed-message:
  commit: reword --author error message
2015-02-17 10:15:23 -08:00
Junio C Hamano a23069ce04 Merge branch 'jc/doc-log-rev-list-options'
"git log --help" used to show rev-list options that are irrelevant
to the "log" command.

* jc/doc-log-rev-list-options:
  Documentation: what does "git log --indexed-objects" even mean?
2015-02-17 10:15:22 -08:00
Junio C Hamano 38459ee6af Merge branch 'jc/apply-ws-fix-expands'
"git apply --whitespace=fix" used to under-allocate the memory
when the fix resulted in a longer text than the original patch.

* jc/apply-ws-fix-expands:
  apply: count the size of postimage correctly
  apply: make update_pre_post_images() sanity check the given postlen
  apply.c: typofix
2015-02-17 10:15:21 -08:00
Junio C Hamano c1fa3e21bc Merge branch 'ak/add-i-empty-candidates'
The interactive "show a list and let the user choose from it"
interface "add -i" used showed and prompted to the user even when
the candidate list was empty, against which the only "choice" the
user could have made was to choose nothing.

* ak/add-i-empty-candidates:
  add -i: return from list_and_choose if there is no candidate
2015-02-17 10:15:20 -08:00
Junio C Hamano 9f55a77777 Merge branch 'ks/rebase-i-abbrev'
The insn sheet "git rebase -i" creates did not fully honor
core.abbrev settings.

* ks/rebase-i-abbrev:
  rebase -i: use full object name internally throughout the script
2015-02-17 10:15:18 -08:00
Junio C Hamano a6c68158e5 Merge branch 'mh/deref-symref-over-helper-transport'
"git fetch" over a remote-helper that cannot respond to "list"
command could not fetch from a symbolic reference e.g. HEAD.

* mh/deref-symref-over-helper-transport:
  transport-helper: do not request symbolic refs to remote helpers
2015-02-17 10:15:18 -08:00
Mike Hommey 45917f0f99 transport-helper: fix typo in error message when --signed is not supported
Signed-off-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-12 12:31:28 -08:00
Junio C Hamano 18d0fec240 Post 2.3 cycle (batch #1)
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-11 13:54:03 -08:00
Junio C Hamano bb831db677 Merge branch 'ah/usage-strings'
* ah/usage-strings:
  standardize usage info string format
2015-02-11 13:44:20 -08:00
Junio C Hamano afa3ccbf44 Merge branch 'jc/pretty-format-doc'
* jc/pretty-format-doc:
  "log --pretty" documentation: do not forget "tformat:"
2015-02-11 13:44:16 -08:00
Junio C Hamano c985aaf879 Merge branch 'jc/unused-symbols'
Mark file-local symbols as "static", and drop functions that nobody
uses.

* jc/unused-symbols:
  shallow.c: make check_shallow_file_for_update() static
  remote.c: make clear_cas_option() static
  urlmatch.c: make match_urls() static
  revision.c: make save_parents() and free_saved_parents() static
  line-log.c: make line_log_data_init() static
  pack-bitmap.c: make pack_bitmap_filename() static
  prompt.c: remove git_getpass() nobody uses
  http.c: make finish_active_slot() and handle_curl_result() static
2015-02-11 13:44:07 -08:00
Junio C Hamano cba07bb6ff Merge branch 'jc/push-to-checkout'
Extending the js/push-to-deploy topic, the behaviour of "git push"
when updating the working tree and the index with an update to the
branch that is checked out can be tweaked by push-to-checkout hook.

* jc/push-to-checkout:
  receive-pack: support push-to-checkout hook
  receive-pack: refactor updateInstead codepath
2015-02-11 13:43:56 -08:00
Junio C Hamano 39fa6112ec Merge branch 'sb/atomic-push'
"git push" has been taught a "--atomic" option that makes push to
update more than one ref an "all-or-none" affair.

* sb/atomic-push:
  Document receive.advertiseatomic
  t5543-atomic-push.sh: add basic tests for atomic pushes
  push.c: add an --atomic argument
  send-pack.c: add --atomic command line argument
  send-pack: rename ref_update_to_be_sent to check_to_send_update
  receive-pack.c: negotiate atomic push support
  receive-pack.c: add execute_commands_atomic function
  receive-pack.c: move transaction handling in a central place
  receive-pack.c: move iterating over all commands outside execute_commands
  receive-pack.c: die instead of error in case of possible future bug
  receive-pack.c: shorten the execute_commands loop over all commands
2015-02-11 13:43:51 -08:00
Junio C Hamano 4d5c4e498a Merge branch 'mh/reflog-expire'
Restructure "reflog expire" to fit the reflogs better with the
recently updated ref API.

Looked reasonable (except that some shortlog entries stood out like
a sore thumb).

* mh/reflog-expire: (24 commits)
  refs.c: let fprintf handle the formatting
  refs.c: don't expose the internal struct ref_lock in the header file
  lock_any_ref_for_update(): inline function
  refs.c: remove unlock_ref/close_ref/commit_ref from the refs api
  reflog_expire(): new function in the reference API
  expire_reflog(): treat the policy callback data as opaque
  Move newlog and last_kept_sha1 to "struct expire_reflog_cb"
  expire_reflog(): move rewrite to flags argument
  expire_reflog(): move verbose to flags argument
  expire_reflog(): pass flags through to expire_reflog_ent()
  struct expire_reflog_cb: a new callback data type
  Rename expire_reflog_cb to expire_reflog_policy_cb
  expire_reflog(): move updateref to flags argument
  expire_reflog(): move dry_run to flags argument
  expire_reflog(): add a "flags" argument
  expire_reflog(): extract two policy-related functions
  Extract function should_expire_reflog_ent()
  expire_reflog(): use a lock_file for rewriting the reflog file
  expire_reflog(): return early if the reference has no reflog
  expire_reflog(): rename "ref" parameter to "refname"
  ...
2015-02-11 13:43:38 -08:00
Junio C Hamano 1ba6e860b9 Merge branch 'cj/log-invert-grep'
"git log --invert-grep --grep=WIP" will show only commits that do
not have the string "WIP" in their messages.

* cj/log-invert-grep:
  log: teach --invert-grep option
2015-02-11 13:42:39 -08:00
Junio C Hamano b19aab58f1 Merge branch 'km/gettext-n'
* km/gettext-n:
  gettext.h: add parentheses around N_ expansion if supported
2015-02-11 13:42:00 -08:00
Junio C Hamano 1c4ebbc3ad Merge branch 'bc/http-fallback-to-password-after-krb-fails'
After attempting and failing a password-less authentication
(e.g. kerberos), libcURL refuses to fall back to password based
Basic authentication without a bit of help/encouragement.

* bc/http-fallback-to-password-after-krb-fails:
  remote-curl: fall back to Basic auth if Negotiate fails
2015-02-11 13:41:55 -08:00
Junio C Hamano 35d28f32e6 Merge branch 'dk/format-patch-ignore-diff-submodule'
Setting diff.submodule to 'log' made "git format-patch" produce
broken patches.

* dk/format-patch-ignore-diff-submodule:
  format-patch: ignore diff.submodule setting
  t4255: test am submodule with diff.submodule
2015-02-11 13:41:52 -08:00
Junio C Hamano 76c6747b7e Merge branch 'jn/rerere-fail-on-auto-update-failure'
"git rerere" (invoked internally from many mergy operations) did
not correctly signal errors when told to update the working tree
files and failed to do so for whatever reason.

* jn/rerere-fail-on-auto-update-failure:
  rerere: error out on autoupdate failure
2015-02-11 13:41:45 -08:00
Junio C Hamano 092c4be7f5 Merge branch 'jk/blame-commit-label'
"git blame HEAD -- missing" failed to correctly say "HEAD" when it
tried to say "No such path 'missing' in HEAD".

* jk/blame-commit-label:
  blame.c: fix garbled error message
  use xstrdup_or_null to replace ternary conditionals
  builtin/commit.c: use xstrdup_or_null instead of envdup
  builtin/apply.c: use xstrdup_or_null instead of null_strdup
  git-compat-util: add xstrdup_or_null helper
2015-02-11 13:39:50 -08:00
Junio C Hamano 5c9c3dfaff Merge branch 'ld/p4-submit-hint'
* ld/p4-submit-hint:
  git-p4: correct --prepare-p4-only instructions
2015-02-11 13:39:44 -08:00
Junio C Hamano 7706d85453 Merge branch 'ld/p4-exclude-in-sync'
Like the "clone" subcommand, allow excluding subdirectories in the
"sync" subcommand.

* ld/p4-exclude-in-sync:
  git-p4: support excluding paths on sync
2015-02-11 13:38:42 -08:00
Luke Diamand 51334bb094 git-p4: support excluding paths on sync
The clone subcommand has long had support for excluding
subdirectories, but sync has not. This is a nuisance,
since as soon as you do a sync, any changed files that
were initially excluded start showing up.

Move the "exclude" command-line option into the parent
class; the actual behavior was already present there so
it simply had to be exposed.

Signed-off-by: Luke Diamand <luke@diamand.org>
Reviewed-by: Pete Wyckoff <pw@padd.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-11 13:38:29 -08:00
Junio C Hamano fcae987e94 Merge branch 'jc/coding-guidelines'
* jc/coding-guidelines:
  CodingGuidelines: clarify C #include rules
2015-02-11 13:37:42 -08:00
Junio C Hamano 14f563031d Merge branch 'ak/typofixes'
* ak/typofixes:
  t/lib-terminal.sh: fix typo
  pack-bitmap: fix typo
2015-02-11 13:37:39 -08:00
Aleksander Boruch-Gruszecki 204a8ffe67 merge-file: correctly open files when in a subdir
run_setup_gently() is called before merge-file. This may result in changing
current working directory, which wasn't taken into account when opening a file
for writing.

Fix by prepending the passed prefix. Previous var is left so that error
messages keep referring to the file from the user's working directory
perspective.

Signed-off-by: Aleksander Boruch-Gruszecki <aleksander.boruchgruszecki@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-11 11:01:50 -08:00
Eric Sunshine e60059276b builtin/blame: destroy initialized commit_info only
Since ea02ffa3 (mailmap: simplify map_user() interface, 2013-01-05),
find_alignment() has been invoking commit_info_destroy() on an
uninitialized auto 'struct commit_info' (when METAINFO_SHOWN is not
set). commit_info_destroy() calls strbuf_release() for each
'commit_info' strbuf member, which randomly invokes free() on
whatever random stack value happens to reside in strbuf.buf, thus
leading to periodic crashes.

Reported-by: Dilyan Palauzov <dilyan.palauzov@aegee.org>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-10 10:31:48 -08:00
Junio C Hamano 9874fca712 Git 2.3
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-05 13:23:56 -08:00
Jeff King 1d0655c15e config_buf_ungetc: warn when pushing back a random character
Our config code simulates a stdio stream around a buffer,
but our fake ungetc() does not behave quite like the real
one. In particular, we only rewind the position by one
character, but do _not_ actually put the character from the
caller into position.

It turns out that this does not matter, because we only ever
push back the character we just read. In other words, such
an assignment would be a noop. But because the function is
called ungetc, and because it takes a character parameter,
it is a mistake waiting to happen.

Actually assigning the character into the buffer would be
ideal, but our pointer is actually a "const" copy of the
buffer. We do not know who the real owner of the buffer is
in this code, and would not want to munge their contents.

Instead, we can simply add an assertion that matches what
the current caller does, and will let us know if new callers
are added that violate the contract.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-05 13:16:55 -08:00
Jeff King d306f3d351 decimal_width: avoid integer overflow
The decimal_width function originally appeared in blame.c as
"lineno_width", and was designed for calculating the
print-width of small-ish integer values (line numbers in
text files). In ec7ff5b, it was made into a reusable
function, and in dc801e7, we started using it to align
diffstats.

Binary files in a diffstat show byte counts rather than line
numbers, meaning they can be quite large (e.g., consider
adding or removing a 2GB file). decimal_width is not up to
the challenge for two reasons:

  1. It takes the value as an "int", whereas large files may
     easily surpass this. The value may be truncated, in
     which case we will produce an incorrect value.

  2. It counts "up" by repeatedly multiplying another
     integer by 10 until it surpasses the value.  This can
     cause an infinite loop when the value is close to the
     largest representable integer.

     For example, consider using a 32-bit signed integer,
     and a value of 2,140,000,000 (just shy of 2^31-1).
     We will count up and eventually see that 1,000,000,000
     is smaller than our value. The next step would be to
     multiply by 10 and see that 10,000,000,000 is too
     large, ending the loop. But we can't represent that
     value, and we have signed overflow.

     This is technically undefined behavior, but a common
     behavior is to lose the high bits, in which case our
     iterator will certainly be less than the number. So
     we'll keep multiplying, overflow again, and so on.

This patch changes the argument to a uintmax_t (the same
type we use to store the diffstat information for binary
filese), and counts "down" by repeatedly dividing our value
by 10.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-05 12:38:35 -08:00
Jeff King 5e0be134d3 config: do not ungetc EOF
When we are parsing a config value, if we see a carriage
return, we fgetc the next character to see if it is a
line feed (in which case we silently drop the CR). If it
isn't, we then ungetc the character, and take the literal
CR.

But we never check whether we in fact got a character at
all. If the config file ends in CR, we will get EOF here,
and try to ungetc EOF. This works OK for a real stdio
stream. The ungetc returns an error, and the next fgetc will
then return EOF again.

However, our custom buffer-based stream is not so fortunate.
It happily rewinds the position of the stream by one
character, ignoring the fact that we fed it EOF. The next
fgetc call returns the final CR again, over and over, and we
end up in an infinite loop.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2015-02-05 12:37:36 -08:00