Commit graph

50073 commits

Author SHA1 Message Date
Junio C Hamano 2dc69eef1b Merge branch 'ds/use-get-be64'
Code clean-up.

* ds/use-get-be64:
  packfile: use get_be64() for large offsets
2018-02-13 13:39:11 -08:00
Junio C Hamano 9238941618 Merge branch 'cc/sha1-file-name'
Code clean-up.

* cc/sha1-file-name:
  sha1_file: improve sha1_file_name() perfs
  sha1_file: remove static strbuf from sha1_file_name()
2018-02-13 13:39:10 -08:00
Junio C Hamano 3efeec3a75 Merge branch 'nd/trace-with-env'
The tracing machinery learned to report tweaking of environment
variables as well.

* nd/trace-with-env:
  run-command.c: print new cwd in trace_run_command()
  run-command.c: print env vars in trace_run_command()
  run-command.c: print program 'git' when tracing git_cmd mode
  run-command.c: introduce trace_run_command()
  trace.c: move strbuf_release() out of print_trace_line()
  trace: avoid unnecessary quoting
  sq_quote_argv: drop maxlen parameter
2018-02-13 13:39:10 -08:00
Junio C Hamano ead8dbe2e1 Merge branch 'pc/submodule-helper'
Rewrite two more "git submodule" subcommands in C.

* pc/submodule-helper:
  submodule: port submodule subcommand 'deinit' from shell to C
  submodule: port submodule subcommand 'sync' from shell to C
2018-02-13 13:39:10 -08:00
Junio C Hamano 922ffec6fe Merge branch 'rb/hashmap-h-compilation-fix'
Code clean-up.

* rb/hashmap-h-compilation-fix:
  hashmap.h: remove unused variable
2018-02-13 13:39:10 -08:00
Junio C Hamano 17c8e0b33d Merge branch 'nd/diff-flush-before-warning'
Avoid showing a warning message in the middle of a line of "git
diff" output.

* nd/diff-flush-before-warning:
  diff.c: flush stdout before printing rename warnings
2018-02-13 13:39:09 -08:00
Junio C Hamano 9bc89b17e3 Merge branch 'tb/crlf-conv-flags'
Code clean-up.

* tb/crlf-conv-flags:
  convert_to_git(): safe_crlf/checksafe becomes int conv_flags
2018-02-13 13:39:08 -08:00
Junio C Hamano 8fe806bcd5 Merge branch 'rs/describe-unique-abbrev'
Code clean-up.

* rs/describe-unique-abbrev:
  describe: use strbuf_add_unique_abbrev() for adding short hashes
2018-02-13 13:39:07 -08:00
Junio C Hamano ab5a940deb Merge branch 'ks/submodule-doc-updates'
Doc updates.

* ks/submodule-doc-updates:
  Doc/git-submodule: improve readability and grammar of a sentence
  Doc/gitsubmodules: make some changes to improve readability and syntax
2018-02-13 13:39:07 -08:00
Junio C Hamano f5536f1ce2 Merge branch 'cl/t9001-cleanup'
Test clean-up.

* cl/t9001-cleanup:
  t9001: use existing helper in send-email test
2018-02-13 13:39:07 -08:00
Junio C Hamano 867622398f Merge branch 'gs/retire-mru'
Retire mru API as it does not give enough abstraction over
underlying list API to be worth it.

* gs/retire-mru:
  mru: Replace mru.[ch] with list.h implementation
2018-02-13 13:39:06 -08:00
Junio C Hamano afc8aa3fbf Merge branch 'ot/mru-on-list'
The first step to getting rid of mru API and using the
doubly-linked list API directly instead.

* ot/mru-on-list:
  mru: use double-linked list from list.h
2018-02-13 13:39:05 -08:00
Junio C Hamano 6bed209a20 Merge branch 'jh/partial-clone'
The machinery to clone & fetch, which in turn involves packing and
unpacking objects, have been told how to omit certain objects using
the filtering mechanism introduced by the jh/object-filtering
topic, and also mark the resulting pack as a promisor pack to
tolerate missing objects, taking advantage of the mechanism
introduced by the jh/fsck-promisors topic.

* jh/partial-clone:
  t5616: test bulk prefetch after partial fetch
  fetch: inherit filter-spec from partial clone
  t5616: end-to-end tests for partial clone
  fetch-pack: restore save_commit_buffer after use
  unpack-trees: batch fetching of missing blobs
  clone: partial clone
  partial-clone: define partial clone settings in config
  fetch: support filters
  fetch: refactor calculation of remote list
  fetch-pack: test support excluding large blobs
  fetch-pack: add --no-filter
  fetch-pack, index-pack, transport: partial clone
  upload-pack: add object filtering for partial clone
