1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-31 22:37:54 +01:00
Commit graph

49376 commits

Author SHA1 Message Date
Junio C Hamano
093048b229 Merge branch 'js/for-each-ref-remote-name-and-ref'
The "--format=..." option "git for-each-ref" takes learned to show
the name of the 'remote' repository and the ref at the remote side
that is affected for 'upstream' and 'push' via "%(push:remotename)"
and friends.

* js/for-each-ref-remote-name-and-ref:
  for-each-ref: test :remotename and :remoteref
  for-each-ref: let upstream/push report the remote ref name
  for-each-ref: let upstream/push optionally report the remote name
2017-11-15 12:14:32 +09:00
Junio C Hamano
1eb2bd939a Merge branch 'jt/submodule-tests-cleanup'
* jt/submodule-tests-cleanup:
  Tests: clean up and document submodule helpers
2017-11-15 12:14:31 +09:00
Junio C Hamano
563b0610d6 Merge branch 'cc/git-packet-pm'
Parts of a test to drive the long-running content filter interface
has been split into its own module, hopefully to eventually become
reusable.

* cc/git-packet-pm:
  Git/Packet.pm: extract parts of t0021/rot13-filter.pl for reuse
  t0021/rot13-filter: add capability functions
  t0021/rot13-filter: refactor checking final lf
  t0021/rot13-filter: add packet_initialize()
  t0021/rot13-filter: improve error message
  t0021/rot13-filter: improve 'if .. elsif .. else' style
  t0021/rot13-filter: refactor packet reading functions
  t0021/rot13-filter: fix list comparison
2017-11-15 12:14:31 +09:00
Junio C Hamano
b50d82b00a Merge branch 'bw/rebase-i-ignored-submodule-fix'
"git rebase -i" recently started misbehaving when a submodule that
is configured with 'submodule.<name>.ignore' is dirty; this has
been corrected.

* bw/rebase-i-ignored-submodule-fix:
  wt-status: actually ignore submodules when requested
2017-11-15 12:14:30 +09:00
Junio C Hamano
a97222978a Merge branch 'mh/tidy-ref-update-flags'
Code clean-up in refs API implementation.

* mh/tidy-ref-update-flags:
  refs: update some more docs to use "oid" rather than "sha1"
  write_packed_entry(): take `object_id` arguments
  refs: rename constant `REF_ISPRUNING` to `REF_IS_PRUNING`
  refs: rename constant `REF_NODEREF` to `REF_NO_DEREF`
  refs: tidy up and adjust visibility of the `ref_update` flags
  ref_transaction_add_update(): remove a check
  ref_transaction_update(): die on disallowed flags
  prune_ref(): call `ref_transaction_add_update()` directly
  files_transaction_prepare(): don't leak flags to packed transaction
2017-11-15 12:14:29 +09:00
Junio C Hamano
61f68f6073 Merge branch 'sr/wrapper-quote-filenames'
Some error messages did not quote filenames shown in it, which have
been fixed.

* sr/wrapper-quote-filenames:
  wrapper.c: consistently quote filenames in error messages
2017-11-15 12:14:29 +09:00
Junio C Hamano
f116163171 Merge branch 'ma/bisect-leakfix'
Leak fixes.

* ma/bisect-leakfix:
  bisect: fix memory leak when returning best element
  bisect: fix off-by-one error in `best_bisection_sorted()`
  bisect: fix memory leak in `find_bisection()`
  bisect: change calling-convention of `find_bisection()`
2017-11-15 12:14:28 +09:00
Junio C Hamano
6fa1f6f16f Merge branch 'rs/sequencer-rewrite-file-cleanup'
Code cleanup.

* rs/sequencer-rewrite-file-cleanup:
  sequencer.c: check return value of close() in rewrite_file()
  sequencer: use O_TRUNC to truncate files
  sequencer: factor out rewrite_file()
2017-11-15 12:14:28 +09:00
Junio C Hamano
a6ee796aa8 Merge branch 'ao/merge-verbosity-getenv-just-once'
Code cleanup.

* ao/merge-verbosity-getenv-just-once:
  merge-recursive: check GIT_MERGE_VERBOSITY only once
2017-11-15 12:14:28 +09:00
Junio C Hamano
ffb0b5762e Merge branch 'mh/avoid-rewriting-packed-refs'
Recent update to the refs infrastructure implementation started
rewriting packed-refs file more often than before; this has been
optimized again for most trivial cases.

