Commit graph

45050 commits

Author SHA1 Message Date
Junio C Hamano e828d33316 Merge branch 'jk/no-looking-at-dotgit-outside-repo'
A small code cleanup.

* jk/no-looking-at-dotgit-outside-repo:
  sha1_name: make wraparound of the index into ring-buffer explicit
2016-11-01 12:58:49 -07:00
Junio C Hamano bcb4425216 Merge branch 'rs/cocci'
Improve the rule to convert "unsigned char [20]" into "struct
object_id *" in contrib/coccinelle/

* rs/cocci:
  cocci: avoid self-references in object_id transformations
2016-11-01 12:58:49 -07:00
René Scharfe c2bb0c1d1e cocci: avoid self-references in object_id transformations
The object_id functions oid_to_hex, oid_to_hex_r, oidclr, oidcmp, and
oidcpy are defined as wrappers of their legacy counterparts sha1_to_hex,
sha1_to_hex_r, hashclr, hashcmp, and hashcpy, respectively.  Make sure
that the Coccinelle transformations for converting legacy function calls
are not applied to these wrappers themselves, which would result in
tautological declarations.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-01 10:58:39 -07:00
René Scharfe 3e98919a18 sha1_name: make wraparound of the index into ring-buffer explicit
Overflow is defined for unsigned integers, but not for signed ones.
Wrap around explicitly for the new ring-buffer in find_unique_abbrev()
as we did in bb84735c for the ones in sha1_to_hex() and get_pathname(),
thus avoiding signed overflows and getting rid of the magic number 3.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-11-01 10:56:39 -07:00
Junio C Hamano 1fe8f2cf46 Git 2.11-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-31 13:19:53 -07:00
Junio C Hamano ab3ad63c9a Merge branch 'nd/test-helpers'
Update to the test framework made in 2.9 timeframe broke running
the tests under valgrind, which has been fixed.

* nd/test-helpers:
  valgrind: support test helpers
2016-10-31 13:15:27 -07:00
Junio C Hamano 590f0bfe9f Merge branch 'sc/fmt-merge-msg-doc-markup-fix'
Documentation fix.

* sc/fmt-merge-msg-doc-markup-fix:
  Documentation/fmt-merge-msg: fix markup in example
2016-10-31 13:15:26 -07:00
Junio C Hamano da14d73d5e Merge branch 'ak/sh-setup-dot-source-i18n-fix'
Recent update to git-sh-setup (a library of shell functions that
are used by our in-tree scripted Porcelain commands) included
another shell library git-sh-i18n without specifying where it is,
relying on the $PATH.  This has been fixed to be more explicit by
prefixing $(git --exec-path) output in front.

* ak/sh-setup-dot-source-i18n-fix:
  git-sh-setup: be explicit where to dot-source git-sh-i18n from.
2016-10-31 13:15:25 -07:00
Junio C Hamano 2f445c17e5 Merge branch 'rs/commit-pptr-simplify'
Code simplification.

* rs/commit-pptr-simplify:
  commit: simplify building parents list
2016-10-31 13:15:25 -07:00
Junio C Hamano 702b6a6fc0 Merge branch 'jk/rebase-config-insn-fmt-docfix'
Documentation fix.

* jk/rebase-config-insn-fmt-docfix:
  doc: fix missing "::" in config list
2016-10-31 13:15:24 -07:00
Junio C Hamano 3d0ff881d0 Merge branch 'ak/pre-receive-hook-template-modefix'
A trivial clean-up to a recently graduated topic.

* ak/pre-receive-hook-template-modefix:
  pre-receive.sample: mark it executable
2016-10-31 13:15:23 -07:00
Junio C Hamano b8171981fd Merge branch 'jk/common-main'
A trivial clean-up to a recently graduated topic.

* jk/common-main:
  git-compat-util: move content inside ifdef/endif guards
2016-10-31 13:15:23 -07:00
Junio C Hamano 9fa1f902bf Merge branch 'aw/numbered-stash'
The user always has to say "stash@{$N}" when naming a single
element in the default location of the stash, i.e. reflogs in
refs/stash.  The "git stash" command learned to accept "git stash
apply 4" as a short-hand for "git stash apply stash@{4}".

* aw/numbered-stash:
  stash: allow stashes to be referenced by index only