2018-02-13 13:39:04 -08:00
Junio C Hamano f3d618d2bf Merge branch 'jh/fsck-promisors'
In preparation for implementing narrow/partial clone, the machinery
for checking object connectivity used by gc and fsck has been
taught that a missing object is OK when it is referenced by a
packfile specially marked as coming from trusted repository that
promises to make them available on-demand and lazily.

* jh/fsck-promisors:
  gc: do not repack promisor packfiles
  rev-list: support termination at promisor objects
  sha1_file: support lazily fetching missing objects
  introduce fetch-object: fetch one promisor object
  index-pack: refactor writing of .keep files
  fsck: support promisor objects as CLI argument
  fsck: support referenced promisor objects
  fsck: support refs pointing to promisor objects
  fsck: introduce partialclone extension
  extension.partialclone: introduce partial clone extension
2018-02-13 13:39:03 -08:00
Junio C Hamano ed1b87ef91 Merge branch 'ab/simplify-perl-makefile'
The build procedure for perl/ part has been greatly simplified by
weaning ourselves off of MakeMaker.

* ab/simplify-perl-makefile:
  perl: treat PERLLIB_EXTRA as an extra path again
  perl: avoid *.pmc and fix Error.pm further
  Makefile: replace perl/Makefile.PL with simple make rules
2018-02-13 13:39:03 -08:00
Gargi Sharma ec2dd32c70 mru: Replace mru.[ch] with list.h implementation
Replace the custom calls to mru.[ch] with calls to list.h. This patch is
the final step in removing the mru API completely and inlining the logic.
This patch leads to significant code reduction and the mru API hence, is
not a useful abstraction anymore.

Signed-off-by: Gargi Sharma <gs051095@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-24 09:52:16 -08:00
Junio C Hamano 5be1f00a9a First batch after 2.16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-23 13:21:10 -08:00
Junio C Hamano e7e80778e7 Merge branch 'nd/add-i-ignore-submodules'
"git add -p" was taught to ignore local changes to submodules as
they do not interfere with the partial addition of regular changes
anyway.

* nd/add-i-ignore-submodules:
  add--interactive: ignore submodule changes except HEAD
2018-01-23 13:16:41 -08:00
Junio C Hamano 897de845e6 Merge branch 'mm/send-email-fallback-to-local-mail-address'
Instead of maintaining home-grown email address parsing code, ship
a copy of reasonably recent Mail::Address to be used as a fallback
in 'git send-email' when the platform lacks it.

* mm/send-email-fallback-to-local-mail-address:
  send-email: add test for Linux's get_maintainer.pl
  perl/Git: remove now useless email-address parsing code
  send-email: add and use a local copy of Mail::Address
2018-01-23 13:16:41 -08:00
Junio C Hamano 93a622f4a7 Merge branch 'ab/doc-cat-file-e-still-shows-errors'
Doc update.

* ab/doc-cat-file-e-still-shows-errors:
  cat-file doc: document that -e will return some output
2018-01-23 13:16:41 -08:00
Junio C Hamano 3e25b6c66b Merge branch 'as/read-tree-prefix-doc-fix'
Doc update.

* as/read-tree-prefix-doc-fix:
  doc/read-tree: remove obsolete remark
2018-01-23 13:16:41 -08:00
Junio C Hamano 537e106422 Merge branch 'ys/bisect-object-id-missing-conversion-fix'
Fix for a commented-out code to adjust it to a rather old API change.

* ys/bisect-object-id-missing-conversion-fix:
  bisect: debug: convert struct object to object_id
2018-01-23 13:16:40 -08:00
Junio C Hamano 087d1a8e9c Merge branch 'tg/stash-with-pathspec-fix'
"git stash -- <pathspec>" incorrectly blew away untracked files in
the directory that matched the pathspec, which has been corrected.

* tg/stash-with-pathspec-fix:
  stash: don't delete untracked files that match pathspec
2018-01-23 13:16:39 -08:00
Junio C Hamano f0605836b7 Merge branch 'sb/submodule-update-reset-fix'
When resetting the working tree files recursively, the working tree
of submodules are now also reset to match.

* sb/submodule-update-reset-fix:
  submodule: submodule_move_head omits old argument in forced case
  unpack-trees: oneway_merge to update submodules
  t/lib-submodule-update.sh: fix test ignoring ignored files in submodules
  t/lib-submodule-update.sh: clarify test
2018-01-23 13:16:39 -08:00
Junio C Hamano d470b7ad00 Merge branch 'bw/oidmap-autoinit'
Code clean-up.