* mh/avoid-rewriting-packed-refs:
  files-backend: don't rewrite the `packed-refs` file unnecessarily
  t1409: check that `packed-refs` is not rewritten unnecessarily
2017-11-15 12:14:27 +09:00
Junio C Hamano
d4a5de7bde Merge branch 'rs/imap-send-next-arg-fix'
Error checking in "git imap-send" for empty response has been
improved.

* rs/imap-send-next-arg-fix:
  imap-send: handle missing response codes gracefully
  imap-send: handle NULL return of next_arg()
2017-11-15 12:14:26 +09:00
Junio C Hamano
fcaba62192 Merge branch 'ab/mediawiki-name-truncation'
The remote-helper for talking to MediaWiki has been updated to
truncate an overlong pagename so that ".mw" suffix can still be
added.

* ab/mediawiki-name-truncation:
  remote-mediawiki: limit filenames to legal
2017-11-15 12:14:26 +09:00
Junio C Hamano
d8df70f273 Merge branch 'jm/status-ignored-files-list'
The set of paths output from "git status --ignored" was tied
closely with its "--untracked=<mode>" option, but now it can be
controlled more flexibly.  Most notably, a directory that is
ignored because it is listed to be ignored in the ignore/exclude
mechanism can be handled differently from a directory that ends up
to be ignored only because all files in it are ignored.

* jm/status-ignored-files-list:
  status: test ignored modes
  status: document options to show matching ignored files
  status: report matching ignored and normal untracked
  status: add option to show ignored files differently
2017-11-13 14:44:59 +09:00
Junio C Hamano
4123bcaed0 RelNotes: the third batch for 2.16
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-09 14:36:39 +09:00
Junio C Hamano
421f21c98f Merge branch 'js/mingw-redirect-std-handles'
MinGW updates.

* js/mingw-redirect-std-handles:
  mingw: document the standard handle redirection
  mingw: optionally redirect stderr/stdout via the same handle
  mingw: add experimental feature to redirect standard handles
2017-11-09 14:31:31 +09:00
Junio C Hamano
55b5d92092 Merge branch 'js/wincred-empty-cred'
MinGW updates.

* js/wincred-empty-cred:
  wincred: handle empty username/password correctly
  t0302: check helper can handle empty credentials
2017-11-09 14:31:31 +09:00
Junio C Hamano
d3e32dc90c Merge branch 'js/mingw-full-version-in-resources'
MinGW updates.

* js/mingw-full-version-in-resources:
  mingw: include the full version information in the resources
2017-11-09 14:31:31 +09:00
Junio C Hamano
906329f369 Merge branch 'dk/libsecret-unlock-to-load-fix'
The credential helper for libsecret (in contrib/) has been improved
to allow possibly prompting the end user to unlock secrets that are
currently locked (otherwise the secrets may not be loaded).

* dk/libsecret-unlock-to-load-fix:
  credential-libsecret: unlock locked secrets
2017-11-09 14:31:30 +09:00
Junio C Hamano
c90766c4f1 Merge branch 'ks/mailmap'
* ks/mailmap:
  mailmap: use Kaartic Sivaraam's new address
2017-11-09 14:31:29 +09:00
Junio C Hamano
57dd3dd287 Merge branch 'js/early-config'
Correct start-up sequence so that a repository could be placed
immediately under the root directory again (which was broken at
around Git 2.13).

* js/early-config:
  setup: avoid double slashes when looking for HEAD
2017-11-09 14:31:29 +09:00
Junio C Hamano
487a05f465 Merge branch 'sg/travis-fixes'
TravisCI build updates.

* sg/travis-fixes:
  travis-ci: don't build Git for the static analysis job
  travis-ci: fix running P4 and Git LFS tests in Linux build jobs
2017-11-09 14:31:28 +09:00
Junio C Hamano
8cc633286a Merge branch 'bw/diff-opt-impl-to-bitfields'
A single-word "unsigned flags" in the diff options is being split
into a structure with many bitfields.

* bw/diff-opt-impl-to-bitfields:
  diff: make struct diff_flags members lowercase
  diff: remove DIFF_OPT_CLR macro
  diff: remove DIFF_OPT_SET macro
  diff: remove DIFF_OPT_TST macro
  diff: remove touched flags
  diff: add flag to indicate textconv was set via cmdline
  diff: convert flags to be stored in bitfields
  add, reset: use DIFF_OPT_SET macro to set a diff flag
