gitweb.git
doc: fix inappropriate monospace formattingAndreas Heiduk Mon, 22 Oct 2018 20:45:43 +0000 (22:45 +0200)

doc: fix inappropriate monospace formatting

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: fix ASCII art tab spacingAndreas Heiduk Mon, 22 Oct 2018 20:45:42 +0000 (22:45 +0200)

doc: fix ASCII art tab spacing

Followup to 5dd05ebf ("doc: fix merge-base ASCII art tab spacing", 2016-10-21)

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: clarify boundaries of 'git worktree list --porcelain'Andreas Heiduk Mon, 22 Oct 2018 20:45:41 +0000 (22:45 +0200)

doc: clarify boundaries of 'git worktree list --porcelain'

Defined delimiters for 'git worktree list --porcelain' make the format
easier to parse in scripts. For example

sed -n '/^worktree ID$/,/^$/p'

extracts only the information for the worktree 'ID'.

The format did not changed since [1], only the guaranty is added.

[1] bb9c03b82a (worktree: add 'list' command, 2015-10-08)

Signed-off-by: Andreas Heiduk <asheiduk@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit-reach: fix cast in compare_commits_by_gen()René Scharfe Mon, 1 Oct 2018 19:16:01 +0000 (21:16 +0200)

commit-reach: fix cast in compare_commits_by_gen()

The elements of the array to be sorted are commit pointers, so the
comparison function gets handed references to these pointers, not
pointers to commit objects. Cast to the right type and dereference
once to correctly get the commit reference.

Found using Clang's ASan and t5500.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff: don't attempt to strip prefix from absolute Windo... Johannes Sixt Fri, 19 Oct 2018 16:58:07 +0000 (18:58 +0200)

diff: don't attempt to strip prefix from absolute Windows paths

git diff can be invoked with absolute paths. Typically, this triggers
the --no-index case. Then the absolute paths remain in the file names
that are printed in the output.

There is one peculiarity, though: When the command is invoked from a
a sub-directory in a repository, then it is attempted to strip the
sub-directory from the beginning of relative paths. Yet, to detect a
relative path the code just checks for an initial forward slash.
This mistakes a Windows style path like "D:/base" as a relative path
and the output looks like this, for example:

D:\dir\test\one>git -P diff --numstat D:\dir\base D:\dir\diff
1 1 ir/{base => diff}/1.txt

where the correct output should be

D:\dir\test\one>git -P diff --numstat D:\dir\base D:\dir\diff
1 1 D:/dir/{base => diff}/1.txt

If the sub-directory where 'git diff' is invoked is sufficiently deep
that the prefix becomes longer than the path to be printed, then the
subsequent code accesses the path out of bounds.

Use is_absolute_path() to detect Windows style absolute paths.

One might wonder whether the check for a directory separator that
is visible in the patch context should be changed from == '/' to
is_dir_sep() or not. It turns out not to be necessary. That code
only ever investigates paths that have undergone pathspec
normalization, after which there are only forward slashes even on
Windows.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

receive: denyCurrentBranch=updateinstead should not... Junio C Hamano Fri, 19 Oct 2018 04:57:35 +0000 (13:57 +0900)

receive: denyCurrentBranch=updateinstead should not blindly update

The handling of receive.denyCurrentBranch=updateInstead was added to
a switch statement that handles other values of the variable, but
all the other case arms only checked a condition to reject the
attempted push, or let later logic in the same function to still
intervene, so that a push that does not fast-forward (which is
checked after the switch statement in question) is still rejected.

But the handling of updateInstead incorrectly took immediate effect,
without giving other checks a chance to intervene.

Instead of calling update_worktree() that causes the side effect
immediately, just note the fact that we will need to call the
function later, and first give other checks a chance to reject the
request. After the update-hook gets a chance to reject the push
(which happens as the last step in a series of checks), call
update_worktree() when we earlier detected the need to.

Reported-by: Rajesh Madamanchi
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects (mingw): initialize `packing_data` mutex... Johannes Schindelin Tue, 16 Oct 2018 21:02:52 +0000 (14:02 -0700)

pack-objects (mingw): initialize `packing_data` mutex in the correct spot

In 9ac3f0e5b3e4 (pack-objects: fix performance issues on packing large
deltas, 2018-07-22), a mutex was introduced that is used to guard the
call to set the delta size. This commit even added code to initialize
it, but at an incorrect spot: in `init_threaded_search()`, while the
call to `oe_set_delta_size()` (and hence to `packing_data_lock()`) can
happen in the call chain `check_object()` <- `get_object_details()` <-
`prepare_pack()` <- `cmd_pack_objects()`, which is long before the
`prepare_pack()` function calls `ll_find_deltas()` (which initializes
the threaded search).

Another tell-tale that the mutex was initialized in an incorrect spot is
that the function to initialize it lives in builtin/, while the code
that uses the mutex is defined in a libgit.a header file.

Let's use a more appropriate function: `prepare_packing_data()`, which
not only lives in libgit.a, but *has* to be called before the
`packing_data` struct is used that contains that mutex.

This fixes https://github.com/git-for-windows/git/issues/1839.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects (mingw): demonstrate a segmentation fault... Johannes Schindelin Tue, 16 Oct 2018 21:02:50 +0000 (14:02 -0700)

pack-objects (mingw): demonstrate a segmentation fault with large deltas

There is a problem in the way 9ac3f0e5b3e4 (pack-objects: fix
performance issues on packing large deltas, 2018-07-22) initializes that
mutex in the `packing_data` struct. The problem manifests in a
segmentation fault on Windows, when a mutex (AKA critical section) is
accessed without being initialized. (With pthreads, you apparently do
not really have to initialize them?)

This was reported in https://github.com/git-for-windows/git/issues/1839.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-objects: fix typo 'detla' -> 'delta'Johannes Schindelin Tue, 16 Oct 2018 21:02:49 +0000 (14:02 -0700)

pack-objects: fix typo 'detla' -> 'delta'

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fifth batch for 2.20Junio C Hamano Fri, 19 Oct 2018 04:52:51 +0000 (13:52 +0900)