* bw/oidmap-autoinit:
  oidmap: ensure map is initialized
2018-01-23 13:16:39 -08:00
Junio C Hamano 5550449812 Merge branch 'ab/commit-m-with-fixup'
"git commit --fixup" did not allow "-m<message>" option to be used
at the same time; allow it to annotate resulting commit with more
text.

* ab/commit-m-with-fixup:
  commit: add support for --fixup <commit> -m"<extra message>"
  commit doc: document that -c, -C, -F and --fixup with -m error
2018-01-23 13:16:38 -08:00
Junio C Hamano 86d7fcc40a Merge branch 'cc/codespeed'
"perf" test output can be sent to codespeed server.

* cc/codespeed:
  perf/run: read GIT_PERF_REPO_NAME from perf.repoName
  perf/run: learn to send output to codespeed server
  perf/run: learn about perf.codespeedOutput
  perf/run: add conf_opts argument to get_var_from_env_or_config()
  perf/aggregate: implement codespeed JSON output
  perf/aggregate: refactor printing results
  perf/aggregate: fix checking ENV{GIT_PERF_SUBSECTION}
2018-01-23 13:16:38 -08:00
Junio C Hamano 59b43c014d Merge branch 'ab/perf-grep-threads'
More perf tests for threaded grep

* ab/perf-grep-threads:
  perf: amend the grep tests to test grep.threads
2018-01-23 13:16:37 -08:00
Junio C Hamano c0d75f0e2e Merge branch 'sb/diff-blobfind-pickaxe'
"diff" family of commands learned "--find-object=<object-id>" option
to limit the findings to changes that involve the named object.

* sb/diff-blobfind-pickaxe:
  diff: use HAS_MULTI_BITS instead of counting bits manually
  diff: properly error out when combining multiple pickaxe options
  diffcore: add a pickaxe option to find a specific blob
  diff: introduce DIFF_PICKAXE_KINDS_MASK
  diff: migrate diff_flags.pickaxe_ignore_case to a pickaxe_opts bit
  diff.h: make pickaxe_opts an unsigned bit field
2018-01-23 13:16:37 -08:00
Junio C Hamano addd37cd64 Merge branch 'jk/abort-clone-with-existing-dest'
"git clone $there $here" is allowed even when here directory exists
as long as it is an empty directory, but the command incorrectly
removed it upon a failure of the operation.

* jk/abort-clone-with-existing-dest:
  clone: do not clean up directories we didn't create
  clone: factor out dir_exists() helper
  t5600: modernize style
  t5600: fix outdated comment about unborn HEAD
2018-01-23 13:16:37 -08:00
Junio C Hamano 14b9d9aa0d Merge branch 'jc/merge-symlink-ours-theirs'
"git merge -Xours/-Xtheirs" learned to use our/their version when
resolving a conflicting updates to a symbolic link.

* jc/merge-symlink-ours-theirs:
  merge: teach -Xours/-Xtheirs to symbolic link merge
2018-01-23 13:16:37 -08:00
Junio C Hamano 0bbab7d2ab Merge branch 'rs/lose-leak-pending'
API clean-up around revision traversal.

* rs/lose-leak-pending:
  commit: remove unused function clear_commit_marks_for_object_array()
  revision: remove the unused flag leak_pending
  checkout: avoid using the rev_info flag leak_pending
  bundle: avoid using the rev_info flag leak_pending
  bisect: avoid using the rev_info flag leak_pending
  object: add clear_commit_marks_all()
  ref-filter: use clear_commit_marks_many() in do_merge_filter()
  commit: use clear_commit_marks_many() in remove_redundant()
  commit: avoid allocation in clear_commit_marks_many()
2018-01-23 13:16:36 -08:00
Junio C Hamano a713fb59e7 Merge branch 'jm/svn-pushmergeinfo-fix'
"git svn dcommit" did not take into account the fact that a
svn+ssh:// URL with a username@ (typically used for pushing) refers
to the same SVN repository without the username@ and failed when
svn.pushmergeinfo option is set.

* jm/svn-pushmergeinfo-fix:
  git-svn: fix svn.pushmergeinfo handling of svn+ssh usernames.
2018-01-23 13:16:36 -08:00
Junio C Hamano bc3dca07f4 Merge branch 'nd/ita-wt-renames-in-status'
"git status" after moving a path in the working tree (hence making
it appear "removed") and then adding with the -N option (hence
making that appear "added") detected it as a rename, but did not
report the  old and new pathnames correctly.