2016-10-31 13:15:22 -07:00
Junio C Hamano cabb79d8c1 Merge branch 'jt/trailer-with-cruft'
Update "interpret-trailers" machinery and teaches it that people in
real world write all sorts of crufts in the "trailer" that was
originally designed to have the neat-o "Mail-Header: like thing"
and nothing else.

* jt/trailer-with-cruft:
  trailer: support values folded to multiple lines
  trailer: forbid leading whitespace in trailers
  trailer: allow non-trailers in trailer block
  trailer: clarify failure modes in parse_trailer
  trailer: make args have their own struct
  trailer: streamline trailer item create and add
  trailer: use list.h for doubly-linked list
  trailer: improve const correctness
2016-10-31 13:15:22 -07:00
Junio C Hamano dbaa6bdce2 Merge branch 'ls/filter-process'
The smudge/clean filter API expect an external process is spawned
to filter the contents for each path that has a filter defined.  A
new type of "process" filter API has been added to allow the first
request to run the filter for a path to spawn a single process, and
all filtering need is served by this single process for multiple
paths, reducing the process creation overhead.

* ls/filter-process:
  contrib/long-running-filter: add long running filter example
  convert: add filter.<driver>.process option
  convert: prepare filter.<driver>.process option
  convert: make apply_filter() adhere to standard Git error handling
  pkt-line: add functions to read/write flush terminated packet streams
  pkt-line: add packet_write_gently()
  pkt-line: add packet_flush_gently()
  pkt-line: add packet_write_fmt_gently()
  pkt-line: extract set_packet_header()
  pkt-line: rename packet_write() to packet_write_fmt()
  run-command: add clean_on_exit_handler
  run-command: move check_pipe() from write_or_die to run_command
  convert: modernize tests
  convert: quote filter names in error messages
2016-10-31 13:15:21 -07:00
Junio C Hamano 906d6906fb Merge branch 'ls/git-open-cloexec'
Git generally does not explicitly close file descriptors that were
open in the parent process when spawning a child process, but most
of the time the child does not want to access them. As Windows does
not allow removing or renaming a file that has a file descriptor
open, a slow-to-exit child can even break the parent process by
holding onto them.  Use O_CLOEXEC flag to open files in various
codepaths.

* ls/git-open-cloexec:
  read-cache: make sure file handles are not inherited by child processes
  sha1_file: open window into packfiles with O_CLOEXEC
  sha1_file: rename git_open_noatime() to git_open()
2016-10-31 13:15:21 -07:00
Anders Kaseorg 1073094f30 git-sh-setup: be explicit where to dot-source git-sh-i18n from.
d323c6b641 ("i18n: git-sh-setup.sh: mark strings for translation",
2016-06-17) started to dot-source git-sh-i18n shell script library,
assuming that $PATH is already adjusted for our scripts, namely,
$GIT_EXEC_PATH is at the beginning of $PATH.

Old contrib scripts like contrib/convert-grafts-to-replace-refs.sh
and contrib/rerere-train.sh and third-party scripts like guilt may
however be using this as ". $(git --exec-path)/git-sh-setup",
without satisfying that assumption.  Be more explicit by specifying
its path prefixed with "$(git --exec-path)/". to be safe.

