git
4 years agoMerge branch 'am/mingw-poll-fix'
Junio C Hamano [Mon, 9 Mar 2020 18:21:20 +0000 (11:21 -0700)] 
Merge branch 'am/mingw-poll-fix'

MinGW's poll() emulation has been improved.

* am/mingw-poll-fix:
  mingw: workaround for hangs when sending STDIN

4 years agoMerge branch 'en/test-cleanup'
Junio C Hamano [Mon, 9 Mar 2020 18:21:20 +0000 (11:21 -0700)] 
Merge branch 'en/test-cleanup'

Test cleanup.

* en/test-cleanup:
  t6020: new test with interleaved lexicographic ordering of directories
  t6022, t6046: test expected behavior instead of testing a proxy for it
  t3035: prefer test_must_fail to bash negation for git commands
  t6020, t6022, t6035: update merge tests to use test helper functions
  t602[1236], t6034: modernize test formatting

4 years agoMerge branch 'en/merge-path-collision'
Junio C Hamano [Mon, 9 Mar 2020 18:21:20 +0000 (11:21 -0700)] 
Merge branch 'en/merge-path-collision'

Handling of conflicting renames in merge-recursive have further
been made consistent with how existing codepaths try to mimic what
is done to add/add conflicts.

* en/merge-path-collision:
  merge-recursive: apply collision handling unification to recursive case

4 years agoMerge branch 'kk/complete-diff-color-moved'
Junio C Hamano [Mon, 9 Mar 2020 18:21:20 +0000 (11:21 -0700)] 
Merge branch 'kk/complete-diff-color-moved'

Completion update.

* kk/complete-diff-color-moved:
  completion: add diff --color-moved[-ws]

4 years agoMerge branch 'rj/t1050-use-test-path-is-file'
Junio C Hamano [Mon, 9 Mar 2020 18:21:19 +0000 (11:21 -0700)] 
Merge branch 'rj/t1050-use-test-path-is-file'

Code cleanup.

* rj/t1050-use-test-path-is-file:
  t1050: replace test -f with test_path_is_file

4 years agoMerge branch 'pb/am-show-current-patch'
Junio C Hamano [Mon, 9 Mar 2020 18:21:19 +0000 (11:21 -0700)] 
Merge branch 'pb/am-show-current-patch'

"git am --short-current-patch" is a way to show the piece of e-mail
for the stopped step, which is not suitable to directly feed "git
apply" (it is designed to be a good "git am" input).  It learned a
new option to show only the patch part.

* pb/am-show-current-patch:
  am: support --show-current-patch=diff to retrieve .git/rebase-apply/patch
  am: support --show-current-patch=raw as a synonym for--show-current-patch
  am: convert "resume" variable to a struct
  parse-options: convert "command mode" to a flag
  parse-options: add testcases for OPT_CMDMODE()

4 years agoMerge branch 'am/pathspec-f-f-more'
Junio C Hamano [Mon, 9 Mar 2020 18:21:19 +0000 (11:21 -0700)] 
Merge branch 'am/pathspec-f-f-more'

"git rm" and "git stash" learns the new "--pathspec-from-file"
option.

* am/pathspec-f-f-more:
  stash push: support the --pathspec-from-file option
  stash: eliminate crude option parsing
  doc: stash: synchronize <pathspec> description
  doc: stash: document more options
  doc: stash: split options from description (2)
  doc: stash: split options from description (1)
  rm: support the --pathspec-from-file option
  doc: rm: synchronize <pathspec> description

4 years agoGit 2.26-rc0 v2.26.0-rc0
Junio C Hamano [Thu, 5 Mar 2020 19:15:45 +0000 (11:15 -0800)] 
Git 2.26-rc0

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5537: adjust test_oid label
Johannes Schindelin [Wed, 4 Mar 2020 15:53:12 +0000 (15:53 +0000)] 
t5537: adjust test_oid label

We recently switched to using Perl instead of `sed` in the httpd-based
tests. Let's reflect that in the label we give the corresponding commit
hashes.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'hi/gpg-use-check-signature'
Junio C Hamano [Thu, 5 Mar 2020 18:43:05 +0000 (10:43 -0800)] 
Merge branch 'hi/gpg-use-check-signature'

"git merge signed-tag" while lacking the public key started to say
"No signature", which was utterly wrong.  This regression has been
reverted.

* hi/gpg-use-check-signature:
  Revert "gpg-interface: prefer check_signature() for GPG verification"

4 years agoMerge branch 'rs/commit-graph-code-simplification'
Junio C Hamano [Thu, 5 Mar 2020 18:43:04 +0000 (10:43 -0800)] 
Merge branch 'rs/commit-graph-code-simplification'

Code simplfication.

* rs/commit-graph-code-simplification:
  commit-graph: use progress title directly

4 years agoMerge branch 'js/ci-windows-update'
Junio C Hamano [Thu, 5 Mar 2020 18:43:04 +0000 (10:43 -0800)] 
Merge branch 'js/ci-windows-update'

Updates to the CI settings.

* js/ci-windows-update:
  Azure Pipeline: switch to the latest agent pools
  ci: prevent `perforce` from being quarantined
  t/lib-httpd: avoid using macOS' sed

4 years agoMerge branch 'be/describe-multiroot'
Junio C Hamano [Thu, 5 Mar 2020 18:43:04 +0000 (10:43 -0800)] 
Merge branch 'be/describe-multiroot'

"git describe" in a repository with multiple root commits sometimes
gave up looking for the best tag to describe a given commit with
too early, which has been adjusted.

* be/describe-multiroot:
  describe: don't abort too early when searching tags

4 years agoMerge branch 'ag/rebase-remove-redundant-code'
Junio C Hamano [Thu, 5 Mar 2020 18:43:04 +0000 (10:43 -0800)] 
Merge branch 'ag/rebase-remove-redundant-code'

Code reduction.