* nd/ita-wt-renames-in-status:
  wt-status.c: handle worktree renames
  wt-status.c: rename rename-related fields in wt_status_change_data
  wt-status.c: catch unhandled diff status codes
  wt-status.c: coding style fix
  Use DIFF_DETECT_RENAME for detect_rename assignments
  t2203: test status output with porcelain v2 format
2018-01-23 13:16:28 -08:00
Junio C Hamano fac64e011f Merge branch 'dk/describe-all-output-fix'
An old regression in "git describe --all $annotated_tag^0" has been
fixed.

* dk/describe-all-output-fix:
  describe: prepend "tags/" when describing tags with embedded name
2018-01-23 13:16:28 -08:00
Junio C Hamano 59c276cf4d Sync with v2.16.1
* maint:
  Git 2.16.1
  t5601-clone: test case-conflicting files on case-insensitive filesystem
  repository: pre-initialize hash algo pointer
2018-01-21 21:14:54 -08:00
Junio C Hamano 8279ed033f Git 2.16.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-21 21:14:25 -08:00
Junio C Hamano 298d861208 Start 2.17 cycle
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-21 21:14:09 -08:00
Junio C Hamano ea7b5de1c1 Merge branch 'bc/hash-algo' into maint
* bc/hash-algo:
  t5601-clone: test case-conflicting files on case-insensitive filesystem
  repository: pre-initialize hash algo pointer
2018-01-21 21:12:37 -08:00
Eric Sunshine b6947af229 t5601-clone: test case-conflicting files on case-insensitive filesystem
A recently introduced regression caused a segfault at clone time on
case-insensitive filesystems when filenames differing only in case are
present. This bug has already been fixed (repository: pre-initialize
hash algo pointer, 2018-01-18), but it's not the first time similar
problems have arisen. Therefore, introduce a test to catch this case and
protect against future regressions.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-21 21:12:17 -08:00
brian m. carlson e26f7f19b6 repository: pre-initialize hash algo pointer
There are various git subcommands (among them, clone) which don't set up
the repository (that is, they lack RUN_SETUP or RUN_SETUP_GENTLY) but
end up needing to have information about the hash algorithm in use.
Because the hash algorithm is part of struct repository and it's only
initialized in repository setup, we can end up dereferencing a NULL
pointer in some cases if we call one of these subcommands and look up
the empty blob or empty tree values.

A "git clone" of a project that has two paths that differ only in
case suffers from this if it is run on a case insensitive platform.
When the command attempts to check out one of these two paths after
checking out the other one, the checkout codepath needs to see if
the version that is already on the filesystem (which should not
happen if the FS were case sensitive) is dirty, and it needs to
exercise the hashing code at that point.

In the future, we can add a command line option for this or read it
from the configuration, but until we're ready to expose that
functionality to the user, simply initialize the repository
structure to use the current hash algorithm, SHA-1.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-19 14:23:32 -08:00
Christian Couder 3449847168 sha1_file: improve sha1_file_name() perfs
As sha1_file_name() could be performance sensitive, let's
make it faster by using strbuf_addstr() and strbuf_addc()
instead of strbuf_addf().

Helped-by: Derrick Stolee <stolee@gmail.com>
Helped-by: Jeff Hostetler <git@jeffhostetler.com>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-19 13:21:49 -08:00
Derrick Stolee ad622a256f packfile: use get_be64() for large offsets
The pack-index version 2 format uses two 4-byte integers in
network-byte order to represent one 8-byte value. The current
implementation has several code clones for stitching these integers
together.

Use get_be64() to create an 8-byte integer from two 4-byte integers
represented this way.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-19 11:04:56 -08:00
Nguyễn Thái Ngọc Duy 090a09272a run-command.c: print new cwd in trace_run_command()
If a command sets a new env variable GIT_DIR=.git, we need more context
to know where that '.git' is related to.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-19 10:49:20 -08:00
Nguyễn Thái Ngọc Duy c61a975df1 run-command.c: print env vars in trace_run_command()
Occasionally submodule code could execute new commands with GIT_DIR set
to some submodule. GIT_TRACE prints just the command line which makes it
hard to tell that it's not really executed on this repository.

Print the env delta (compared to parent environment) in this case.

Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-19 10:49:20 -08:00
Nguyễn Thái Ngọc Duy 21dfc5e08f run-command.c: print program 'git' when tracing git_cmd mode
We normally print full command line, including the program and its
argument. When git_cmd is set, we have a special code path to run the
right "git" program and child_process.argv[0] will not contain the
program name anymore. As a result, we print just the command
arguments.