While we’re here, move the sourcing of git-sh-i18n below the shell
portability fixes.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-30 16:13:49 -07:00
René Scharfe de9f7fa3b0 commit: simplify building parents list
Push pptr down into the FROM_MERGE branch of the if/else statement,
where it's actually used, and call commit_list_append() for appending
elements instead of playing tricks with commit_list_insert().  Call
copy_commit_list() in the amend branch instead of open-coding it.  Don't
bother setting pptr in the final branch as it's not used thereafter.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-30 16:03:25 -07:00
Jeff King 6d834ac8f1 doc: fix missing "::" in config list
The rebase.instructionFormat option is missing its "::" to
tell AsciiDoc that it's a list entry. As a result, the
option name gets lumped into the description in one big
paragraph.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-30 15:26:37 -07:00
Anders Kaseorg 5a5749e45b pre-receive.sample: mark it executable
For consistency with other hooks, make the sample hook executable.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-28 14:21:11 -07:00
Junio C Hamano 7805bda2ac Git 2.10.2
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJYE3auAAoJELC16IaWr+bLaxUQAKP/acM6xJ/5bT9l8cISh6Ac
 lEmOhbnQ2awPkqObk4yJKJPPzwznNsFSK4j3MlVqlGdPdFY9jHnI49QFUPNGeDnx
 ledmfH6YJHi9hln/cyqNmGvG95uszAqgYQBYthsFS7Zr2XtXp2w2YUosNWt+ghfU
 s66Vbll5X7k7KlAkxryW257D5WNtjuv2Agy1gnVZyOHOR+qHIBVc4hK6ZfjjD/4k
 yQGLP5BEFEb+4nzOVgGJ1auh4cLEtySMp0qV5tiaJG4KXitQZ5j+rLBIDMDQSGFk
 14eW+0/U0dFhqoTtF7V8KQ96ObSvCWfQh+1wRsEemspYwPF2Ahp/EvlDXdKzU+7R
 av4dSrK4K0HMa2W3LfM4tDk+ghBOrhQfib426Dp3NWKxlCXqRGtNcir7vC9AP34W
 op9zi5bR47eZAWOkBykL1zAN8ukt9oyuGog9Zrt+Ie9D7LHIgdZUBNhAYzB1u0xi
 ggkHRu3V5vAaKOTu5ULDbRfDkFPGgRNewQjozhNOcv/LJR4zYVZamPZ7C+aPtmhv
 hINdC2SrfANL2wIwjKGtFsUmzkDObuvRXuDuA6+oE+qLBHycfRiwVaFchPqw5cCa
 afO4b2qoV9m4p+I4frt9XeckLwfEytBjwEGLOMe9SAk9qvHmJrDk6sO+j80y2v3j
 IFHXRKS4bzNFYzYrEzbN
 =JIxn
 -----END PGP SIGNATURE-----

Sync with 2.10.2
2016-10-28 09:04:06 -07:00
Junio C Hamano ac84098b7e Git 2.10.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-28 09:02:44 -07:00
Junio C Hamano 020222ef4d Merge branch 'pb/test-parse-options-expect' into maint
Test clean-up.

* pb/test-parse-options-expect:
  t0040: convert all possible tests to use `test-parse-options --expect`
2016-10-28 09:01:24 -07:00
Junio C Hamano 334c2a1959 Merge branch 'jc/cocci-xstrdup-or-null' into maint
Code cleanup.

* jc/cocci-xstrdup-or-null:
  cocci: refactor common patterns to use xstrdup_or_null()
2016-10-28 09:01:23 -07:00
Junio C Hamano c8fd220175 Merge branch 'rs/cocci' into maint
Code cleanup.

* rs/cocci:
  use strbuf_add_unique_abbrev() for adding short hashes, part 3
  remove unnecessary NULL check before free(3)
  coccicheck: make transformation for strbuf_addf(sb, "...") more precise
  use strbuf_add_unique_abbrev() for adding short hashes, part 2
  use strbuf_addstr() instead of strbuf_addf() with "%s", part 2
  gitignore: ignore output files of coccicheck make target
  use strbuf_addstr() for adding constant strings to a strbuf, part 2
  add coccicheck make target
  contrib/coccinelle: fix semantic patch for oid_to_hex_r()
2016-10-28 09:01:23 -07:00
Junio C Hamano 0582a34f52 Merge branch 'jc/diff-unique-abbrev-comments' into maint
A bit more comments in a tricky code.

* jc/diff-unique-abbrev-comments:
  diff_unique_abbrev(): document its assumption and limitation
2016-10-28 09:01:23 -07:00
Junio C Hamano 4efd8e64d3 Merge branch 'rs/pretty-format-color-doc-fix' into maint
Small doc update.

* rs/pretty-format-color-doc-fix:
  pretty: fix document link for color specification
2016-10-28 09:01:23 -07:00
Junio C Hamano 9a82d8fd0b Merge branch 'js/reset-usage' into maint
Message fix-up.

* js/reset-usage:
  reset: fix usage
2016-10-28 09:01:22 -07:00
Junio C Hamano 311811b39f Merge branch 'po/fix-doc-merge-base-illustration' into maint
Some AsciiDoc formatter mishandles a displayed illustration with
tabs in it.  Adjust a few of them in merge-base documentation to
work around them.

* po/fix-doc-merge-base-illustration:
  doc: fix the 'revert a faulty merge' ASCII art tab spacing
  doc: fix merge-base ASCII art tab spacing