* ag/rebase-remove-redundant-code:
  builtin/rebase: remove a call to get_oid() on `options.switch_to'

4 years agoMerge branch 'es/recursive-single-branch-clone'
Junio C Hamano [Thu, 5 Mar 2020 18:43:03 +0000 (10:43 -0800)] 
Merge branch 'es/recursive-single-branch-clone'

"git clone --recurse-submodules --single-branch" now uses the same
single-branch option when cloning the submodules.

* es/recursive-single-branch-clone:
  clone: pass --single-branch during --recurse-submodules
  submodule--helper: use C99 named initializer

4 years agoMerge branch 'jk/nth-packed-object-id'
Junio C Hamano [Thu, 5 Mar 2020 18:43:03 +0000 (10:43 -0800)] 
Merge branch 'jk/nth-packed-object-id'

Code cleanup to use "struct object_id" more by replacing use of
"char *sha1"

* jk/nth-packed-object-id:
  packfile: drop nth_packed_object_sha1()
  packed_object_info(): use object_id internally for delta base
  packed_object_info(): use object_id for returning delta base
  pack-check: push oid lookup into loop
  pack-check: convert "internal error" die to a BUG()
  pack-bitmap: use object_id when loading on-disk bitmaps
  pack-objects: use object_id struct in pack-reuse code
  pack-objects: convert oe_set_delta_ext() to use object_id
  pack-objects: read delta base oid into object_id struct
  nth_packed_object_oid(): use customary integer return

4 years agoMerge branch 'es/do-not-let-rebase-switch-to-protected-branch'
Junio C Hamano [Thu, 5 Mar 2020 18:43:03 +0000 (10:43 -0800)] 
Merge branch 'es/do-not-let-rebase-switch-to-protected-branch'

"git rebase BASE BRANCH" rebased/updated the tip of BRANCH and
checked it out, even when the BRANCH is checked out in a different
worktree.  This has been corrected.

* es/do-not-let-rebase-switch-to-protected-branch:
  rebase: refuse to switch to branch already checked out elsewhere
  t3400: make test clean up after itself

4 years agoMerge branch 'hv/receive-denycurrent-everywhere'
Junio C Hamano [Thu, 5 Mar 2020 18:43:02 +0000 (10:43 -0800)] 
Merge branch 'hv/receive-denycurrent-everywhere'

"git push" should stop from updating a branch that is checked out
when receive.denyCurrentBranch configuration is set, but it failed
to pay attention to checkouts in secondary worktrees.  This has
been corrected.

* hv/receive-denycurrent-everywhere:
  t2402: test worktree path when called in .git directory
  receive.denyCurrentBranch: respect all worktrees
  t5509: use a bare repository for test push target
  get_main_worktree(): allow it to be called in the Git directory

4 years agoMerge branch 'es/worktree-avoid-duplication-fix'
Junio C Hamano [Thu, 5 Mar 2020 18:43:02 +0000 (10:43 -0800)] 
Merge branch 'es/worktree-avoid-duplication-fix'

In rare cases "git worktree add <path>" could think that <path>
was already a registered worktree even when it wasn't and refuse
to add the new worktree. This has been corrected.

* es/worktree-avoid-duplication-fix:
  worktree: don't allow "add" validation to be fooled by suffix matching
  worktree: add utility to find worktree by pathname
  worktree: improve find_worktree() documentation

4 years agoMerge branch 'bc/wildcard-credential'
Junio C Hamano [Thu, 5 Mar 2020 18:43:02 +0000 (10:43 -0800)] 
Merge branch 'bc/wildcard-credential'

A configuration element used for credential subsystem can now use
wildcard pattern to specify for which set of URLs the entry
applies.

* bc/wildcard-credential:
  credential: allow wildcard patterns when matching config
  credential: use the last matching username in the config
  t0300: add tests for some additional cases
  t1300: add test for urlmatch with multiple wildcards
  mailmap: add an additional email address for brian m. carlson

4 years agoMerge branch 'mr/bisect-in-c-1'
Junio C Hamano [Thu, 5 Mar 2020 18:43:02 +0000 (10:43 -0800)] 
Merge branch 'mr/bisect-in-c-1'

Underlying machinery of "git bisect--helper" is being refactored
into pieces that are more easily reused.

* mr/bisect-in-c-1:
  bisect: libify `bisect_next_all`
  bisect: libify `handle_bad_merge_base` and its dependents
  bisect: libify `check_good_are_ancestors_of_bad` and its dependents
  bisect: libify `check_merge_bases` and its dependents
  bisect: libify `bisect_checkout`
  bisect: libify `exit_if_skipped_commits` to `error_if_skipped*` and its dependents
  bisect--helper: return error codes from `cmd_bisect__helper()`
  bisect: add enum to represent bisect returning codes
  bisect--helper: introduce new `decide_next()` function
  bisect: use the standard 'if (!var)' way to check for 0
  bisect--helper: change `retval` to `res`
  bisect--helper: convert `vocab_*` char pointers to char arrays

4 years agoMerge branch 'ds/sparse-add'
Junio C Hamano [Thu, 5 Mar 2020 18:43:01 +0000 (10:43 -0800)] 
Merge branch 'ds/sparse-add'

"git sparse-checkout" learned a new "add" subcommand.

* ds/sparse-add:
  sparse-checkout: allow one-character directories in cone mode
  sparse-checkout: work with Windows paths
  sparse-checkout: create 'add' subcommand
  sparse-checkout: extract pattern update from 'set' subcommand
  sparse-checkout: extract add_patterns_from_input()

4 years agot2402: test worktree path when called in .git directory
Hariom Verma [Wed, 4 Mar 2020 07:00:00 +0000 (07:00 +0000)] 
t2402: test worktree path when called in .git directory

The bug which reports an extra `/.git/.` in worktree path when called in
'.git' directory already has been fixed. But unfortunately, the regression
test to ensure this behavior has been forgotten.
Here is that test.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Hariom Verma <hariom18599@gmail.com>
Acked-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoThe eighth batch for 2.26
Junio C Hamano [Mon, 2 Mar 2020 23:07:40 +0000 (15:07 -0800)] 
The eighth batch for 2.26

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'ma/test-cleanup'
Junio C Hamano [Mon, 2 Mar 2020 23:07:20 +0000 (15:07 -0800)] 
Merge branch 'ma/test-cleanup'

Code cleanup.

* ma/test-cleanup:
  t: drop debug `cat` calls
  t9810: drop debug `cat` call
  t4117: check for files using `test_path_is_file`

4 years agoMerge branch 'rs/blame-typefix-for-fingerprint'
Junio C Hamano [Mon, 2 Mar 2020 23:07:20 +0000 (15:07 -0800)] 
Merge branch 'rs/blame-typefix-for-fingerprint'

Code cleanup.

* rs/blame-typefix-for-fingerprint:
  blame: provide type of fingerprints pointer

4 years agoMerge branch 'rs/micro-cleanups'
Junio C Hamano [Mon, 2 Mar 2020 23:07:20 +0000 (15:07 -0800)] 
Merge branch 'rs/micro-cleanups'

Code cleanup.

* rs/micro-cleanups:
  use strpbrk(3) to search for characters from a given set
  quote: use isalnum() to check for alphanumeric characters

4 years agoMerge branch 'es/worktree-cleanup'
Junio C Hamano [Mon, 2 Mar 2020 23:07:20 +0000 (15:07 -0800)] 
Merge branch 'es/worktree-cleanup'

Code cleanup.

* es/worktree-cleanup:
  worktree: drop unused code from get_main_worktree()

4 years agoMerge branch 'ak/test-log-graph'
Junio C Hamano [Mon, 2 Mar 2020 23:07:19 +0000 (15:07 -0800)] 
Merge branch 'ak/test-log-graph'

Test update.

* ak/test-log-graph:
  lib-log-graph: consolidate colored graph cmp logic
  lib-log-graph: consolidate test_cmp_graph logic

4 years agoMerge branch 'jk/run-command-formatfix'
Junio C Hamano [Mon, 2 Mar 2020 23:07:19 +0000 (15:07 -0800)] 
Merge branch 'jk/run-command-formatfix'

Code style cleanup.

* jk/run-command-formatfix:
  run-command.h: fix mis-indented struct member

4 years agoMerge branch 'ds/partial-clone-fixes'
Junio C Hamano [Mon, 2 Mar 2020 23:07:19 +0000 (15:07 -0800)] 
Merge branch 'ds/partial-clone-fixes'

Fix for a bug revealed by a recent change to make the protocol v2
the default.

* ds/partial-clone-fixes:
  partial-clone: avoid fetching when looking for objects
  partial-clone: demonstrate bugs in partial fetch

4 years agoMerge branch 'en/t3433-rebase-stat-dirty-failure'
Junio C Hamano [Mon, 2 Mar 2020 23:07:19 +0000 (15:07 -0800)] 
Merge branch 'en/t3433-rebase-stat-dirty-failure'

The merge-recursive machinery failed to refresh the cache entry for
a merge result in a couple of places, resulting in an unnecessary
merge failure, which has been fixed.

* en/t3433-rebase-stat-dirty-failure:
  merge-recursive: fix the refresh logic in update_file_flags
  t3433: new rebase testcase documenting a stat-dirty-like failure

4 years agoMerge branch 'en/rebase-backend'
Junio C Hamano [Mon, 2 Mar 2020 23:07:18 +0000 (15:07 -0800)] 
Merge branch 'en/rebase-backend'

"git rebase" has learned to use the merge backend (i.e. the
machinery that drives "rebase -i") by default, while allowing
"--apply" option to use the "apply" backend (e.g. the moral
equivalent of "format-patch piped to am").  The rebase.backend
configuration variable can be set to customize.

* en/rebase-backend:
  rebase: rename the two primary rebase backends
  rebase: change the default backend from "am" to "merge"
  rebase: make the backend configurable via config setting
  rebase tests: repeat some tests using the merge backend instead of am
  rebase tests: mark tests specific to the am-backend with --am
  rebase: drop '-i' from the reflog for interactive-based rebases
  git-prompt: change the prompt for interactive-based rebases
  rebase: add an --am option
  rebase: move incompatibility checks between backend options a bit earlier
  git-rebase.txt: add more details about behavioral differences of backends
  rebase: allow more types of rebases to fast-forward
  t3432: make these tests work with either am or merge backends
  rebase: fix handling of restrict_revision
  rebase: make sure to pass along the quiet flag to the sequencer
  rebase, sequencer: remove the broken GIT_QUIET handling
  t3406: simplify an already simple test
  rebase (interactive-backend): fix handling of commits that become empty
  rebase (interactive-backend): make --keep-empty the default
  t3404: directly test the behavior of interest
  git-rebase.txt: update description of --allow-empty-message

4 years agoMerge branch 'en/check-ignore'
Junio C Hamano [Mon, 2 Mar 2020 23:07:18 +0000 (15:07 -0800)] 
Merge branch 'en/check-ignore'

"git check-ignore" did not work when the given path is explicitly
marked as not ignored with a negative entry in the .gitignore file.

* en/check-ignore:
  check-ignore: fix documentation and implementation to match

4 years agoMerge branch 'jk/object-filter-with-bitmap'
Junio C Hamano [Mon, 2 Mar 2020 23:07:18 +0000 (15:07 -0800)] 
Merge branch 'jk/object-filter-with-bitmap'

The object reachability bitmap machinery and the partial cloning
machinery were not prepared to work well together, because some
object-filtering criteria that partial clones use inherently rely
on object traversal, but the bitmap machinery is an optimization
to bypass that object traversal.  There however are some cases
where they can work together, and they were taught about them.

* jk/object-filter-with-bitmap:
  rev-list --count: comment on the use of count_right++
  pack-objects: support filters with bitmaps
  pack-bitmap: implement BLOB_LIMIT filtering
  pack-bitmap: implement BLOB_NONE filtering
  bitmap: add bitmap_unset() function
  rev-list: use bitmap filters for traversal
  pack-bitmap: basic noop bitmap filter infrastructure
  rev-list: allow commit-only bitmap traversals
  t5310: factor out bitmap traversal comparison
  rev-list: allow bitmaps when counting objects
  rev-list: make --count work with --objects
  rev-list: factor out bitmap-optimized routines
  pack-bitmap: refuse to do a bitmap traversal with pathspecs
  rev-list: fallback to non-bitmap traversal when filtering
  pack-bitmap: fix leak of haves/wants object lists
  pack-bitmap: factor out type iterator initialization

4 years agoMerge branch 'jk/push-option-doc-markup-fix'
Junio C Hamano [Mon, 2 Mar 2020 23:07:18 +0000 (15:07 -0800)] 
Merge branch 'jk/push-option-doc-markup-fix'

Doc markup fix.

* jk/push-option-doc-markup-fix:
  doc/config/push: use longer "--" line for preformatted example

4 years agoMerge branch 'jk/doc-diff-parallel'
Junio C Hamano [Mon, 2 Mar 2020 23:07:17 +0000 (15:07 -0800)] 
Merge branch 'jk/doc-diff-parallel'

Update to doc-diff.

* jk/doc-diff-parallel:
  doc-diff: use single-colon rule in rendering Makefile

4 years agoRevert "gpg-interface: prefer check_signature() for GPG verification"
Junio C Hamano [Fri, 28 Feb 2020 17:43:17 +0000 (09:43 -0800)] 
Revert "gpg-interface: prefer check_signature() for GPG verification"

This reverts commit 72b006f4bfd30b7c5037c163efaf279ab65bea9c, which
breaks the end-user experience when merging a signed tag without
having the public key.  We should report "can't check because we
have no public key", but the code with this change claimed that
there was no signature.

4 years agomingw: workaround for hangs when sending STDIN
Alexandr Miloslavskiy [Mon, 17 Feb 2020 18:01:26 +0000 (18:01 +0000)] 
mingw: workaround for hangs when sending STDIN

Explanation
-----------
The problem here is flawed `poll()` implementation. When it tries to
see if pipe can be written without blocking, it eventually calls
`NtQueryInformationFile()` and tests `WriteQuotaAvailable`. However,
the meaning of quota was misunderstood. The value of quota is reduced
when either some data was written to a pipe, *or* there is a pending
read on the pipe. Therefore, if there is a pending read of size >= than
the pipe's buffer size, poll() will think that pipe is not writable and
will hang forever, usually that means deadlocking both pipe users.

I have studied the problem and found that Windows pipes track two values:
`QuotaUsed` and `BytesInQueue`. The code in `poll()` apparently wants to
know `BytesInQueue` instead of quota. Unfortunately, `BytesInQueue` can
only be requested from read end of the pipe, while `poll()` receives
write end.

The git's implementation of `poll()` was copied from gnulib, which also
contains a flawed implementation up to today.

I also had a look at implementation in cygwin, which is also broken in a
subtle way. It uses this code in `pipe_data_available()`:
fpli.WriteQuotaAvailable = (fpli.OutboundQuota - fpli.ReadDataAvailable)
However, `ReadDataAvailable` always returns 0 for the write end of the pipe,
turning the code into an obfuscated version of returning pipe's total
buffer size, which I guess will in turn have `poll()` always say that pipe
is writable. The commit that introduced the code doesn't say anything about
this change, so it could be some debugging code that slipped in.

These are the typical sizes used in git:
0x2000 - default read size in `strbuf_read()`
0x1000 - default read size in CRT, used by `strbuf_getwholeline()`
0x2000 - pipe buffer size in compat\mingw.c

As a consequence, as soon as child process uses `strbuf_read()`,
`poll()` in parent process will hang forever, deadlocking both
processes.

This results in two observable behaviors:
1) If parent process begins sending STDIN quickly (and usually that's
   the case), then first `poll()` will succeed and first block will go
   through. MAX_IO_SIZE_DEFAULT is 8MB, so if STDIN exceeds 8MB, then
   it will deadlock.
2) If parent process waits a little bit for any reason (including OS
   scheduler) and child is first to issue `strbuf_read()`, then it will
   deadlock immediately even on small STDINs.

The problem is illustrated by `git stash push`, which will currently
read the entire patch into memory and then send it to `git apply` via
STDIN. If patch exceeds 8MB, git hangs on Windows.

Possible solutions
------------------
1) Somehow obtain `BytesInQueue` instead of `QuotaUsed`
   I did a pretty thorough search and didn't find any ways to obtain
   the value from write end of the pipe.
2) Also give read end of the pipe to `poll()`
   That can be done, but it will probably invite some dirty code,
   because `poll()`
   * can accept multiple pipes at once
   * can accept things that are not pipes
   * is expected to have a well known signature.
3) Make `poll()` always reply "writable" for write end of the pipe
   Afterall it seems that cygwin (accidentally?) does that for years.
   Also, it should be noted that `pump_io_round()` writes 8MB blocks,
   completely ignoring the fact that pipe's buffer size is only 8KB,
   which means that pipe gets clogged many times during that single
   write. This may invite a deadlock, if child's STDERR/STDOUT gets
   clogged while it's trying to deal with 8MB of STDIN. Such deadlocks
   could be defeated with writing less than pipe's buffer size per
   round, and always reading everything from STDOUT/STDERR before
   starting next round. Therefore, making `poll()` always reply
   "writable" shouldn't cause any new issues or block any future
   solutions.
4) Increase the size of the pipe's buffer
   The difference between `BytesInQueue` and `QuotaUsed` is the size
   of pending reads. Therefore, if buffer is bigger than size of reads,
   `poll()` won't hang so easily. However, I found that for example
   `strbuf_read()` will get more and more hungry as it reads large inputs,
   eventually surpassing any reasonable pipe buffer size.

Chosen solution
---------------
Make `poll()` always reply "writable" for write end of the pipe.
Hopefully one day someone will find a way to implement it properly.

Reproduction
------------
printf "%8388608s" X >large_file.txt
git stash push --include-untracked -- large_file.txt

I have decided not to include this as test to avoid slowing down the
test suite. I don't expect the specific problem to come back, and
chances are that `git stash push` will be reworked to avoid sending the
entire patch via STDIN.

Signed-off-by: Alexandr Miloslavskiy <alexandr.miloslavskiy@syntevo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot6020: new test with interleaved lexicographic ordering of directories
Elijah Newren [Thu, 27 Feb 2020 00:14:24 +0000 (00:14 +0000)] 
t6020: new test with interleaved lexicographic ordering of directories

If a repository has two files:
    foo/bar/baz
    foo/bar-2/baz
then a simple lexicographic ordering of files and directories shows
    ...
    foo/bar
    foo/bar-2
    foo/bar/baz
    ...
and the appearance of foo/bar-2 between foo/bar and foo/bar/baz can trip
up some codepaths.  Add a test to catch such cases.

t6020 might be a slight misfit since this testcase does not test any
kind of file/directory conflict.  However, it is similar in spirit to
some tests (4-6) already in t6020 that check cases where a *file* sorted
between a directory and the files underneath that directory.  This
testcase differs in that now there is a *directory* that sorts in the
middle.

Although merge-recursive currently has no problems with this simple
testcase, I discovered that it's very possible to accidentally mess it
up.  Further, we have no other merge or cherry-pick or rebase testcases
in the entire testsuite that cover such a case, so I felt like it would
be a worthwhile addition to the testsuite.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot6022, t6046: test expected behavior instead of testing a proxy for it
Elijah Newren [Thu, 27 Feb 2020 00:14:23 +0000 (00:14 +0000)] 
t6022, t6046: test expected behavior instead of testing a proxy for it

In t6022, we were testing for file being overwritten (or not) based on
an output message instead of checking for the file being overwritten.
Since we can check for the file being overwritten via mtime updates,
check that instead.

In t6046, we were largely checking for both the expected behavior and a
proxy for it, which is unnecessary.  The calls to test-tool also were a
bit cryptic.  Make them a little clearer.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3035: prefer test_must_fail to bash negation for git commands
Elijah Newren [Thu, 27 Feb 2020 00:14:22 +0000 (00:14 +0000)] 
t3035: prefer test_must_fail to bash negation for git commands

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot6020, t6022, t6035: update merge tests to use test helper functions
Elijah Newren [Thu, 27 Feb 2020 00:14:21 +0000 (00:14 +0000)] 
t6020, t6022, t6035: update merge tests to use test helper functions

Make use of test_path_is_file, test_write_lines, and similar helpers
in these old test files.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot602[1236], t6034: modernize test formatting
Elijah Newren [Thu, 27 Feb 2020 00:14:20 +0000 (00:14 +0000)] 
t602[1236], t6034: modernize test formatting

Indent code, and include it inside test_expect* blocks.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomerge-recursive: apply collision handling unification to recursive case
Elijah Newren [Thu, 27 Feb 2020 00:05:05 +0000 (00:05 +0000)] 
merge-recursive: apply collision handling unification to recursive case

In the en/merge-path-collision topic (see commit ac193e0e0aa5, "Merge
branch 'en/merge-path-collision'", 2019-01-04), all the "file collision"
conflict types were modified for consistency.  In particular,
rename/add, rename/rename(2to1) and each rename/add piece of a
rename/rename(1to2)/add[/add] conflict were made to behave like add/add
conflicts have always been handled.

However, this consistency was not enforced when opt->priv->call_depth >
0 for rename/rename conflicts.  Update rename/rename(1to2) and
rename/rename(2to1) conflicts in the recursive case to also be
consistent.  As an added bonus, this simplifies the code considerably.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoAzure Pipeline: switch to the latest agent pools
Johannes Schindelin [Thu, 27 Feb 2020 13:23:13 +0000 (13:23 +0000)] 
Azure Pipeline: switch to the latest agent pools

It would seem that at least the `vs2015-win2012r2` pool (which we use
via its old name, `Hosted`) is about to be phased out. Let's switch
before that.

While at it, use the newer pool names as suggested at
https://docs.microsoft.com/en-us/azure/devops/pipelines/agents/hosted?view=azure-devops#use-a-microsoft-hosted-agent

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoci: prevent `perforce` from being quarantined
Johannes Schindelin [Thu, 27 Feb 2020 13:23:12 +0000 (13:23 +0000)] 
ci: prevent `perforce` from being quarantined

The most recent Azure Pipelines macOS agents enable what Apple calls
"System Integrity Protection". This makes `p4d -V` hang: there is some
sort of GUI dialog waiting for the user to acknowledge that the copied
binaries are legit and may be executed, but on build agents, there is no
user who could acknowledge that.

Let's ask Homebrew specifically to _not_ quarantine the Perforce
binaries.

Helped-by: Aleksandr Chebotov
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot/lib-httpd: avoid using macOS' sed
Johannes Schindelin [Thu, 27 Feb 2020 13:23:11 +0000 (13:23 +0000)] 
t/lib-httpd: avoid using macOS' sed

Among other differences relative to GNU sed, macOS' sed always ends its
output with a trailing newline, even if the input did not have such a
trailing newline.

Surprisingly, this makes three httpd-based tests fail on macOS: t5616,
t5702 and t5703. ("Surprisingly" because those tests have been around
for some time, but apparently nobody runs them on macOS with a working
Apache2 setup.)

The reason is that we use `sed` in those tests to filter the response of
the web server. Apart from the fact that we use GNU constructs (such as
using a space after the `c` command instead of a backslash and a
newline), we have another problem: macOS' sed LF-only newlines while
webservers are supposed to use CR/LF ones.

Even worse, t5616 uses `sed` to replace a binary part of the response
with a new binary part (kind of hoping that the replaced binary part
does not contain a 0x0a byte which would be interpreted as a newline).

To that end, it calls on Perl to read the binary pack file and
hex-encode it, then calls on `sed` to prefix every hex digit pair with a
`\x` in order to construct the text that the `c` statement of the `sed`
invocation is supposed to insert. So we call Perl and sed to construct a
sed statement. The final nail in the coffin is that macOS' sed does not
even interpret those `\x<hex>` constructs.

Let's just replace all of that by Perl snippets. With Perl, at least, we
do not have to deal with GNU vs macOS semantics, we do not have to worry
about unwanted trailing newlines, and we do not have to spawn commands
to construct arguments for other commands to be spawned (i.e. we can
avoid a whole lot of shell scripting complexity).

The upshot is that this fixes t5616, t5702 and t5703 on macOS with
Apache2.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocommit-graph: use progress title directly
René Scharfe [Thu, 20 Feb 2020 18:49:18 +0000 (19:49 +0100)] 
commit-graph: use progress title directly

merge_commit_graphs() copies the (translated) progress message into a
strbuf and passes the copy to start_delayed_progress() at each loop
iteration.  The latter function takes a string pointer, so let's avoid
the detour and hand the string to it directly.  That's shorter, simpler
and slightly more efficient.

Signed-off-by: René Scharfe <l.s.r@web.de>
Acked-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agodescribe: don't abort too early when searching tags
Benno Evers [Wed, 26 Feb 2020 17:48:53 +0000 (18:48 +0100)] 
describe: don't abort too early when searching tags

When searching the commit graph for tag candidates, `git-describe`
will stop as soon as there is only one active branch left and
it already found an annotated tag as a candidate.

This works well as long as all branches eventually connect back
to a common root, but if the tags are found across branches
with no common ancestor

                  B
                  o----.
                        \
          o-----o---o----x
          A

it can happen that the search on one branch terminates prematurely
because a tag was found on another, independent branch. This scenario
isn't quite as obscure as it sounds, since cloning with a limited
depth often introduces many independent "dead ends" into the commit
graph.

The help text of `git-describe` states pretty clearly that when
describing a commit D, the number appended to the emitted tag X should
correspond to the number of commits found by `git log X..D`.

Thus, this commit modifies the stopping condition to only abort
the search when only one branch is left to search *and* all current
best candidates are descendants from that branch.

For repositories with a single root, this condition is always
true: When the search is reduced to a single active branch, the
current commit must be an ancestor of *all* tag candidates. This
means that in the common case, this change will have no negative
performance impact since the same number of commits as before will
be traversed.

Signed-off-by: Benno Evers <benno@bmevers.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agobuiltin/rebase: remove a call to get_oid() on `options.switch_to'
Alban Gruin [Tue, 21 Jan 2020 19:32:26 +0000 (20:32 +0100)] 
builtin/rebase: remove a call to get_oid() on `options.switch_to'

When `options.switch_to' is set, `options.orig_head' is populated right
after with the object name the ref/commit argument points at.