I thought it was a regression when the code was refactored and git_cmd
added, but apparently it's not. git_cmd mode was introduced before
tracing was added in 8852f5d704 (run_command(): respect GIT_TRACE -
2008-07-07) so it's more like an oversight in 8852f5d704.

Fix it, print the program name "git" in git_cmd mode. It's nice to have
now. But it will be more important later when we start to print env
variables too, in shell syntax. The lack of a program name would look
confusing then.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-19 10:49:20 -08:00
Nguyễn Thái Ngọc Duy e73dd78699 run-command.c: introduce trace_run_command()
This is the same as the old code that uses trace_argv_printf() in
run-command.c. This function will be improved in later patches to
print more information from struct child_process.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-19 10:49:20 -08:00
Junio C Hamano 2512f15446 Git 2.16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-17 13:06:51 -08:00
Christian Couder ea6577303f sha1_file: remove static strbuf from sha1_file_name()
Using a static buffer in sha1_file_name() is error prone
and the performance improvements it gives are not needed
in many of the callers.

So let's get rid of this static buffer and, if necessary
or helpful, let's use one in the caller.

Suggested-by: Jeff Hostetler <git@jeffhostetler.com>
Helped-by: Kevin Daudt <me@ikke.info>
Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-01-17 12:21:32 -08:00
Junio C Hamano e0d575025a l10n for Git 2.16.0 round 2
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJaXL0xAAoJEMek6Rt1RHooLqEQAKGM08R7sWxLR1rc+O/DX/LR
 R+ea+jGXe9Fy88d4zRj4+Dw+PxAxR/gNvGlRMppO/Ig4VuUAjaloCQiDpmttxX3l
 oEX2FKF/Fy2VI2QXoYH7KF1+aHtE/XHfWkndHNexjXYGCq/uHTPQe+kHf8b+h5S/
 rUsCx6U6fvXoWJaGQbXgywI/aCAq/dEAdw0wbWyhNxpeTuQnIuZpeZ9mhArKeN+k
 2daVMD8H9rTDrxMiqybPXbYJwSjyBVgRMwSLUv79GE+KD1G79yTLjbTJsfnjpKIj
 PHF9IgmRdrjppGXlU3MDfaFY14CzX8LxHCFUA+fVYPI/m/0UN57cfi8yOMfiAhEs
 fGc7LU5dt6vOr4n/S3nULPJlfPujLK/hsPAfvmgh6wKECVOs/lcXpjlnnC5YcflG
 jb5B1YpmxsA6aoCgQC5HR3cx6ox6oOnCeEucH/Xg/uYoG0wOB2P5f5R4/Lfj0rfy
 vshZlmQXmbDUvTKrzz3fYaiPqSelmibrlk+ihzsoV7KbvH907G1xcU2RTVSvmrUt
 kVTaqJMoDcRvp0RkT/uZHEfJJHNdoMyuDOhCLtxQ2R6xCe+sW4KZwe//ngju11iO
 4E6730hGmjBcFhE03gdY84ojD9hgEzgwGIdN53h+1y9RF8v5kiN7NZwM4lCsA6Ag
 IbNLQ4V7LIPW64yRZoht
 =Dbk1
 -----END PGP SIGNATURE-----

Merge tag 'l10n-2.16.0-rnd2' of git://github.com/git-l10n/git-po

l10n for Git 2.16.0 round 2

* tag 'l10n-2.16.0-rnd2' of git://github.com/git-l10n/git-po: (24 commits)
  l10n: de.po: translate 72 new messages
  l10n: de.po: improve messages when a branch starts to track another ref
  l10n: bg.po: Updated Bulgarian translation (3288t)
  l10n: TEAMS: add zh_CN team members
  l10n: zh_CN: for git v2.16.0 l10n round 2
  l10n: sv.po: Update Swedish translation (3288t0f0u)
  l10n: ru.po: update Russian translation
  l10n: TEAMS: Add ko team members
  l10n: ko.po: Update Korean translation
  l10n: fr.po 2.16 round 2
  l10n: es.po: Spanish translation 2.16.0 round 2
  l10n: vi.po(3288t): Updated Vietnamese translation for v2.16.0 round 2
  l10n: git.pot: v2.16.0 round 2 (8 new, 4 removed)
  l10n: es.po: Update Spanish Translation v2.16.0
  l10n: fr.po v2.16.0 round 1
  l10n: bg.po: Updated Bulgarian translation (3284t)
  l10n: sv.po: Update Swedish translation (3284t0f0u)
  l10n: fr.po: "worktree list" mistranslated as prune
  l10n: git.pot: v2.16.0 round 1 (64 new, 25 removed)
  l10n: fixes to German translation
  ...
2018-01-16 14:49:58 -08:00