2016-10-28 09:01:21 -07:00
Junio C Hamano b943a213fe Merge branch 'jk/tap-verbose-fix' into maint
The Travis CI configuration we ship ran the tests with --verbose
option but this risks non-TAP output that happens to be "ok" to be
misinterpreted as TAP signalling a test that passed.  This resulted
in unnecessary failure.  This has been corrected by introducing a
new mode to run our tests in the test harness to send the verbose
output separately to the log file.

* jk/tap-verbose-fix:
  test-lib: bail out when "-v" used under "prove"
  travis: use --verbose-log test option
  test-lib: add --verbose-log option
  test-lib: handle TEST_OUTPUT_DIRECTORY with spaces
2016-10-28 09:01:21 -07:00
Junio C Hamano dce97d6ec7 Merge branch 'tg/add-chmod+x-fix' into maint
A hot-fix for a test added by a recent topic that went to both
'master' and 'maint' already.

* tg/add-chmod+x-fix:
  t3700: fix broken test under !SANITY
2016-10-28 09:01:19 -07:00
Junio C Hamano c8386962d6 Merge branch 'bw/submodule-branch-dot-doc' into maint
Recent git allows submodule.<name>.branch to use a special token
"." instead of the branch name; the documentation has been updated
to describe it.

* bw/submodule-branch-dot-doc:
  submodules doc: update documentation for "." used for submodule branches
2016-10-28 09:01:19 -07:00
Junio C Hamano 63cf124c24 Merge branch 'jk/tighten-alloc' into maint
Protect our code from over-eager compilers.

* jk/tighten-alloc:
  inline xalloc_flex() into FLEXPTR_ALLOC_MEM
  avoid pointer arithmetic involving NULL in FLEX_ALLOC_MEM
2016-10-28 09:01:18 -07:00
Junio C Hamano 39000e8499 Merge branch 'jk/fetch-quick-tag-following' into maint
When fetching from a remote that has many tags that are irrelevant
to branches we are following, we used to waste way too many cycles
when checking if the object pointed at by a tag (that we are not
going to fetch!) exists in our repository too carefully.

* jk/fetch-quick-tag-following:
  fetch: use "quick" has_sha1_file for tag following
2016-10-28 09:01:17 -07:00
Junio C Hamano 96ec83ce52 Merge branch 'jk/merge-base-fork-point-without-reflog' into maint
"git rebase" immediately after "git clone" failed to find the fork
point from the upstream.

* jk/merge-base-fork-point-without-reflog:
  merge-base: handle --fork-point without reflog
2016-10-28 09:01:17 -07:00
Junio C Hamano a5406125cc Merge branch 'dk/worktree-dup-checkout-with-bare-is-ok' into maint
In a worktree connected to a repository elsewhere, created via "git
worktree", "git checkout" attempts to protect users from confusion
by refusing to check out a branch that is already checked out in
another worktree.  However, this also prevented checking out a
branch, which is designated as the primary branch of a bare
reopsitory, in a worktree that is connected to the bare
repository.  The check has been corrected to allow it.

* dk/worktree-dup-checkout-with-bare-is-ok:
  worktree: allow the main brach of a bare repository to be checked out
2016-10-28 09:01:16 -07:00
Junio C Hamano a42539f7de Merge branch 'sb/submodule-config-doc-drop-path' into maint
The "submodule.<name>.path" stored in .gitmodules is never copied
to .git/config and such a key in .git/config has no meaning, but
the documentation described it and submodule.<name>.url next to
each other as if both belong to .git/config.  This has been fixed.

* sb/submodule-config-doc-drop-path:
  documentation: improve submodule.<name>.{url, path} description
2016-10-28 09:01:16 -07:00
Junio C Hamano 42a9c6c0e2 Merge branch 'jk/ref-symlink-loop' into maint
A stray symbolic link in $GIT_DIR/refs/ directory could make name
resolution loop forever, which has been corrected.

* jk/ref-symlink-loop:
  files_read_raw_ref: prevent infinite retry loops in general
  files_read_raw_ref: avoid infinite loop on broken symlinks
2016-10-28 09:01:15 -07:00
Junio C Hamano e2f1d2c317 Merge branch 'nd/commit-p-doc' into maint
Documentation for "git commit" was updated to clarify that "commit
-p <paths>" adds to the current contents of the index to come up
with what to commit.

* nd/commit-p-doc:
  git-commit.txt: clarify --patch mode with pathspec