Fifth batch for 2.20

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'jt/cache-tree-allow-missing-object-in... Junio C Hamano Fri, 19 Oct 2018 04:34:08 +0000 (13:34 +0900)

Merge branch 'jt/cache-tree-allow-missing-object-in-partial-clone'

In a partial clone that will lazily be hydrated from the
originating repository, we generally want to avoid "does this
object exist (locally)?" on objects that we deliberately omitted
when we created the clone. The cache-tree codepath (which is used
to write a tree object out of the index) however insisted that the
object exists, even for paths that are outside of the partial
checkout area. The code has been updated to avoid such a check.

* jt/cache-tree-allow-missing-object-in-partial-clone:
cache-tree: skip some blob checks in partial clone

Merge branch 'tb/filter-alternate-refs'Junio C Hamano Fri, 19 Oct 2018 04:34:08 +0000 (13:34 +0900)

Merge branch 'tb/filter-alternate-refs'

When pushing into a repository that borrows its objects from an
alternate object store, "git receive-pack" that responds to the
push request on the other side lists the tips of refs in the
alternate to reduce the amount of objects transferred. This
sometimes is detrimental when the number of refs in the alternate
is absurdly large, in which case the bandwidth saved in potentially
fewer objects transferred is wasted in excessively large ref
advertisement. The alternate refs that are advertised are now
configurable with a pair of configuration variables.

* tb/filter-alternate-refs:
transport.c: introduce core.alternateRefsPrefixes
transport.c: introduce core.alternateRefsCommand
transport.c: extract 'fill_alternate_refs_command'
transport: drop refnames from for_each_alternate_ref

Merge branch 'jt/avoid-ls-refs'Junio C Hamano Fri, 19 Oct 2018 04:34:07 +0000 (13:34 +0900)

Merge branch 'jt/avoid-ls-refs'

Over some transports, fetching objects with an exact commit object
name can be done without first seeing the ref advertisements. The
code has been optimized to exploit this.

* jt/avoid-ls-refs:
fetch: do not list refs if fetching only hashes
transport: list refs before fetch if necessary
transport: do not list refs if possible
transport: allow skipping of ref listing

Merge branch 'ds/commit-graph-leakfix'Junio C Hamano Fri, 19 Oct 2018 04:34:07 +0000 (13:34 +0900)

Merge branch 'ds/commit-graph-leakfix'

Code clean-up.

* ds/commit-graph-leakfix:
commit-graph: reduce initial oid allocation
builtin/commit-graph.c: UNLEAK variables
commit-graph: clean up leaked memory during write

Merge branch 'jt/non-blob-lazy-fetch'Junio C Hamano Fri, 19 Oct 2018 04:34:07 +0000 (13:34 +0900)

Merge branch 'jt/non-blob-lazy-fetch'

A partial clone that is configured to lazily fetch missing objects
will on-demand issue a "git fetch" request to the originating
repository to fill not-yet-obtained objects. The request has been
optimized for requesting a tree object (and not the leaf blob
objects contained in it) by telling the originating repository that
no blobs are needed.

* jt/non-blob-lazy-fetch:
fetch-pack: exclude blobs when lazy-fetching trees
fetch-pack: avoid object flags if no_dependents

Merge branch 'pw/diff-color-moved-ws-fix'Junio C Hamano Fri, 19 Oct 2018 04:34:06 +0000 (13:34 +0900)

Merge branch 'pw/diff-color-moved-ws-fix'

Various fixes to "diff --color-moved-ws".

* pw/diff-color-moved-ws-fix:
diff --color-moved: fix a memory leak
diff --color-moved-ws: fix another memory leak
diff --color-moved-ws: fix a memory leak
diff --color-moved-ws: fix out of bounds string access
diff --color-moved-ws: fix double free crash

Merge branch 'rs/oidset-on-khash'Junio C Hamano Fri, 19 Oct 2018 04:34:06 +0000 (13:34 +0900)

Merge branch 'rs/oidset-on-khash'

The oidset API was built on top of the oidmap API which in turn is
on the hashmap API. Replace the implementation to build on top of
the khash API and gain performance.

* rs/oidset-on-khash:
oidset: uninline oidset_init()
oidset: use khash
khash: factor out kh_release_*
fetch-pack: load tip_oids eagerly iff needed
fetch-pack: factor out is_unmatched_ref()

Merge branch 'rs/grep-no-recursive'Junio C Hamano Fri, 19 Oct 2018 04:34:05 +0000 (13:34 +0900)

Merge branch 'rs/grep-no-recursive'

Unlike "grep", "git grep" by default recurses to the whole tree.
The command learned "git grep --recursive" option, so that "git
grep --no-recursive" can serve as a synonym to setting the
max-depth to 0.

* rs/grep-no-recursive:
grep: add -r/--[no-]recursive

Merge branch 'nd/help-commands-verbose-by-default'Junio C Hamano Fri, 19 Oct 2018 04:34:05 +0000 (13:34 +0900)

Merge branch 'nd/help-commands-verbose-by-default'

"git help -a" and "git help -av" give different pieces of
information, and generally the "verbose" version is more friendly
to the new users. "git help -a" by default now uses the more
verbose output (with "--no-verbose", you can go back to the
original). Also "git help -av" now lists aliases and external
commands, which it did not used to.

* nd/help-commands-verbose-by-default:
help -a: improve and make --verbose default

Merge branch 'jc/how-to-document-api'Junio C Hamano Fri, 19 Oct 2018 04:34:05 +0000 (13:34 +0900)

Merge branch 'jc/how-to-document-api'

Doc update.

* jc/how-to-document-api:
CodingGuidelines: document the API in *.h files

Merge branch 'sm/show-superproject-while-conflicted'Junio C Hamano Fri, 19 Oct 2018 04:34:04 +0000 (13:34 +0900)

Merge branch 'sm/show-superproject-while-conflicted'

A corner-case bugfix.

* sm/show-superproject-while-conflicted:
rev-parse: --show-superproject-working-tree should work during a merge

Merge branch 'jt/fetch-tips-in-partial-clone'Junio C Hamano Fri, 19 Oct 2018 04:34:04 +0000 (13:34 +0900)

Merge branch 'jt/fetch-tips-in-partial-clone'