Therefore, there is no need to parse `switch_to' again.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoThe seventh batch for 2.26
Junio C Hamano [Tue, 25 Feb 2020 19:17:41 +0000 (11:17 -0800)] 
The seventh batch for 2.26

Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoMerge branch 'es/doc-mentoring'
Junio C Hamano [Tue, 25 Feb 2020 19:18:32 +0000 (11:18 -0800)] 
Merge branch 'es/doc-mentoring'

Doc for new contributors.

* es/doc-mentoring:
  MyFirstContribution: rephrase contact info
  MyFirstContribution: add avenues for getting help

4 years agoMerge branch 'es/bright-colors'
Junio C Hamano [Tue, 25 Feb 2020 19:18:32 +0000 (11:18 -0800)] 
Merge branch 'es/bright-colors'

The basic 7 colors learned the brighter counterparts
(e.g. "brightred").

* es/bright-colors:
  color.c: alias RGB colors 8-15 to aixterm colors
  color.c: support bright aixterm colors
  color.c: refactor color_output arguments

4 years agoMerge branch 'bw/remote-rename-update-config'
Junio C Hamano [Tue, 25 Feb 2020 19:18:32 +0000 (11:18 -0800)] 
Merge branch 'bw/remote-rename-update-config'

"git remote rename X Y" needs to adjust configuration variables
(e.g. branch.<name>.remote) whose value used to be X to Y.
branch.<name>.pushRemote is now also updated.

* bw/remote-rename-update-config:
  remote rename/remove: gently handle remote.pushDefault config
  config: provide access to the current line number
  remote rename/remove: handle branch.<name>.pushRemote config values
  remote: clean-up config callback
  remote: clean-up by returning early to avoid one indentation
  pull --rebase/remote rename: document and honor single-letter abbreviations rebase types

4 years agoclone: pass --single-branch during --recurse-submodules
Emily Shaffer [Fri, 21 Feb 2020 03:10:27 +0000 (19:10 -0800)] 
clone: pass --single-branch during --recurse-submodules

Previously, performing "git clone --recurse-submodules --single-branch"
resulted in submodules cloning all branches even though the superproject
cloned only one branch. Pipe --single-branch through the submodule
helper framework to make it to 'clone' later on.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agosubmodule--helper: use C99 named initializer
Emily Shaffer [Fri, 21 Feb 2020 03:10:26 +0000 (19:10 -0800)] 
submodule--helper: use C99 named initializer

Start using a named initializer list for SUBMODULE_UPDATE_CLONE_INIT, as
the struct is becoming cumbersome for a typical struct initializer list.

Signed-off-by: Emily Shaffer <emilyshaffer@google.com>
Acked-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agolib-log-graph: consolidate colored graph cmp logic
Abhishek Kumar [Mon, 24 Feb 2020 13:38:14 +0000 (19:08 +0530)] 
lib-log-graph: consolidate colored graph cmp logic

Signed-off-by: Abhishek Kumar <abhishekkumar8222@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agolib-log-graph: consolidate test_cmp_graph logic
Abhishek Kumar [Mon, 24 Feb 2020 13:38:13 +0000 (19:08 +0530)] 
lib-log-graph: consolidate test_cmp_graph logic

Log graph comparision logic is duplicated many times in:

- t3430-rebase-merges.sh
- t4202-log.sh
- t4214-log-graph-octopus.sh
- t4215-log-skewed-merges.sh

Consolidate the core of the comparision and sanitization logic in
lib-log-graph, and use it to replace the existing tests.

While at it, lose the singular/plural transition magic from the
sanitize_output helper, which was necessary around 7f814632 ("Use
correct grammar in diffstat summary line", 2012-02-01), that has
long outlived its usefulness.

Signed-off-by: Abhishek Kumar <abhishekkumar8222@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoworktree: don't allow "add" validation to be fooled by suffix matching
Eric Sunshine [Mon, 24 Feb 2020 09:08:48 +0000 (04:08 -0500)] 
worktree: don't allow "add" validation to be fooled by suffix matching

"git worktree add <path>" performs various checks before approving
<path> as a valid location for the new worktree. Aside from ensuring
that <path> does not already exist, one of the questions it asks is
whether <path> is already a registered worktree. To perform this check,
it queries find_worktree() and disallows the "add" operation if
find_worktree() finds a match for <path>. As a convenience, however,
find_worktree() casts an overly wide net to allow users to identify
worktrees by shorthand in order to keep typing to a minimum. For
instance, it performs suffix matching which, given subtrees "foo/bar"
and "foo/baz", can correctly select the latter when asked only for
"baz".

"add" validation knows the exact path it is interrogating, so this sort
of heuristic-based matching is, at best, questionable for this use-case
and, at worst, may may accidentally interpret <path> as matching an
existing worktree and incorrectly report it as already registered even
when it isn't. (In fact, validate_worktree_add() already contains a
special case to avoid accidentally matching against the main worktree,
precisely due to this problem.)

Avoid the problem of potential accidental matching against an existing
worktree by instead taking advantage of find_worktree_by_path() which
matches paths deterministically, without applying any sort of magic
shorthand matching performed by find_worktree().

Reported-by: Cameron Gunnin <cameron.gunnin@synopsys.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoworktree: add utility to find worktree by pathname
Eric Sunshine [Mon, 24 Feb 2020 09:08:47 +0000 (04:08 -0500)] 
worktree: add utility to find worktree by pathname

find_worktree() employs heuristics to match user provided input -- which
may be a pathname or some sort of shorthand -- with an actual worktree.
Although this convenience allows a user to identify a worktree with
minimal typing, the black-box nature of these heuristics makes it
potentially difficult for callers which already know the exact path of a
worktree to be confident that the correct worktree will be returned for
any specific pathname (particularly a relative one), especially as the
heuristics are enhanced and updated.

Therefore, add a companion function, find_worktree_by_path(), which
deterministically identifies a worktree strictly by pathname with no
interpretation and no magic matching.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoworktree: improve find_worktree() documentation
Eric Sunshine [Mon, 24 Feb 2020 09:08:46 +0000 (04:08 -0500)] 
worktree: improve find_worktree() documentation

Do a better job of explaining that find_worktree()'s main purpose is to
locate a worktree based upon input from a user which may be some sort of
shorthand for identifying a worktree rather than an actual path. For
instance, one shorthand a user can use to identify a worktree is by
unique path suffix (i.e. given worktrees at paths "foo/bar" and
"foo/baz", the latter can be identified simply as "baz"). The actual
heuristics find_worktree() uses to select a worktree may be expanded in
the future (for instance, one day it may allow worktree selection by
<id> of the .git/worktrees/<id>/ administrative directory), thus the
documentation does not provide a precise description of how matching is
performed, instead leaving it open-ended to allow for future
enhancement.

While at it, drop mention of the non-NULL requirement of `prefix` since
NULL has long been allowed. For instance, prefix_filename() has
explicitly allowed NULL since 116fb64e43 (prefix_filename: drop length
parameter, 2017-03-20), and find_worktree() itself since e4da43b1f0
(prefix_filename: return newly allocated string, 2017-03-20).

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopackfile: drop nth_packed_object_sha1()
Jeff King [Mon, 24 Feb 2020 04:37:54 +0000 (23:37 -0500)] 
packfile: drop nth_packed_object_sha1()

Once upon a time, nth_packed_object_sha1() was the primary way to get
the oid of a packfile's index position. But these days we have the more
type-safe nth_packed_object_id() wrapper, and all callers have been
converted.

Let's drop the "sha1" version (turning the safer wrapper into a single
function) so that nobody is tempted to introduce new callers.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopacked_object_info(): use object_id internally for delta base
Jeff King [Mon, 24 Feb 2020 04:37:31 +0000 (23:37 -0500)] 
packed_object_info(): use object_id internally for delta base

The previous commit changed the public interface of packed_object_info()
to return a struct object_id rather than a bare hash. That enables us to
convert our internal helper, as well. We can use nth_packed_object_id()
directly for OFS_DELTA, but we'll still have to use oidread() to pull
the hash for a REF_DELTA out of the packfile.

There should be no additional cost, since we're copying directly into
the object_id the caller provided us (just as we did before; it's just
happening now via nth_packed_object_id()).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopacked_object_info(): use object_id for returning delta base
Jeff King [Mon, 24 Feb 2020 04:36:56 +0000 (23:36 -0500)] 
packed_object_info(): use object_id for returning delta base

If a caller sets the object_info.delta_base_sha1 to a non-NULL pointer,
we'll write the oid of the object's delta base to it. But we can
increase our type safety by switching this to a real object_id struct.
All of our callers are just pointing into the hash member of an
object_id anyway, so there's no inconvenience.

Note that we do still keep it as a pointer-to-struct, because the NULL
sentinel value tells us whether the caller is even interested in the
information.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopack-check: push oid lookup into loop
Jeff King [Mon, 24 Feb 2020 04:36:31 +0000 (23:36 -0500)] 
pack-check: push oid lookup into loop

When we're checking a pack with fsck or verify-pack, we first sort the
idx entries by offset, since accessing them in pack order is more
efficient. To do so, we loop over them and fill in an array of structs
with the offset, object_id, and index position of each, sort the result,
and only then do we iterate over the sorted array and process each
entry.

In order to avoid the memory cost of storing the hash of each object, we
just store a pointer into the copy in the mmap'd pack index file. To
keep that property even as the rest of the code converted to "struct
object_id", commit 9fd750461b (Convert the verify_pack callback to
struct object_id, 2017-05-06) introduced a union in order to type-pun
the pointer-to-hash into an object_id struct.

But we can make this even simpler by observing that the sort operation
doesn't need the object id at all! We only need them one at a time while
we actually process each entry. So we can just omit the oid from the
struct entirely and load it on the fly into a local variable in the
second loop.

This gets rid of the type-punning, and lets us directly use the more
type-safe nth_packed_object_id(), simplifying the code. And as a bonus,
it saves 8 bytes of memory per object.

Note that this does mean we'll do the offset lookup for each object
before the oid lookup. The oid lookup has more safety checks in it
(e.g., for looking past p->num_objects) which in theory protected the
offset lookup. But since violating those checks was already a BUG()
condition (as described in the previous commit), it's not worth worrying
about.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopack-check: convert "internal error" die to a BUG()
Jeff King [Mon, 24 Feb 2020 04:33:18 +0000 (23:33 -0500)] 
pack-check: convert "internal error" die to a BUG()

If we fail to load the oid from the index of a packfile, we'll die()
with an "internal error". But this should never happen: we'd fail here
only if the idx needed to be lazily opened (but we've already opened it)
or if we asked for an out-of-range index (but we're iterating using the
same count that we'd check the range against). A corrupted index might
have a bogus count (e.g., too large for its size), but we'd have
complained and aborted already when opening the index initially.

While we're here, we can add a few details so that if this bug ever
_does_ trigger, we'll have a bit more information.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopack-bitmap: use object_id when loading on-disk bitmaps
Jeff King [Mon, 24 Feb 2020 04:32:27 +0000 (23:32 -0500)] 
pack-bitmap: use object_id when loading on-disk bitmaps

A pack bitmap file contains the index position of the commit for each
bitmap, which we then translate into an object id via
nth_packed_object_sha1(). In preparation for that function going away,
we can switch to the more type-safe nth_packed_object_id().

Note that even though the result ends up in an object_id this does incur
an extra copy of the hash (into our temporary object_id, and then into
the final malloc'd stored_bitmap struct). This shouldn't make any
measurable difference. If it did, we could avoid this copy _and_ the
copy of the rest of the items by allocating the stored_bitmap struct
beforehand and reading directly into it from the bitmap file. Or better
still, if this is a bottleneck, we could introduce an on-disk index to
the bitmap file so we don't have to read every single entry to use just
one of them. So it's not worth worrying about micro-optimizing out this
one hash copy.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopack-objects: use object_id struct in pack-reuse code
Jeff King [Mon, 24 Feb 2020 04:31:22 +0000 (23:31 -0500)] 
pack-objects: use object_id struct in pack-reuse code

When the pack-reuse code is dumping an OFS_DELTA entry to a client that
doesn't support it, we re-write it as a REF_DELTA. To do so, we use
nth_packed_object_sha1() to get the oid, but that function is soon going
away in favor of the more type-safe nth_packed_object_id(). Let's switch
now in preparation.

Note that this does incur an extra hash copy (from the pack idx mmap to
the object_id and then to the output, rather than straight from mmap to
the output). But this is not worth worrying about. It's probably not
measurable even when it triggers, and this is fallback code that we
expect to trigger very rarely (since everybody supports OFS_DELTA these
days anyway).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopack-objects: convert oe_set_delta_ext() to use object_id
Jeff King [Mon, 24 Feb 2020 04:30:07 +0000 (23:30 -0500)] 
pack-objects: convert oe_set_delta_ext() to use object_id

We already store an object_id internally, and now our sole caller also
has one. Let's stop passing around the internal hash array, which adds a
bit of type safety.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopack-objects: read delta base oid into object_id struct
Jeff King [Mon, 24 Feb 2020 04:29:44 +0000 (23:29 -0500)] 
pack-objects: read delta base oid into object_id struct

When we're considering reusing an on-disk delta, we get the oid of the
base as a pointer to unsigned char bytes of the hash, either into the
packfile itself (for REF_DELTA) or into the pack idx (using the revindex
to convert the offset into an index entry).

Instead, we'd prefer to use a more type-safe object_id as much as
possible. We can get the pack idx using nth_packed_object_id() instead.
For the packfile bytes, we can copy them out using oidread().

This doesn't even incur an extra copy overall, since the next thing we'd
always do with that pointer is pass it to can_reuse_delta(), which needs
an object_id anyway (and called oidread() itself). So this patch also
converts that function to take the object_id directly.

Note that we did previously use NULL as a sentinel value when the object
isn't a delta. We could probably get away with using the null oid for
this, but instead we'll use an explicit boolean flag, which should make
things more obvious for people reading the code later.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agonth_packed_object_oid(): use customary integer return
Jeff King [Mon, 24 Feb 2020 04:27:36 +0000 (23:27 -0500)] 
nth_packed_object_oid(): use customary integer return

Our nth_packed_object_sha1() function returns NULL for error. So when we
wrapped it with nth_packed_object_oid(), we kept the same semantics. But
it's a bit funny, because the caller actually passes in an out
parameter, and the pointer we return is just that same struct they
passed to us (or NULL).

It's not too terrible, but it does make the interface a little
non-idiomatic. Let's switch to our usual "0 for success, negative for
error" return value. Most callers either don't check it, or are
trivially converted. The one that requires the biggest change is
actually improved, as we can ditch an extra aliased pointer variable.

Since we are changing the interface in a subtle way that the compiler
wouldn't catch, let's also change the name to catch any topics in
flight. We can drop the 'o' and make it nth_packed_object_id(). That's
slightly shorter, but also less redundant since the 'o' stands for
"object" already.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoworktree: drop unused code from get_main_worktree()
Eric Sunshine [Mon, 24 Feb 2020 01:59:35 +0000 (20:59 -0500)] 
worktree: drop unused code from get_main_worktree()

This code has been unused since fa099d2322 (worktree.c: kill parse_ref()
in favor of refs_resolve_ref_unsafe(), 2017-04-24), so drop it.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoblame: provide type of fingerprints pointer
René Scharfe [Sun, 23 Feb 2020 16:56:31 +0000 (17:56 +0100)] 
blame: provide type of fingerprints pointer

The fingerprints member of struct blame_origin is a void pointer that is
only ever used to reference objects of type struct fingerprint.  Declare
its type to allow the compiler to do type checks.  We can keep its type
opaque in blame.h, though -- only functions in blame.c need to know the
actual definition of struct fingerprint.

Signed-off-by: René Scharfe <l.s.r@web.de>
Reviewed-by: Barret Rhoden <brho@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorebase: refuse to switch to branch already checked out elsewhere
Eric Sunshine [Sun, 23 Feb 2020 10:14:07 +0000 (05:14 -0500)] 
rebase: refuse to switch to branch already checked out elsewhere

The invocation "git rebase <upstream> <branch>" switches to <branch>
before performing the rebase operation. However, unlike git-switch,
git-checkout, and git-worktree which all refuse to switch to a branch
that is already checked out in some other worktree, git-rebase switches
to <branch> unconditionally. Curb this careless behavior by making
git-rebase also refuse to switch to a branch checked out elsewhere.

Reported-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot3400: make test clean up after itself
Eric Sunshine [Sun, 23 Feb 2020 10:14:06 +0000 (05:14 -0500)] 
t3400: make test clean up after itself

This test intentionally creates a file which causes rebase to fail, thus
it is important that this file be deleted before subsequent tests are
run which are not expecting such a failure. In the past, the common way
to ensure cleanup (regardless of whether the test succeeded or failed)
was either for the next test to perform the previous test's cleanup as
its first step or to do the cleanup at global scope outside of any
tests. With the introduction of 'test_when_finished', however, tests can
be responsible for their own cleanup. Therefore, update this test to
clean up after itself.

A bit of history: This 'rm' invocation was moved from within the body of
the following test to global scope by bffd750adf (rebase: improve error
message when upstream argument is missing, 2010-05-31), which postdates,
by about a month, introduction of 'test_when_finished' in 3bf7886705
(test-lib: Let tests specify commands to be run at end of test,
2010-05-02).

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot: drop debug `cat` calls
Martin Ågren [Sun, 23 Feb 2020 08:48:36 +0000 (09:48 +0100)] 
t: drop debug `cat` calls

We `cat` files, but don't inspect or grab the contents in any way.
Unlike in an earlier commit, there is no reason to suspect that these
files could be missing, so `cat`-ing them is just wasted effort.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot9810: drop debug `cat` call
Martin Ågren [Sun, 23 Feb 2020 08:48:35 +0000 (09:48 +0100)] 
t9810: drop debug `cat` call

We `cat` kwdelfile.c, but don't inspect or grab the contents in any way.
This looks like a remnant from a debug session. Similar to the previous
commit, one could argue that `cat`-ing the file verifies that it didn't
disappear somehow. But because the very next thing we do after `cat`-ing
the file is to `grep` in it, we can safely drop the call to `cat`.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot4117: check for files using `test_path_is_file`
Martin Ågren [Sun, 23 Feb 2020 08:48:34 +0000 (09:48 +0100)] 
t4117: check for files using `test_path_is_file`

We `cat` files, but don't inspect or grab the contents in any way. These
`cat` calls look like remnants from a debug session, so it's tempting to
get rid of them. But they do actually verify that the files exist, which
might not necessarily be the case for some failure modes of `git apply
--reject`. Let's not lose that.

Convert the `cat` calls to use `test_path_is_file` instead. This is of
course still a minor change since we no longer verify that the files can
be opened for reading, but that is not something we usually worry about.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoreceive.denyCurrentBranch: respect all worktrees
Hariom Verma [Sun, 23 Feb 2020 18:57:10 +0000 (18:57 +0000)] 
receive.denyCurrentBranch: respect all worktrees

The receive.denyCurrentBranch config option controls what happens if
you push to a branch that is checked out into a non-bare repository.
By default, it rejects it. It can be disabled via `ignore` or `warn`.
Another yet trickier option is `updateInstead`.

However, this setting was forgotten when the git worktree command was
introduced: only the main worktree's current branch is respected.

With this change, all worktrees are respected.

That change also leads to revealing another bug,
i.e. `receive.denyCurrentBranch = true` was ignored when pushing into a
non-bare repository's unborn current branch using ref namespaces. As
`is_ref_checked_out()` returns 0 which means `receive-pack` does not get
into conditional statement to switch `deny_current_branch` accordingly
(ignore, warn, refuse, unconfigured, updateInstead).

receive.denyCurrentBranch uses the function `refs_resolve_ref_unsafe()`
(called via `resolve_refdup()`) to resolve the symbolic ref HEAD, but
that function fails when HEAD does not point at a valid commit.
As we replace the call to `refs_resolve_ref_unsafe()` with
`find_shared_symref()`, which has no problem finding the worktree for a
given branch even if it is unborn yet, this bug is fixed at the same
time: receive.denyCurrentBranch now also handles worktrees with unborn
branches as intended even while using ref namespaces.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Hariom Verma <hariom18599@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot5509: use a bare repository for test push target
Hariom Verma [Sun, 23 Feb 2020 18:57:09 +0000 (18:57 +0000)] 
t5509: use a bare repository for test push target

`receive.denyCurrentBranch` currently has a bug where it allows pushing
into non-bare repository using namespaces as long as it does not have any
commits. This would cause t5509 to fail once that bug is fixed because it
pushes into an unborn current branch.

In t5509, no operations are performed inside `pushee`, as it is only a
target for `git push` and `git ls-remote` calls. Therefore it does not
need to have a worktree. So, it is safe to change `pushee` to a bare
repository.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Hariom Verma <hariom18599@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoget_main_worktree(): allow it to be called in the Git directory
Hariom Verma [Sun, 23 Feb 2020 18:57:08 +0000 (18:57 +0000)] 
get_main_worktree(): allow it to be called in the Git directory

When called in the Git directory of a non-bare repository, this function
would not return the directory of the main worktree, but of the Git
directory instead.

The reason: when the Git directory is the current working directory, the
absolute path of the common directory will be reported with a trailing
`/.git/.`, which the code of `get_main_worktree()` does not handle
correctly.

Let's fix this.

Helped-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Hariom Verma <hariom18599@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocompletion: add diff --color-moved[-ws]
Kir Kolyshkin [Fri, 21 Feb 2020 20:15:45 +0000 (12:15 -0800)] 
completion: add diff --color-moved[-ws]

These options are available since git v2.15, but somehow
eluded from the completion script.

Note that while --color-moved-ws= accepts comma-separated
list of values, there is no (easy?) way to make it work
with completion (see e.g. [1]).

[1]: https://github.com/scop/bash-completion/issues/240

Acked-by: Matheus Tavares Bernardino <matheus.bernardino@usp.br>
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agouse strpbrk(3) to search for characters from a given set
René Scharfe [Sat, 22 Feb 2020 18:51:19 +0000 (19:51 +0100)] 
use strpbrk(3) to search for characters from a given set

We can check if certain characters are present in a string by calling
strchr(3) on each of them, or we can pass them all to a single
strpbrk(3) call.  The latter is shorter, less repetitive and slightly
more efficient, so let's do that instead.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoquote: use isalnum() to check for alphanumeric characters
René Scharfe [Sat, 22 Feb 2020 18:51:13 +0000 (19:51 +0100)] 
quote: use isalnum() to check for alphanumeric characters

isalnum(c) is equivalent to isalpha(c) || isdigit(c), so use the
former instead.  The result is shorter, simpler and slightly more
efficient.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot1050: replace test -f with test_path_is_file
Rasmus Jonsson [Sun, 23 Feb 2020 00:50:49 +0000 (01:50 +0100)] 
t1050: replace test -f with test_path_is_file

Use test_path_is_file() instead of 'test -f' for better debugging
information.

Signed-off-by: Rasmus Jonsson <wasmus@zom.bi>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopartial-clone: avoid fetching when looking for objects
Derrick Stolee [Fri, 21 Feb 2020 21:47:28 +0000 (21:47 +0000)] 
partial-clone: avoid fetching when looking for objects

When using partial clone, find_non_local_tags() in builtin/fetch.c
checks each remote tag to see if its object also exists locally. There
is no expectation that the object exist locally, but this function
nevertheless triggers a lazy fetch if the object does not exist. This
can be extremely expensive when asking for a commit, as we are
completely removed from the context of the non-existent object and
thus supply no "haves" in the request.

6462d5eb9a (fetch: remove fetch_if_missing=0, 2019-11-05) removed a
global variable that prevented these fetches in favor of a bitflag.
However, some object existence checks were not updated to use this flag.

Update find_non_local_tags() to use OBJECT_INFO_SKIP_FETCH_OBJECT in
addition to OBJECT_INFO_QUICK. The _QUICK option only prevents
repreparing the pack-file structures. We need to be extremely careful
about supplying _SKIP_FETCH_OBJECT when we expect an object to not exist
due to updated refs.

This resolves a broken test in t5616-partial-clone.sh.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agopartial-clone: demonstrate bugs in partial fetch
Derrick Stolee [Fri, 21 Feb 2020 21:47:27 +0000 (21:47 +0000)] 
partial-clone: demonstrate bugs in partial fetch

While testing partial clone, I noticed some odd behavior. I was testing
a way of running 'git init', followed by manually configuring the remote
for partial clone, and then running 'git fetch'. Astonishingly, I saw
the 'git fetch' process start asking the server for multiple rounds of
pack-file downloads! When tweaking the situation a little more, I
discovered that I could cause the remote to hang up with an error.

Add two tests that demonstrate these two issues.

In the first test, we find that when fetching with blob filters from
a repository that previously did not have any tags, the 'git fetch
--tags origin' command fails because the server sends "multiple
filter-specs cannot be combined". This only happens when using
protocol v2.

In the second test, we see that a 'git fetch origin' request with
several ref updates results in multiple pack-file downloads. This must
be due to Git trying to fault-in the objects pointed by the refs. What
makes this matter particularly nasty is that this goes through the
do_oid_object_info_extended() method, so there are no "haves" in the
negotiation. This leads the remote to send every reachable commit and
tree from each new ref, providing a quadratic amount of data transfer!
This test is fixed if we revert 6462d5eb9a (fetch: remove
fetch_if_missing=0, 2019-11-05), but that revert causes other test
failures. The real fix will need more care.

The tests are ordered in this way because if I swap the test order the
tag test will succeed instead of fail. I believe this is because somehow
we need the srv.bare repo to not have any tags when we clone, but then
have tags in our next fetch.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agorun-command.h: fix mis-indented struct member
Jeff King [Fri, 21 Feb 2020 02:56:37 +0000 (21:56 -0500)] 
run-command.h: fix mis-indented struct member

An accidental conversion of a tab to 4 spaces snuck into 4c4066d95d
(run-command: move doc to run-command.h, 2019-11-17), messing up the
alignment when you have the project-recommended 8-width tabstops. Let's
revert that line.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agosparse-checkout: allow one-character directories in cone mode
Derrick Stolee [Thu, 20 Feb 2020 20:07:06 +0000 (20:07 +0000)] 
sparse-checkout: allow one-character directories in cone mode

In 9e6d3e64 (sparse-checkout: detect short patterns, 2020-01-24), a
condition on the minimum length of a cone-mode pattern was introduced.
However, this condition was off-by-one.

If we have a directory with a single character, say "b", then the
command

git sparse-checkout set b

will correctly add the pattern "/b/" to the sparse-checkout file. When
this is interpeted in dir.c, the pattern is "/b" with the
PATTERN_FLAG_MUSTBEDIR flag. This string has length two, which satisfies
our inclusive inequality (<= 2).

The reason for this inequality is that we will start to read the pattern
string character-by-character using three char pointers: prev, cur,
next. In particular, next is set to the current pattern plus two. The
mistake was that next will still be a valid pointer when the pattern
length is two, since the string is null-terminated.

Make this inequality strict so these patterns work.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoam: support --show-current-patch=diff to retrieve .git/rebase-apply/patch
Paolo Bonzini [Thu, 20 Feb 2020 14:15:19 +0000 (15:15 +0100)] 
am: support --show-current-patch=diff to retrieve .git/rebase-apply/patch

When "git am --show-current-patch" was added in commit 984913a210 ("am:
add --show-current-patch", 2018-02-12), "git am" started recommending it
as a replacement for .git/rebase-merge/patch.  Unfortunately the suggestion
is somewhat misguided; for example, the output of "git am --show-current-patch"
cannot be passed to "git apply" if it is encoded as quoted-printable
or base64.  Add a new mode to "git am --show-current-patch" in order to
straighten the suggestion.

Reported-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoam: support --show-current-patch=raw as a synonym for--show-current-patch
Paolo Bonzini [Thu, 20 Feb 2020 14:15:18 +0000 (15:15 +0100)] 
am: support --show-current-patch=raw as a synonym for--show-current-patch

When "git am --show-current-patch" was added in commit 984913a210 ("am:
add --show-current-patch", 2018-02-12), "git am" started recommending it
as a replacement for .git/rebase-merge/patch.  Unfortunately the suggestion
is somewhat misguided; for example, the output "git am --show-current-patch"
cannot be passed to "git apply" if it is encoded as quoted-printable or
base64.  To simplify worktree operations and to avoid that users poke into
.git, it would be better if "git am" also provided a mode that copies
.git/rebase-merge/patch to stdout.

One possibility could be to have completely separate options, introducing
for example --show-current-message (for .git/rebase-apply/NNNN)
and --show-current-diff (for .git/rebase-apply/patch), while possibly
deprecating --show-current-patch.

That would even remove the need for the first two patches in the series.
However, the long common prefix would have prevented using an abbreviated
option such as "--show".  Therefore, I chose instead to add a string
argument to --show-current-patch.  The new argument is optional, so that
"git am --show-current-patch"'s behavior remains backwards-compatible.

The next choice to make is how to handle multiple --show-current-patch
options.  Right now, something like "git am --abort --show-current-patch"
is rejected, and the previous suggestion would likewise have naturally
rejected a command line like

git am --show-current-message --show-current-diff

Therefore, I decided to also reject for example

git am --show-current-patch=diff --show-current-patch=raw

In other words the whole of --show-current-patch=xxx (including the
optional argument) is treated as the command mode.  I found this to be
more consistent and intuitive, even though it differs from the usual
"last one wins" semantics of the git command line.

Add the code to parse submodes based on the above design, where for now
"raw" is the only valid submode.  "raw" prints the full e-mail message
just like "git am --show-current-patch".

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoam: convert "resume" variable to a struct
Paolo Bonzini [Thu, 20 Feb 2020 14:15:17 +0000 (15:15 +0100)] 
am: convert "resume" variable to a struct

This will allow stashing the submode of --show-current-patch from a
callback function.  Using a struct will allow accessing both fields from
outside cmd_am (through container_of).

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoparse-options: convert "command mode" to a flag
Paolo Bonzini [Thu, 20 Feb 2020 14:15:16 +0000 (15:15 +0100)] 
parse-options: convert "command mode" to a flag

OPTION_CMDMODE is essentially OPTION_SET_INT plus an extra check that
the variable had not set before.  In order to allow custom processing
of the option, for example a "command mode" option that also has an
argument, it would be nice to use OPTION_CALLBACK and not have to rewrite
the extra check on incompatible options.  In other words, making the
processing of the option orthogonal to the "only one of these" behavior
provided by OPTION_CMDMODE.

Add a new flag that takes care of the check, and modify OPT_CMDMODE to
use it together with OPTION_SET_INT.  The new flag still requires that the
option value points to an int, but any OPTION_* value can be specified as
long as it does not require a non-int type for opt->value.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agoparse-options: add testcases for OPT_CMDMODE()
Paolo Bonzini [Thu, 20 Feb 2020 14:15:15 +0000 (15:15 +0100)] 
parse-options: add testcases for OPT_CMDMODE()

Before modifying the implementation, ensure that general operation of
OPT_CMDMODE() and detection of incompatible options are covered.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocredential: allow wildcard patterns when matching config
brian m. carlson [Thu, 20 Feb 2020 02:24:13 +0000 (02:24 +0000)] 
credential: allow wildcard patterns when matching config

In some cases, a user will want to use a specific credential helper for
a wildcard pattern, such as https://*.corp.example.com.  We have code
that handles this already with the urlmatch code, so let's use that
instead of our custom code.

Since the urlmatch code is a superset of our current matching in terms
of capabilities, there shouldn't be any cases of things that matched
previously that don't match now.  However, in addition to wildcard
matching, we now use partial path matching, which can cause slightly
different behavior in the case that a helper applies to the prefix
(considering path components) of the remote URL.  While different, this
is probably the behavior people were wanting anyway.

Since we're using the urlmatch code, we need to encode the components
we've gotten into a URL to match, so add a function to percent-encode
data and format the URL with it.  We now also no longer need to the
custom code to match URLs, so let's remove it.

Additionally, the urlmatch code always looks for the best match, whereas
we want all matches for credential helpers to preserve existing
behavior.  Let's add an optional field, select_fn, that lets us control
which items we want (in this case, all of them) and default it to the
best-match code that already exists for other users.

Signed-off-by: brian m. carlson <bk2204@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agocredential: use the last matching username in the config
brian m. carlson [Thu, 20 Feb 2020 02:24:12 +0000 (02:24 +0000)] 
credential: use the last matching username in the config

Everywhere else in the codebase, we use the rule that the last matching
configuration option is the one that takes effect.  This is helpful
because it allows more specific configuration settings (e.g., per-repo
configuration) to override less specific settings (e.g., per-user
configuration).

However, in the credential code, we didn't honor this setting, and
instead picked the first setting we had, and stuck with it.  This was
likely to ensure we picked the value from the URL, which we want to
honor over the configuration.

It's possible to do both, though, so let's check if the value is the one
we've gotten over our protocol connection, which if present will have
come from the URL, and keep it if so.  Otherwise, let's overwrite the
value with the latest version we've got from the configuration, so we
keep the last configuration value.

Signed-off-by: brian m. carlson <bk2204@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot0300: add tests for some additional cases
brian m. carlson [Thu, 20 Feb 2020 02:24:11 +0000 (02:24 +0000)] 
t0300: add tests for some additional cases

There are some tricky cases in our credential helpers that we don't have
test cases for.  To help prevent regressions, let's add some for these
cases:

* If there are multiple configured credential helpers, one without a
  path and one with a path, we want to invoke both of them.
* If there are percent-encoded values in the URL, we handle them
  properly.
* And finally, if there is a username in the remote URL, we want to
  honor that over what the configuration tells us.

Finally, there's an additional case that we'd like to test for as well,
but that currently fails.  In all other situations in our configuration,
we pick the last configuration setting that's provided.  However, we
fail to do that for credential.username, where we pick the first setting
instead.  Let's add a failing test that we have the consistent behavior
here, since that's the documented, expected behavior.

Signed-off-by: brian m. carlson <bk2204@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agot1300: add test for urlmatch with multiple wildcards
brian m. carlson [Thu, 20 Feb 2020 02:24:10 +0000 (02:24 +0000)] 
t1300: add test for urlmatch with multiple wildcards

Our urlmatch code handles multiple wildcards, but we don't currently
have a test that checks this code path. Add a test that we handle this
case correctly to avoid any regressions.

Signed-off-by: brian m. carlson <bk2204@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
4 years agomailmap: add an additional email address for brian m. carlson
brian m. carlson [Thu, 20 Feb 2020 02:24:09 +0000 (02:24 +0000)] 
mailmap: add an additional email address for brian m. carlson

To more accurately track the provenance of contributions, brian uses a
work email address for commits created at work. Add this email address
to .mailmap so that contributions are properly attributed to the same
person.

Signed-off-by: brian m. carlson <bk2204@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>