2016-10-28 09:01:15 -07:00
Junio C Hamano 839b993f1f Merge branch 'jk/clone-copy-alternates-fix' into maint
"git clone" of a local repository can be done at the filesystem
level, but the codepath did not check errors while copying and
adjusting the file that lists alternate object stores.

* jk/clone-copy-alternates-fix:
  clone: detect errors in normalize_path_copy
2016-10-28 09:01:14 -07:00
Junio C Hamano 50a6f65c2d Merge branch 'dt/http-empty-auth' into maint
http.emptyauth configuration is a way to allow an empty username to
pass when attempting to authenticate using mechanisms like
Kerberos.  We took an unspecified (NULL) username and sent ":"
(i.e. no username, no password) to CURLOPT_USERPWD, but did not do
the same when the username is explicitly set to an empty string.

* dt/http-empty-auth:
  http: http.emptyauth should allow empty (not just NULL) usernames
2016-10-28 09:01:14 -07:00
Junio C Hamano c00837c48a Merge branch 'dp/autoconf-curl-ssl' into maint
The ./configure script generated from configure.ac was taught how
to detect support of SSL by libcurl better.

* dp/autoconf-curl-ssl:
  ./configure.ac: detect SSL in libcurl using curl-config
2016-10-28 09:01:13 -07:00
Junio C Hamano f98180a982 Merge branch 'ak/curl-imap-send-explicit-scheme' into maint
When we started cURL to talk to imap server when a new enough
version of cURL library is available, we forgot to explicitly add
imap(s):// before the destination.  To some folks, that didn't work
and the library tried to make HTTP(s) requests instead.

* ak/curl-imap-send-explicit-scheme:
  imap-send: Tell cURL to use imap:// or imaps://
2016-10-28 09:01:13 -07:00
Junio C Hamano 9338904a5f Merge branch 'jt/fetch-pack-in-vain-count-with-stateless' into maint
When "git fetch" tries to find where the history of the repository
it runs in has diverged from what the other side has, it has a
mechanism to avoid digging too deep into irrelevant side branches.
This however did not work well over the "smart-http" transport due
to a design bug, which has been fixed.

* jt/fetch-pack-in-vain-count-with-stateless:
  fetch-pack: do not reset in_vain on non-novel acks
2016-10-28 09:01:12 -07:00
Junio C Hamano 68eb7b1b52 Merge branch 'js/regexec-buf' into maint
A follow-up to an already graduated topic.

* js/regexec-buf:
  configure.ac: improve description of NO_REGEX test
2016-10-28 09:01:12 -07:00
Junio C Hamano 76796d424a Merge branch 'rs/c-auto-resets-attributes' into maint
When "%C(auto)" appears at the very beginning of the pretty format
string, it did not need to issue the reset sequence, but it did.
This is a small optimization to already graduated topic.

* rs/c-auto-resets-attributes:
  pretty: avoid adding reset for %C(auto) if output is empty
  pretty: let %C(auto) reset all attributes
2016-10-28 09:01:11 -07:00
Junio C Hamano 03969dff8f Merge branch 'yk/git-tag-remove-mention-of-old-layout-in-doc' into maint
Shorten description of auto-following in "git tag" by removing a
mention of historical remotes layout which is not relevant to the
main topic.

* yk/git-tag-remove-mention-of-old-layout-in-doc:
  doc: remove reference to the traditional layout in git-tag.txt
2016-10-28 09:01:10 -07:00
Stefan Christ 4259d693fc Documentation/fmt-merge-msg: fix markup in example
Use at least 4 delimiting dashes that are required for
ListingBlock to get this block rendered as verbatim text.

Signed-off-by: Stefan Christ <contact@stefanchrist.eu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-28 05:51:51 -07:00
René Scharfe 28fab7b23d valgrind: support test helpers
Tests run with --valgrind call git commands through a wrapper script
that invokes valgrind on them.  This script (valgrind.sh) is in turn
invoked through symlinks created for each command in t/valgrind/bin/.

Since e6e7530d (test helpers: move test-* to t/helper/ subdirectory)
these symlinks have been broken for test helpers -- they point to the
old locations in the root of the build directory.  Fix that by teaching
the code for creating the links about the new location of the binaries,
and do the same in the wrapper script to allow it to find its payload.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-27 23:33:53 -07:00
Junio C Hamano eda7eebe6f Getting ready for 2.11-rc0
... but not quite yet.  A few more topics to go.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-10-27 15:06:24 -07:00