"git fetch $repo $object" in a partial clone did not correctly
fetch the asked-for object that is referenced by an object in
promisor packfile, which has been fixed.

* jt/fetch-tips-in-partial-clone:
fetch: in partial clone, check presence of targets
connected: document connectivity in partial clones

Merge branch 'nd/status-refresh-progress'Junio C Hamano Fri, 19 Oct 2018 04:34:03 +0000 (13:34 +0900)

Merge branch 'nd/status-refresh-progress'

"git status" learns to show progress bar when refreshing the index
takes a long time.

* nd/status-refresh-progress:
status: show progress bar if refreshing the index takes too long

Merge branch 'bp/read-cache-parallel'Junio C Hamano Fri, 19 Oct 2018 04:34:03 +0000 (13:34 +0900)

Merge branch 'bp/read-cache-parallel'

A new extension to the index file has been introduced, which allows
the file to be read in parallel.

* bp/read-cache-parallel:
read-cache: load cache entries on worker threads
ieot: add Index Entry Offset Table (IEOT) extension
read-cache: load cache extensions on a worker thread
config: add new index.threads config setting
eoie: add End of Index Entry (EOIE) extension
read-cache: clean up casting and byte decoding
read-cache.c: optimize reading index format v4

Merge branch 'bp/rename-test-env-var'Junio C Hamano Fri, 19 Oct 2018 04:34:03 +0000 (13:34 +0900)

Merge branch 'bp/rename-test-env-var'

Some environment variables that control the runtime options of Git
used during tests are getting renamed for consistency.

* bp/rename-test-env-var:
t0000: do not get self-test disrupted by environment warnings
preload-index: update GIT_FORCE_PRELOAD_TEST support
read-cache: update TEST_GIT_INDEX_VERSION support
fsmonitor: update GIT_TEST_FSMONITOR support
preload-index: use git_env_bool() not getenv() for customization
t/README: correct spelling of "uncommon"

Merge branch 'ss/wt-status-committable'Junio C Hamano Fri, 19 Oct 2018 04:34:02 +0000 (13:34 +0900)

Merge branch 'ss/wt-status-committable'

Code clean-up in the internal machinery used by "git status" and
"git commit --dry-run".

* ss/wt-status-committable:
roll wt_status_state into wt_status and populate in the collect phase
wt-status.c: set the committable flag in the collect phase
t7501: add test of "commit --dry-run --short"
wt-status: rename commitable to committable
wt-status.c: move has_unmerged earlier in the file

Merge branch 'nd/the-index'Junio C Hamano Fri, 19 Oct 2018 04:34:02 +0000 (13:34 +0900)

Merge branch 'nd/the-index'

Various codepaths in the core-ish part learn to work on an
arbitrary in-core index structure, not necessarily the default
instance "the_index".

* nd/the-index: (23 commits)
revision.c: reduce implicit dependency the_repository
revision.c: remove implicit dependency on the_index
ws.c: remove implicit dependency on the_index
tree-diff.c: remove implicit dependency on the_index
submodule.c: remove implicit dependency on the_index
line-range.c: remove implicit dependency on the_index
userdiff.c: remove implicit dependency on the_index
rerere.c: remove implicit dependency on the_index
sha1-file.c: remove implicit dependency on the_index
patch-ids.c: remove implicit dependency on the_index
merge.c: remove implicit dependency on the_index
merge-blobs.c: remove implicit dependency on the_index
ll-merge.c: remove implicit dependency on the_index
diff-lib.c: remove implicit dependency on the_index
read-cache.c: remove implicit dependency on the_index
diff.c: remove implicit dependency on the_index
grep.c: remove implicit dependency on the_index
diff.c: remove the_index dependency in textconv() functions
blame.c: rename "repo" argument to "r"
combine-diff.c: remove implicit dependency on the_index
...

Merge branch 'nd/complete-fetch-multiple-args'Junio C Hamano Fri, 19 Oct 2018 04:34:01 +0000 (13:34 +0900)

Merge branch 'nd/complete-fetch-multiple-args'

Teach bash completion that "git fetch --multiple" only takes remote
names as arguments and no refspecs.

* nd/complete-fetch-multiple-args:
completion: support "git fetch --multiple"

commit-reach: fix first-parent heuristicDerrick Stolee Thu, 18 Oct 2018 17:24:40 +0000 (10:24 -0700)

commit-reach: fix first-parent heuristic

The algorithm in can_all_from_reach_with_flags() performs a depth-
first-search, terminated by generation number, intending to use
a hueristic that "important" commits are found in the first-parent
history. This heuristic is valuable in scenarios like fetch
negotiation.

However, there is a problem! After the search finds a target commit,
it should pop all commits off the stack and mark them as "can reach".
This logic is incorrect, so the algorithm instead walks all reachable
commits above the generation-number cutoff.

The existing algorithm is still an improvement over the previous
algorithm, as the worst-case complexity went from quadratic to linear.
The performance measurement at the time was good, but not dramatic.
By fixing this heuristic, we reduce the number of walked commits.

We can also re-run the performance tests from commit 4fbcca4e
"commit-reach: make can_all_from_reach... linear".

Performance was measured on the Linux repository using
'test-tool reach can_all_from_reach'. The input included rows seeded by
tag values. The "small" case included X-rows as v4.[0-9]* and Y-rows as
v3.[0-9]*. This mimics a (very large) fetch that says "I have all major
v3 releases and want all major v4 releases." The "large" case included
X-rows as "v4.*" and Y-rows as "v3.*". This adds all release-candidate
tags to the set, which does not greatly increase the number of objects
that are considered, but does increase the number of 'from' commits,
demonstrating the quadratic nature of the previous code.

Small Case:

4fbcca4e~1: 0.85 s
4fbcca4e: 0.26 s (num_walked: 1,011,035)
HEAD: 0.14 s (num_walked: 8,601)

Large Case:

4fbcca4e~1: 24.0 s
4fbcca4e: 0.12 s (num_walked: 503,925)
HEAD: 0.06 s (num_walked: 217,243)

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ref-filter: free item->value and item->value->sOlga Telezhnaya Thu, 18 Oct 2018 07:28:54 +0000 (07:28 +0000)

ref-filter: free item->value and item->value->s