2017-11-09 14:31:27 +09:00
Junio C Hamano
bde1370010 Merge branch 'rs/hex-to-bytes-cleanup'
Code cleanup.

* rs/hex-to-bytes-cleanup:
  sha1_file: use hex_to_bytes()
  http-push: use hex_to_bytes()
  notes: move hex_to_bytes() to hex.c and export it
2017-11-09 14:31:27 +09:00
Junio C Hamano
b169d18768 Merge branch 'ad/5580-unc-tests-on-cygwin'
UNC paths are also relevant in Cygwin builds and they are now
tested just like Mingw builds.

* ad/5580-unc-tests-on-cygwin:
  t5580: add Cygwin support
2017-11-09 14:31:27 +09:00
Junio C Hamano
4e9762ed47 Merge branch 'ao/diff-populate-filespec-lstat-errorpath-fix'
After an error from lstat(), diff_populate_filespec() function
sometimes still went ahead and used invalid data in struct stat,
which has been fixed.

* ao/diff-populate-filespec-lstat-errorpath-fix:
  diff: fix lstat() error handling in diff_populate_filespec()
2017-11-09 14:31:26 +09:00
Junio C Hamano
4da9f598e6 Merge branch 'sb/blame-config-doc'
Description of blame.{showroot,blankboundary,showemail,date}
configuration variables have been added to "git config --help".

* sb/blame-config-doc:
  config: document blame configuration
2017-11-09 14:31:25 +09:00
Junio C Hamano
5ee882da53 Merge branch 'jm/relnotes-2.15-typofix'
Typofix.

* jm/relnotes-2.15-typofix:
  fix typos in 2.15.0 release notes
2017-11-09 14:31:25 +09:00
Johannes Schindelin
1b586867db for-each-ref: test :remotename and :remoteref
This not only prevents regressions, but also serves as documentation
what this new feature is expected to do.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-08 10:18:23 +09:00
J Wyman
9700fae5ee for-each-ref: let upstream/push report the remote ref name
There are times when scripts want to know not only the name of the
push branch on the remote, but also the name of the branch as known
by the remote repository.

An example of this is when a tool wants to push to the very same branch
from which it would pull automatically, i.e. the `<remote>` and the `<to>`
in `git push <remote> <from>:<to>` would be provided by
`%(upstream:remotename)` and `%(upstream:remoteref)`, respectively.