Release item->value.
Initialize item->value->s dynamically and then release its resources.
Release some local variables.

Final goal of this patch is to reduce number of memory leaks.

Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ls-remote: release memory instead of UNLEAKOlga Telezhnaya Thu, 18 Oct 2018 07:28:54 +0000 (07:28 +0000)

ls-remote: release memory instead of UNLEAK

Use ref_array_clear() to release memory instead of UNLEAK macros.

Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ref-filter: free memory from used_atomOlga Telezhnaya Thu, 18 Oct 2018 07:28:54 +0000 (07:28 +0000)

ref-filter: free memory from used_atom

Release memory from used_atom variable for reducing number of memory
leaks.

Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

multi-pack-index: avoid dead store for struct progressCarlo Marcelo Arenas Belón Thu, 18 Oct 2018 18:59:20 +0000 (11:59 -0700)

multi-pack-index: avoid dead store for struct progress

it is initialized unconditionally by a call to start_progress
below.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

unpack-trees: avoid dead store for struct progressCarlo Marcelo Arenas Belón Thu, 18 Oct 2018 18:46:04 +0000 (11:46 -0700)

unpack-trees: avoid dead store for struct progress

it is unconditionally initialized a few lines below

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config.mak.dev: enable -Wunused-functionJeff King Thu, 18 Oct 2018 07:05:22 +0000 (03:05 -0400)

config.mak.dev: enable -Wunused-function

We explicitly omitted -Wunused-function when we added
-Wextra, but there is no need: the current code compiles
cleanly with it. And it's worth having, since it can let you
know when there are cascading effects from a cleanup (e.g.,
deleting one function lets you delete its static helpers).

There are cases where we may need an unused function to
exist, but we can handle these easily:

- macro-generated code like commit-slab; there we have the
MAYBE_UNUSED annotation to silence the compiler

- conditional compilation, where we may or may not need a
static helper. These generally fall into one of two
categories:

- the call should not be conditional, but rather the
function body itself should be (and may just be a
no-op on one side of the #if). That keeps the
conditional pollution out of the main code.

- call-chains of static helpers should all be in the
same #if block, so they are all-or-nothing

And if there's some case that doesn't cover, we still
have MAYBE_UNUSED as a fallback.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ci: add optional test variablesDerrick Stolee Wed, 17 Oct 2018 13:00:34 +0000 (06:00 -0700)

ci: add optional test variables

The commit-graph and multi-pack-index features introduce optional
data structures that are not required for normal Git operations.
It is important to run the normal test suite without them enabled,
but it is helpful to also run the test suite using them.

Our continuous integration scripts include a second test stage that
runs with optional GIT_TEST_* variables enabled. Add the following
two variables to that stage:

GIT_TEST_COMMIT_GRAPH
GIT_TEST_MULTI_PACK_INDEX

This will slow down the operation, as we build a commit-graph file
after every 'git commit' operation and build a multi-pack-index
during every 'git repack' operation. However, it is important that
future changes are compatible with these features.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

headers: normalize the spelling of some header guardsRamsay Jones Wed, 17 Oct 2018 22:13:26 +0000 (23:13 +0100)

headers: normalize the spelling of some header guards

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

list-objects: support for skipping tree traversalMatthew DeVore Thu, 18 Oct 2018 00:39:15 +0000 (17:39 -0700)

list-objects: support for skipping tree traversal

The tree:0 filter does not need to traverse the trees that it has
filtered out, so optimize list-objects and list-objects-filter to skip
traversing the trees entirely. Before this patch, we iterated over all
children of the tree, and did nothing for all of them, which was
wasteful.

Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

test-tool: show tool list on errorJeff King Wed, 17 Oct 2018 09:25:07 +0000 (05:25 -0400)

test-tool: show tool list on error

Before we switched to one big test-tool binary, if you
forgot the name of a tool, you could use tab-completion in
the shell to get a hint. But these days, all you get is:

$ t/helper/test-tool approxidate
fatal: There is no test named 'approxidate'

and you're stuck reading the source code to find it. Let's
print a list of the available tools in this case.

Signed-off-by: Jeff King <peff@peff.net>
Reviewed-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc: fix small typo in git show-branchSaulius Gurklys Wed, 17 Oct 2018 05:37:41 +0000 (08:37 +0300)

doc: fix small typo in git show-branch

Fix small typo as in document <glob> is used not <globs>.

Signed-off-by: Saulius Gurklys <s4uliu5@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/submodule--helper: remove debugging leftover... Stefan Beller Tue, 16 Oct 2018 23:45:50 +0000 (16:45 -0700)

builtin/submodule--helper: remove debugging leftover tracing

I noticed 74d4731da1 (submodule--helper: replace connect-gitdir-workingtree
by ensure-core-worktree, 2018-08-13) had two leftover debugging statements
when reading The coverage report [1]. Remove them.

https://public-inbox.org/git/e30a9c05-87d8-1f2b-182c-6d6a5fefe43c@gmail.com/

Signed-off-by: Stefan Beller <sbeller@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch: trivial style fixTao Qingyun Tue, 16 Oct 2018 14:19:20 +0000 (22:19 +0800)

branch: trivial style fix

Signed-off-by: Tao Qingyun <taoqy@ls-a.me>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Revert "subtree: make install targets depend on build... Junio C Hamano Thu, 18 Oct 2018 02:07:17 +0000 (11:07 +0900)

Revert "subtree: make install targets depend on build targets"

This reverts commit 744f7c4c314dc0e7816ac05520e8358c8318187a.

These targets do depend on the fact that each prereq is explicitly
listed via their use of $^, which I failed to notice, and broke the
build.

builtin/branch.c: remove useless branch_getTao Qingyun Tue, 16 Oct 2018 14:54:28 +0000 (22:54 +0800)

builtin/branch.c: remove useless branch_get

branch_get sometimes returns current_branch, which can be NULL (e.g., if
you're on a detached HEAD). Try:

$ git branch HEAD
fatal: no such branch 'HEAD'

$ git branch ''
fatal: no such branch ''

However, it seems weird that we'd check those cases here (and provide
such lousy messages). And indeed, dropping that and letting us
eventually hit create_branch() gives a much better message:

$ git branch HEAD
fatal: 'HEAD' is not a valid branch name.

$ git branch ''
fatal: '' is not a valid branch name.

Signed-off-by: Tao Qingyun <taoqy@ls-a.me>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

subtree: make install targets depend on build targetsChristian Hesse Tue, 16 Oct 2018 07:56:24 +0000 (09:56 +0200)

subtree: make install targets depend on build targets

Now that we have build targets let the install targets depend on them.
Also make the targets phony.

Signed-off-by: Christian Hesse <mail@eworm.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

send-email: also pick up cc addresses from -by trailersRasmus Villemoes Tue, 16 Oct 2018 07:39:23 +0000 (09:39 +0200)

send-email: also pick up cc addresses from -by trailers

When rerolling a patch series, including various Reviewed-by etc. that
may have come in, it is quite convenient to have git-send-email
automatically cc those people.

So pick up any *-by lines, with a new suppression category 'misc-by',
but special-case Signed-off-by, since that already has its own
suppression category. It seems natural to make 'misc-by' implied by
'body'.

Based-on-patch-by: Joe Perches <joe@perches.com>
Signed-off-by: Rasmus Villemoes <rv@rasmusvillemoes.dk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fourth batch for 2.20Junio C Hamano Tue, 16 Oct 2018 07:21:17 +0000 (16:21 +0900)

Fourth batch for 2.20

Signed-off-by: Junio C Hamano <gitster@pobox.com>

Merge branch 'sf/complete-stash-list'Junio C Hamano Tue, 16 Oct 2018 07:16:09 +0000 (16:16 +0900)

Merge branch 'sf/complete-stash-list'

The completion script (in contrib/) learned to complete a handful of
options "git stash list" command takes.

* sf/complete-stash-list:
git-completion.bash: add completion for stash list

Merge branch 'mw/doc-typofixes'Junio C Hamano Tue, 16 Oct 2018 07:16:09 +0000 (16:16 +0900)

Merge branch 'mw/doc-typofixes'

Typofixes.

* mw/doc-typofixes:
docs: typo: s/isimilar/similar/
docs: graph: remove unnecessary `graph_update()' call
docs: typo: s/go/to/

Merge branch 'js/mingw-wants-vista-or-above'Junio C Hamano Tue, 16 Oct 2018 07:16:08 +0000 (16:16 +0900)

Merge branch 'js/mingw-wants-vista-or-above'

The minimum version of Windows supported by Windows port fo Git is
now set to Vista.

* js/mingw-wants-vista-or-above:
mingw: bump the minimum Windows version to Vista
mingw: set _WIN32_WINNT explicitly for Git for Windows
compat/poll: prepare for targeting Windows Vista

Merge branch 'rs/sequencer-oidset-insert-avoids-dups'Junio C Hamano Tue, 16 Oct 2018 07:16:08 +0000 (16:16 +0900)

Merge branch 'rs/sequencer-oidset-insert-avoids-dups'

Code clean-up.

* rs/sequencer-oidset-insert-avoids-dups:
sequencer: use return value of oidset_insert()

Merge branch 'jk/oideq-hasheq-cleanup'Junio C Hamano Tue, 16 Oct 2018 07:16:07 +0000 (16:16 +0900)

Merge branch 'jk/oideq-hasheq-cleanup'

Code clean-up.

* jk/oideq-hasheq-cleanup:
more oideq/hasheq conversions

Merge branch 'ma/mailing-list-address-in-git-help'Junio C Hamano Tue, 16 Oct 2018 07:16:07 +0000 (16:16 +0900)

Merge branch 'ma/mailing-list-address-in-git-help'

Doc update.

* ma/mailing-list-address-in-git-help:
git doc: direct bug reporters to mailing list archive

Merge branch 'nd/packobjectshook-doc-fix'Junio C Hamano Tue, 16 Oct 2018 07:16:07 +0000 (16:16 +0900)

Merge branch 'nd/packobjectshook-doc-fix'

Doc update.

* nd/packobjectshook-doc-fix:
config.txt: correct the note about uploadpack.packObjectsHook

Merge branch 'rt/rebase-typofix'Junio C Hamano Tue, 16 Oct 2018 07:16:06 +0000 (16:16 +0900)

Merge branch 'rt/rebase-typofix'

Typofix.

* rt/rebase-typofix:
git-rebase.sh: fix typos in error messages

Merge branch 'ma/t1400-undebug-test'Junio C Hamano Tue, 16 Oct 2018 07:16:06 +0000 (16:16 +0900)

Merge branch 'ma/t1400-undebug-test'

Test fix.

* ma/t1400-undebug-test:
t1400: drop debug `echo` to actually execute `test`

Merge branch 'ma/commit-graph-docs'Junio C Hamano Tue, 16 Oct 2018 07:16:05 +0000 (16:16 +0900)

Merge branch 'ma/commit-graph-docs'

Doc update.

* ma/commit-graph-docs:
Doc: refer to the "commit-graph file" with dash
git-commit-graph.txt: refer to "*commit*-graph file"
git-commit-graph.txt: typeset more in monospace
git-commit-graph.txt: fix bullet lists

Merge branch 'dz/credential-doc-url-matching-rules'Junio C Hamano Tue, 16 Oct 2018 07:16:05 +0000 (16:16 +0900)

Merge branch 'dz/credential-doc-url-matching-rules'

Doc update.

* dz/credential-doc-url-matching-rules:
doc: clarify gitcredentials path component matching

Merge branch 'en/status-multiple-renames-to-the-same... Junio C Hamano Tue, 16 Oct 2018 07:16:05 +0000 (16:16 +0900)

Merge branch 'en/status-multiple-renames-to-the-same-target-fix'

The code in "git status" sometimes hit an assertion failure. This
was caused by a structure that was reused without cleaning the data
used for the first run, which has been corrected.

* en/status-multiple-renames-to-the-same-target-fix:
commit: fix erroneous BUG, 'multiple renames on the same target? how?'

Merge branch 'ds/reachable-final-cleanup'Junio C Hamano Tue, 16 Oct 2018 07:16:04 +0000 (16:16 +0900)

Merge branch 'ds/reachable-final-cleanup'

Code already in 'master' is further cleaned-up by this patch.

* ds/reachable-final-cleanup:
commit-reach: cleanups in can_all_from_reach...

Merge branch 'jk/check-everything-connected-is-long... Junio C Hamano Tue, 16 Oct 2018 07:16:04 +0000 (16:16 +0900)

Merge branch 'jk/check-everything-connected-is-long-gone'

Comment fix.

* jk/check-everything-connected-is-long-gone:
receive-pack: update comment with check_everything_connected

Merge branch 'jn/gc-auto'Junio C Hamano Tue, 16 Oct 2018 07:16:02 +0000 (16:16 +0900)

Merge branch 'jn/gc-auto'

"gc --auto" ended up calling exit(-1) upon error, which has been
corrected to use exit(1). Also the error reporting behaviour when
daemonized has been updated to exit with zero status when stopping
due to a previously discovered error (which implies there is no
point running gc to improve the situation); we used to exit with
failure in such a case.

* jn/gc-auto:
gc: do not return error for prior errors in daemonized mode

Merge branch 'jn/gc-auto-prep'Junio C Hamano Tue, 16 Oct 2018 07:16:02 +0000 (16:16 +0900)

Merge branch 'jn/gc-auto-prep'

Code clean-up.

* jn/gc-auto-prep:
gc: exit with status 128 on failure
gc: improve handling of errors reading gc.log

Merge branch 'md/test-cleanup'Junio C Hamano Tue, 16 Oct 2018 07:16:01 +0000 (16:16 +0900)

Merge branch 'md/test-cleanup'

Various test scripts have been updated for style and also correct
handling of exit status of various commands.

* md/test-cleanup:
tests: order arguments to git-rev-list properly
t9109: don't swallow Git errors upstream of pipes
tests: don't swallow Git errors upstream of pipes
t/*: fix ordering of expected/observed arguments
tests: standardize pipe placement
Documentation: add shell guidelines
t/README: reformat Do, Don't, Keep in mind lists

Merge branch 'fe/doc-updates'Junio C Hamano Tue, 16 Oct 2018 07:16:01 +0000 (16:16 +0900)

Merge branch 'fe/doc-updates'

Doc updates.

* fe/doc-updates:
git-describe.1: clarify that "human readable" is also git-readable
git-column.1: clarify initial description, provide examples
git-archimport.1: specify what kind of Arch we're talking about

Merge branch 'jn/mailmap-update'Junio C Hamano Tue, 16 Oct 2018 07:16:01 +0000 (16:16 +0900)

Merge branch 'jn/mailmap-update'

The mailmap file update.

* jn/mailmap-update:
mailmap: consistently normalize brian m. carlson's name

Merge branch 'tg/t5551-with-curl-7.61.1'Junio C Hamano Tue, 16 Oct 2018 07:16:00 +0000 (16:16 +0900)

Merge branch 'tg/t5551-with-curl-7.61.1'

Test update.

* tg/t5551-with-curl-7.61.1:
t5551: compare sorted cookies files
t5551: move setup code inside test_expect blocks

Merge branch 'en/merge-cleanup'Junio C Hamano Tue, 16 Oct 2018 07:16:00 +0000 (16:16 +0900)

Merge branch 'en/merge-cleanup'

Code clean-up.

* en/merge-cleanup:
merge-recursive: rename merge_file_1() and merge_content()
merge-recursive: remove final remaining caller of merge_file_one()
merge-recursive: avoid wrapper function when unnecessary and wasteful
merge-recursive: set paths correctly when three-way merging content

Merge branch 'rj/header-check'Junio C Hamano Tue, 16 Oct 2018 07:16:00 +0000 (16:16 +0900)

Merge branch 'rj/header-check'

Header files clean-up.

* rj/header-check:
delta-islands.h: add missing forward declarations (hdr-check)
midx.h: add missing forward declarations (hdr-check)
refs/refs-internal.h: add missing declarations (hdr-check)
refs/packed-backend.h: add missing declaration (hdr-check)
refs/ref-cache.h: add missing declarations (hdr-check)
ewah/ewok_rlw.h: add missing include (hdr-check)
json-writer.h: add missing include (hdr-check)
Makefile: add a hdr-check target

Merge branch 'ma/config-doc-update'Junio C Hamano Tue, 16 Oct 2018 07:16:00 +0000 (16:16 +0900)

Merge branch 'ma/config-doc-update'

Doc update.

* ma/config-doc-update:
git-config.txt: fix 'see: above' note
Doc: use `--type=bool` instead of `--bool`

Merge branch 'jk/delta-islands-with-bitmap-reuse-delta... Junio C Hamano Tue, 16 Oct 2018 07:16:00 +0000 (16:16 +0900)

Merge branch 'jk/delta-islands-with-bitmap-reuse-delta-fix'

Fix interactions between two recent topics.

* jk/delta-islands-with-bitmap-reuse-delta-fix:
pack-objects: handle island check for "external" delta base

Merge branch 'tq/refs-internal-comment-fix'Junio C Hamano Tue, 16 Oct 2018 07:15:59 +0000 (16:15 +0900)

Merge branch 'tq/refs-internal-comment-fix'

Fix for typo in a sample code in comment.

* tq/refs-internal-comment-fix:
refs: docstring typo

Merge branch 'ts/alias-of-alias'Junio C Hamano Tue, 16 Oct 2018 07:15:59 +0000 (16:15 +0900)

Merge branch 'ts/alias-of-alias'

An alias that expands to another alias has so far been forbidden,
but now it is allowed to create such an alias.

* ts/alias-of-alias:
t0014: introduce an alias testing suite
alias: show the call history when an alias is looping
alias: add support for aliases of an alias

Merge branch 'ds/commit-graph-with-grafts'Junio C Hamano Tue, 16 Oct 2018 07:15:59 +0000 (16:15 +0900)

Merge branch 'ds/commit-graph-with-grafts'

The recently introduced commit-graph auxiliary data is incompatible
with mechanisms such as replace & grafts that "breaks" immutable
nature of the object reference relationship. Disable optimizations
based on its use (and updating existing commit-graph) when these
incompatible features are in use in the repository.

* ds/commit-graph-with-grafts:
commit-graph: close_commit_graph before shallow walk
commit-graph: not compatible with uninitialized repo
commit-graph: not compatible with grafts
commit-graph: not compatible with replace objects
test-repository: properly init repo
commit-graph: update design document
refs.c: upgrade for_each_replace_ref to be a each_repo_ref_fn callback
refs.c: migrate internal ref iteration to pass thru repository argument

Merge branch 'ab/commit-graph-progress'Junio C Hamano Tue, 16 Oct 2018 07:15:58 +0000 (16:15 +0900)

Merge branch 'ab/commit-graph-progress'

Generation of (experimental) commit-graph files have so far been
fairly silent, even though it takes noticeable amount of time in a
meaningfully large repository. The users will now see progress
output.

* ab/commit-graph-progress:
gc: fix regression in 7b0f229222 impacting --quiet
commit-graph verify: add progress output
commit-graph write: add progress output

git-p4: fully support unshelving changelistsLuke Diamand Mon, 15 Oct 2018 11:14:08 +0000 (12:14 +0100)

git-p4: fully support unshelving changelists

The previous git-p4 unshelve support would check for changes
in Perforce to the files being unshelved since the original
shelve, and would complain if any were found.

This was to ensure that the user wouldn't end up with both the
shelved change delta, and some deltas from other changes in their
git commit.

e.g. given fileA:
the
quick
brown
fox

change1: s/the/The/ <- p4 shelve this change
change2: s/fox/Fox/ <- p4 submit this change
git p4 unshelve 1 <- FAIL

This change teaches the P4Unshelve class to always create a parent
commit which matches the P4 tree (for the files being unshelved) at
the point prior to the P4 shelve being created (which is reported
in the p4 description for a shelved changelist).

That then means git-p4 can always create a git commit matching the
P4 shelve that was originally created, without any extra deltas.

The user might still need to use the --origin option though - there
is no way for git-p4 to work out the versions of all of the other
*unchanged* files in the shelve, since this information is not recorded
by Perforce.

Additionally this fixes handling of shelved 'move' operations.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-p4: unshelve into refs/remotes/p4-unshelved, not... Luke Diamand Mon, 15 Oct 2018 11:14:07 +0000 (12:14 +0100)

git-p4: unshelve into refs/remotes/p4-unshelved, not refs/remotes/p4/unshelved

The branch detection code looks for branches under refs/remotes/p4/...
and can end up getting confused if there are unshelved changes in
there as well. This happens in the function p4BranchesInGit().

Instead, put the unshelved changes into refs/remotes/p4-unshelved/<N>.

Signed-off-by: Luke Diamand <luke@diamand.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mingw: use domain information for default emailJohannes Schindelin Mon, 15 Oct 2018 09:47:08 +0000 (02:47 -0700)

mingw: use domain information for default email

When a user is registered in a Windows domain, it is really easy to
obtain the email address. So let's do that.

Suggested by Lutz Roeder.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

getpwuid(mingw): provide a better default for the user... Johannes Schindelin Mon, 15 Oct 2018 09:47:06 +0000 (02:47 -0700)

getpwuid(mingw): provide a better default for the user name

We do have the excellent GetUserInfoEx() function to obtain more
detailed information of the current user (if the user is part of a
Windows domain); Let's use it.

Suggested by Lutz Roeder.

To avoid the cost of loading Secur32.dll (even lazily, loading DLLs
takes a non-neglibile amount of time), we use the established technique
to load DLLs only when, and if, needed.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

getpwuid(mingw): initialize the structure only onceJohannes Schindelin Mon, 15 Oct 2018 09:47:05 +0000 (02:47 -0700)

getpwuid(mingw): initialize the structure only once

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fuzz: add fuzz testing for packfile indices.Josh Steadmon Sat, 13 Oct 2018 00:58:41 +0000 (17:58 -0700)

fuzz: add fuzz testing for packfile indices.

Breaks the majority of check_packed_git_idx() into a separate function,
load_idx(). The latter function operates on arbitrary buffers, which
makes it suitable as a fuzzing test target.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fuzz: add basic fuzz testing target.Josh Steadmon Sat, 13 Oct 2018 00:58:40 +0000 (17:58 -0700)

fuzz: add basic fuzz testing target.

fuzz-pack-headers.c provides a fuzzing entry point compatible with
libFuzzer (and possibly other fuzzing engines).

Signed-off-by: Josh Steadmon <steadmon@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rerere: convert to use the_hash_algobrian m. carlson Mon, 15 Oct 2018 00:02:02 +0000 (00:02 +0000)

rerere: convert to use the_hash_algo

Since this data is stored in the .git directory, it makes sense for us
to use the same hash algorithm for it as for everything else. Convert
the remaining uses of SHA-1 to use the_hash_algo. Use GIT_MAX_RAWSZ for
allocations. Rename various struct members, local variables, and a
function to be named "hash" instead of "sha1".

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule: make zero-oid comparison hash function agnosticbrian m. carlson Mon, 15 Oct 2018 00:02:01 +0000 (00:02 +0000)

submodule: make zero-oid comparison hash function agnostic

With SHA-256, the length of the all-zeros object ID is longer. Add a
function to git-submodule.sh to check if a full hex object ID is the
all-zeros value, and use it to check the output we're parsing from git
diff-files or diff-index.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply: rename new_sha1_prefix and old_sha1_prefixbrian m. carlson Mon, 15 Oct 2018 00:02:00 +0000 (00:02 +0000)

apply: rename new_sha1_prefix and old_sha1_prefix

Rename these structure members to "new_oid_prefix" and "old_oid_prefix".

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply: replace hard-coded constantsbrian m. carlson Mon, 15 Oct 2018 00:01:59 +0000 (00:01 +0000)

apply: replace hard-coded constants

Replace several 40-based constants with references to GIT_MAX_HEXSZ or
the_hash_algo, as appropriate.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

tag: express constant in terms of the_hash_algobrian m. carlson Mon, 15 Oct 2018 00:01:58 +0000 (00:01 +0000)

tag: express constant in terms of the_hash_algo

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

transport: use parse_oid_hex instead of a constantbrian m. carlson Mon, 15 Oct 2018 00:01:57 +0000 (00:01 +0000)

transport: use parse_oid_hex instead of a constant

Use parse_oid_hex to compute a pointer instead of using GIT_SHA1_HEXSZ.
This simplifies the code and makes it independent of the hash length.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

upload-pack: express constants in terms of the_hash_algobrian m. carlson Mon, 15 Oct 2018 00:01:56 +0000 (00:01 +0000)

upload-pack: express constants in terms of the_hash_algo

Convert all uses of the GIT_SHA1_HEXSZ to use the_hash_algo so that they
are appropriate for any given hash length.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs/packed-backend: express constants using the_hash_algobrian m. carlson Mon, 15 Oct 2018 00:01:55 +0000 (00:01 +0000)

refs/packed-backend: express constants using the_hash_algo

Switch uses of GIT_SHA1_HEXSZ to use the_hash_algo so that they are
appropriate for the any given hash length.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packfile: express constants in terms of the_hash_algobrian m. carlson Mon, 15 Oct 2018 00:01:54 +0000 (00:01 +0000)

packfile: express constants in terms of the_hash_algo

Replace uses of GIT_SHA1_RAWSZ with references to the_hash_algo to avoid
dependence on a particular hash length.

It's likely that in the future, we'll update the pack format to indicate
what hash algorithm it uses, and then this code will change. However,
at least on an interim basis, make it easier to develop on a pure
SHA-256 Git by using the_hash_algo here.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-revindex: express constants in terms of the_hash_algobrian m. carlson Mon, 15 Oct 2018 00:01:53 +0000 (00:01 +0000)

pack-revindex: express constants in terms of the_hash_algo

Express the various constants used in terms of the_hash_algo.
While we're at it, fix a comment style issue as well.

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/fetch-pack: remove constants with parse_oid_hexbrian m. carlson Mon, 15 Oct 2018 00:01:52 +0000 (00:01 +0000)

builtin/fetch-pack: remove constants with parse_oid_hex

Instead of using GIT_SHA1_HEXSZ, use parse_oid_hex to compute a pointer
and use that in comparisons. This is both simpler to read and works
independent of the hash length. Update references to SHA-1 in the same
function to refer to object IDs instead.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/mktree: remove hard-coded constantbrian m. carlson Mon, 15 Oct 2018 00:01:51 +0000 (00:01 +0000)

builtin/mktree: remove hard-coded constant

Instead of using a hard-coded constant for the size of a hex object ID,
switch to use the computed pointer from parse_oid_hex that points after
the parsed object ID.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/repack: replace hard-coded constantsbrian m. carlson Mon, 15 Oct 2018 00:01:50 +0000 (00:01 +0000)

builtin/repack: replace hard-coded constants

Note that while the error messages here are not translated, the end user
should never see them. We invoke git pack-objects shortly before both
invocations, so we can be fairly certain that the data we're receiving
is in fact valid.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack-bitmap-write: use GIT_MAX_RAWSZ for allocationbrian m. carlson Mon, 15 Oct 2018 00:01:49 +0000 (00:01 +0000)

pack-bitmap-write: use GIT_MAX_RAWSZ for allocation

Reviewed-by: Stefan Beller <sbeller@google.com>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

object_id.cocci: match only expressions of type 'struct... SZEDER Gábor Mon, 15 Oct 2018 00:01:48 +0000 (00:01 +0000)

object_id.cocci: match only expressions of type 'struct object_id'

Most of our semantic patches in 'contrib/coccinelle/object_id.cocci'
turn calls of SHA1-specific functions into calls of their
corresponding object_id counterparts, e.g. sha1_to_hex() to
oid_to_hex(). These semantic patches look something like this:

@@
expression E1;
@@
- sha1_to_hex(E1.hash)
+ oid_to_hex(&E1)

and match the access to the 'hash' field in any data type, not only in
'struct object_id', and, consquently, can produce wrong
transformations.

Case in point is the recent hash function transition patch "rerere:
convert to use the_hash_algo" [1], which, among other things, renamed
'struct rerere_dir's 'sha1' field to 'hash', and then 'make
coccicheck' started to suggest the following wrong transformations for
'rerere.c' [2]:

- return sha1_to_hex(id->collection->hash);
+ return oid_to_hex(id->collection);

and

- DIR *dir = opendir(git_path("rr-cache/%s", sha1_to_hex(rr_dir->hash)));
+ DIR *dir = opendir(git_path("rr-cache/%s", oid_to_hex(rr_dir)));

Avoid such wrong transformations by tightening semantic patches in
'object_id.cocci' to match only type of or pointers to 'struct
object_id'.

[1] https://public-inbox.org/git/20181008215701.779099-15-sandals@crustytoothpaste.net/
[2] https://travis-ci.org/git/git/jobs/440463476#L580

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

filter-trees: code clean-up of testsMatthew DeVore Fri, 12 Oct 2018 20:01:41 +0000 (13:01 -0700)

filter-trees: code clean-up of tests

A few trivial updates to test to match the current best practices.

- avoid "grep -q" that strips potentially useful output from tests
running under "-v".

- use test_write_lines to prepare multi-line expected output file.

- reserve use of test_must_fail to "git" commands.

Signed-off-by: Matthew DeVore <matvore@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

subtree: performance improvement for finding unexpected... Roger Strain Fri, 12 Oct 2018 13:52:18 +0000 (08:52 -0500)

subtree: performance improvement for finding unexpected parent commits

After testing a previous patch at larger scale, a performance issue was
detected when using git show to locate parent revisions, with a single
run of the git show command taking 2 seconds or longer in a complex repo.
When the command is required tens or hundreds of times in a run of the
script, the additional wait time is unaccepatable. Replacing the command
with git rev-parse resulted in significantly increased performance, with
the command in question returning instantly.

Signed-off-by: Roger Strain <rstrain@swri.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

diff.c: pass sign_index to emit_line_ws_markupStefan Beller Wed, 10 Oct 2018 23:24:59 +0000 (16:24 -0700)

diff.c: pass sign_index to emit_line_ws_markup

Instead of passing the sign directly to emit_line_ws_markup, pass only the
index to lookup the sign in diff_options->output_indicators.

Signed-off-by: Stefan Beller <sbeller@google.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>