This patch offers the new suffix :remoteref for the `upstream` and `push`
atoms, allowing to show exactly that. Example:

	$ cat .git/config
	...
	[remote "origin"]
		url = https://where.do.we.come/from
		fetch = refs/heads/*:refs/remote/origin/*
	[branch "master"]
		remote = origin
		merge = refs/heads/master
	[branch "develop/with/topics"]
		remote = origin
		merge = refs/heads/develop/with/topics
	...

	$ git for-each-ref \
		--format='%(push) %(push:remoteref)' \
		refs/heads
	refs/remotes/origin/master refs/heads/master
	refs/remotes/origin/develop/with/topics refs/heads/develop/with/topics

Signed-off-by: J Wyman <jwyman@microsoft.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-08 10:18:23 +09:00
Jonathan Tan
d3b5a4974d Tests: clean up and document submodule helpers
Factor out the commonalities from test_submodule_switch() and
test_submodule_forced_switch() in lib-submodule-update.sh, and document
their usage.

This also makes explicit (through the KNOWN_FAILURE_FORCED_SWITCH_TESTS
variable) the fact that, currently, all functionality tested using
test_submodule_forced_switch() do not correctly handle the situation in
which a submodule is replaced with an ordinary directory.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-08 10:05:39 +09:00
Brandon Williams
c6d8ccf3a2 wt-status: actually ignore submodules when requested
Since ff6f1f564 (submodule-config: lazy-load a repository's .gitmodules
file, 2017-08-03) rebase interactive fails if there are any submodules
with unstaged changes which have been configured with a value for
'submodule.<name>.ignore' in the repository's config.

This is due to how configured values of 'submodule.<name>.ignore' are
handled in addition to a change in how the submodule config is loaded.
When the diff machinery hits a submodule (gitlink as well as a
corresponding entry in the submodule subsystem) it will read the value
of 'submodule.<name>.ignore' stored in the repository's config and if
the config is present it will clear the 'IGNORE_SUBMODULES' (which is
the flag explicitly requested by rebase interactive),
'IGNORE_UNTRACKED_IN_SUBMODULES', and 'IGNORE_DIRTY_SUBMODULES' diff
flags and then set one of them based on the configured value.

Historically this wasn't a problem because the submodule subsystem
wasn't initialized because the .gitmodules file wasn't explicitly loaded
by the rebase interactive command.  So when the diff machinery hit a
submodule it would skip over reading any configured values of
'submodule.<name>.ignore'.

In order to preserve the behavior of submodules being ignored by rebase
interactive, also set the 'OVERRIDE_SUBMODULE_CONFIG' diff flag when
submodules are requested to be ignored when checking for unstaged
changes.

Reported-by: Orgad Shaneh <orgads@gmail.com>
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-07 11:20:55 +09:00
Christian Couder
0fe8d516bb Git/Packet.pm: extract parts of t0021/rot13-filter.pl for reuse
And while at it let's simplify t0021/rot13-filter.pl by
using Git/Packet.pm.

This will make it possible to reuse packet related
functions in other test scripts.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-07 10:26:01 +09:00
Christian Couder
f11c8ce1f6 t0021/rot13-filter: add capability functions
These function help read and write capabilities.

To make them more generic and make it easy to reuse them,
the following changes are made:

- we don't require capabilities to come in a fixed order,
- we allow duplicates,
- we check that the remote supports the capabilities we
  advertise,
- we don't check if the remote declares any capability we
  don't know about.

The reason behind the last change is that the protocol
should work using only the capabilities that both ends
support, and it should not stop working if one end starts
to advertise a new capability.

Despite those changes, we can still require a set of
capabilities, and die if one of them is not supported.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-07 09:54:41 +09:00
Christian Couder
4a9ef1bbc1 t0021/rot13-filter: refactor checking final lf
As checking for a lf character at the end of a buffer
will be useful in another function, let's refactor this
functionality into a small remove_final_lf_or_die()
helper function.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-07 09:54:41 +09:00
Christian Couder
25cbfe3465 t0021/rot13-filter: add packet_initialize()
Let's refactor the code to initialize communication into its own
packet_initialize() function, so that we can reuse this
functionality in following patches.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-07 09:54:41 +09:00
Christian Couder
00df039faa t0021/rot13-filter: improve error message
If there is no new line at the end of something it receives,
the packet_txt_read() function die()s, but it's difficult to
debug without much context.

Let's give a bit more information when that happens.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-07 09:54:41 +09:00
Christian Couder
ed17d26245 t0021/rot13-filter: improve 'if .. elsif .. else' style
Before further refactoring the "t0021/rot13-filter.pl" script,
let's modernize the style of its 'if .. elsif .. else' clauses
to improve its readability by making it more similar to our
other perl scripts.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-07 09:54:41 +09:00
Christian Couder
2c9ea595a7 t0021/rot13-filter: refactor packet reading functions
To make it possible in a following commit to move packet
reading and writing functions into a Packet.pm module,
let's refactor these functions, so they don't handle
printing debug output and exiting.

While at it let's create packet_required_key_val_read()
to still handle erroring out in a common case.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-07 09:54:41 +09:00
Christian Couder
0a26882621 t0021/rot13-filter: fix list comparison
Since edcc8581 ("convert: add filter.<driver>.process
option", 2016-10-16) when t0021/rot13-filter.pl was created, list
comparison in this perl script have been quite broken.

packet_txt_read() returns a 2-element list, and the right hand
side of "eq" also has a list with (two, elements), but "eq" takes
the last element of the list on each side, and compares them. The
first elements (0 or 1) on the right hand side lists do not matter,
which means we do not require to see a flush at the end of the
version -- a simple empty string or an EOF would do, which is
definitely not what we want.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-07 09:54:41 +09:00
Junio C Hamano
7668cbc605 RelNotes: the second batch post 2.15 comes
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-11-06 14:31:16 +09:00
Junio C Hamano
40f1293530 Merge branch 'tg/deprecate-stash-save'
"git stash save" has been deprecated in favour of "git stash push".

* tg/deprecate-stash-save:
  stash: remove now superfluos help for "stash push"
  stash: mark "git stash save" deprecated in the man page
  stash: replace "git stash save" with "git stash push" in the documentation
2017-11-06 14:24:32 +09:00
Junio C Hamano
30af513004 Merge branch 'tb/complete-checkout'
Command line completion (in contrib/) update.

* tb/complete-checkout:
  completion: add remaining flags to checkout
2017-11-06 14:24:31 +09:00
Junio C Hamano
9c958d6906 Merge branch 'gc/gitweb-filetest-acl'
"gitweb" checks if a directory is searchable with Perl's "-x"
operator, which can be enhanced by using "filetest 'access'"
pragma, which now we do.

* gc/gitweb-filetest-acl:
  gitweb: use filetest to allow ACLs
2017-11-06 14:24:30 +09:00
Junio C Hamano
c692fe2c1e Merge branch 'mp/push-pushoption-config'
The "--push-option=<string>" option to "git push" now defaults to a
list of strings configured via push.pushOption variable.

* mp/push-pushoption-config:
  builtin/push.c: add push.pushOption config
2017-11-06 14:24:30 +09:00
Junio C Hamano
b4d658b501 Merge branch 'hv/fetch-moved-submodules-on-demand'
"git fetch --recurse-submodules" now knows that submodules can be
moved around in the superproject in addition to getting updated,
and finds the ones that need to be fetched accordingly.

* hv/fetch-moved-submodules-on-demand:
  submodule: simplify decision tree whether to or not to fetch
  implement fetching of moved submodules
  fetch: add test to make sure we stay backwards compatible
2017-11-06 14:24:29 +09:00
Junio C Hamano
5a74ce22e6 Merge branch 'jc/check-ref-format-oor'
"git check-ref-format --branch @{-1}" bit a "BUG()" when run
outside a repository for obvious reasons; clarify the documentation
and make sure we do not even try to expand the at-mark magic in
such a case, but still call the validation logic for branch names.

* jc/check-ref-format-oor:
  check-ref-format doc: --branch validates and expands <branch>
  check-ref-format --branch: strip refs/heads/ using skip_prefix
  check-ref-format --branch: do not expand @{...} outside repository
2017-11-06 14:24:28 +09:00
Junio C Hamano
f113d4bc79 Merge branch 'jc/t5601-copy-workaround'
A (possibly flakey) test fix.

* jc/t5601-copy-workaround:
  t5601: rm the target file of cp that could still be executing
2017-11-06 14:24:27 +09:00
Junio C Hamano
e7e456f500 Merge branch 'bc/object-id'
Conversion from uchar[20] to struct object_id continues.

* bc/object-id: (25 commits)
  refs/files-backend: convert static functions to object_id
  refs: convert read_raw_ref backends to struct object_id
  refs: convert peel_object to struct object_id
  refs: convert resolve_ref_unsafe to struct object_id
  worktree: convert struct worktree to object_id
  refs: convert resolve_gitlink_ref to struct object_id
  Convert remaining callers of resolve_gitlink_ref to object_id
  sha1_file: convert index_path and index_fd to struct object_id
  refs: convert reflog_expire parameter to struct object_id
  refs: convert read_ref_at to struct object_id
  refs: convert peel_ref to struct object_id
  builtin/pack-objects: convert to struct object_id
  pack-bitmap: convert traverse_bitmap_commit_list to object_id
  refs: convert dwim_log to struct object_id
  builtin/reflog: convert remaining unsigned char uses to object_id
  refs: convert dwim_ref and expand_ref to struct object_id
  refs: convert read_ref and read_ref_full to object_id
  refs: convert resolve_refdup and refs_resolve_refdup to struct object_id
  Convert check_connected to use struct object_id
  refs: update ref transactions to use struct object_id
  ...
2017-11-06 14:24:27 +09:00
Junio C Hamano
f4c214b529 Merge branch 'jk/revision-pruning-optim'
Pathspec-limited revision traversal was taught not to keep finding
unneeded differences once it knows two trees are different inside
given pathspec.

* jk/revision-pruning-optim:
  revision: quit pruning diff more quickly when possible
2017-11-06 14:24:26 +09:00
Junio C Hamano
cb52b49db5 Merge branch 'ds/find-unique-abbrev-optim'
Optimize the code to find shortest unique prefix of object names.

* ds/find-unique-abbrev-optim:
  sha1_name: minimize OID comparisons during disambiguation
  sha1_name: parse less while finding common prefix
  sha1_name: unroll len loop in find_unique_abbrev_r()
  p4211-line-log.sh: add log --online --raw --parents perf test
2017-11-06 14:24:25 +09:00