gitweb.git
packed-backend.c: rename a bunch of things and update... Michael Haggerty Mon, 25 Sep 2017 08:00:18 +0000 (10:00 +0200)

packed-backend.c: rename a bunch of things and update comments

We've made huge changes to this file, and some of the old names and
comments are no longer very fitting. So rename a bunch of things:

* `struct packed_ref_cache` → `struct snapshot`
* `acquire_packed_ref_cache()` → `acquire_snapshot()`
* `release_packed_ref_buffer()` → `clear_snapshot_buffer()`
* `release_packed_ref_cache()` → `release_snapshot()`
* `clear_packed_ref_cache()` → `clear_snapshot()`
* `struct packed_ref_entry` → `struct snapshot_record`
* `cmp_packed_ref_entries()` → `cmp_packed_ref_records()`
* `cmp_entry_to_refname()` → `cmp_record_to_refname()`
* `sort_packed_refs()` → `sort_snapshot()`
* `read_packed_refs()` → `create_snapshot()`
* `validate_packed_ref_cache()` → `validate_snapshot()`
* `get_packed_ref_cache()` → `get_snapshot()`
* Renamed local variables and struct members accordingly.

Also update a bunch of comments to reflect the renaming and the
accumulated changes that the code has undergone.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mmapped_ref_iterator: inline into `packed_ref_iterator`Michael Haggerty Mon, 25 Sep 2017 08:00:17 +0000 (10:00 +0200)

mmapped_ref_iterator: inline into `packed_ref_iterator`

Since `packed_ref_iterator` is now delegating to
`mmapped_ref_iterator` rather than `cache_ref_iterator` to do the
heavy lifting, there is no need to keep the two iterators separate. So
"inline" `mmapped_ref_iterator` into `packed_ref_iterator`. This
removes a bunch of boilerplate.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ref_cache: remove support for storing peeled valuesMichael Haggerty Mon, 25 Sep 2017 08:00:16 +0000 (10:00 +0200)

ref_cache: remove support for storing peeled values

Now that the `packed-refs` backend doesn't use `ref_cache`, there is
nobody left who might want to store peeled values of references in
`ref_cache`. So remove that feature.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packed_ref_store: get rid of the `ref_cache` entirelyMichael Haggerty Mon, 25 Sep 2017 08:00:15 +0000 (10:00 +0200)

packed_ref_store: get rid of the `ref_cache` entirely

Now that everything has been changed to read what it needs directly
out of the `packed-refs` file, `packed_ref_store` doesn't need to
maintain a `ref_cache` at all. So get rid of it.

First of all, this will save a lot of memory and lots of little
allocations. Instead of needing to store complicated parsed data
structures in memory, we just mmap the file (potentially sharing
memory with other processes) and parse only what we need.

Moreover, since the mmapped access to the file reads only the parts of
the file that it needs, this might save reading all of the data from
disk at all (at least if the file starts out sorted).

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ref_store: implement `refs_peel_ref()` genericallyMichael Haggerty Mon, 25 Sep 2017 08:00:14 +0000 (10:00 +0200)

ref_store: implement `refs_peel_ref()` generically

We're about to stop storing packed refs in a `ref_cache`. That means
that the only way we have left to optimize `peel_ref()` is by checking
whether the reference being peeled is the one currently being iterated
over (in `current_ref_iter`), and if so, using `ref_iterator_peel()`.
But this can be done generically; it doesn't have to be implemented
per-backend.

So implement `refs_peel_ref()` in `refs.c` and remove the `peel_ref()`
method from the refs API.

This removes the last callers of a couple of functions, so delete
them. More cleanup to come...

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packed_read_raw_ref(): read the reference from the... Michael Haggerty Mon, 25 Sep 2017 08:00:13 +0000 (10:00 +0200)

packed_read_raw_ref(): read the reference from the mmapped buffer

Instead of reading the reference from the `ref_cache`, read it
directly from the mmapped buffer.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packed_ref_iterator_begin(): iterate using `mmapped_ref... Michael Haggerty Mon, 25 Sep 2017 08:00:12 +0000 (10:00 +0200)

packed_ref_iterator_begin(): iterate using `mmapped_ref_iterator`

Now that we have an efficient way to iterate, in order, over the
mmapped contents of the `packed-refs` file, we can use that directly
to implement reference iteration for the `packed_ref_store`, rather
than iterating over the `ref_cache`. This is the next step towards
getting rid of the `ref_cache` entirely.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_packed_refs(): ensure that references are ordered... Michael Haggerty Mon, 25 Sep 2017 08:00:11 +0000 (10:00 +0200)

read_packed_refs(): ensure that references are ordered when read

It doesn't actually matter now, because the references are only
iterated over to fill the associated `ref_cache`, which itself puts
them in the correct order. But we want to get rid of the `ref_cache`,
so we want to be able to iterate directly over the `packed-refs`
buffer, and then the iteration will need to be ordered correctly.

In fact, we already write the `packed-refs` file sorted, but it is
possible that other Git clients don't get it right. So let's not
assume that a `packed-refs` file is sorted unless it is explicitly
declared to be so via a `sorted` trait in its header line.

If it is *not* declared to be sorted, then scan quickly through the
file to check. If it is found to be out of order, then sort the
records into a new memory-only copy. This checking and sorting is done
quickly, without parsing the full file contents. However, it needs a
little bit of care to avoid reading past the end of the buffer even if
the `packed-refs` file is corrupt.

Since *we* always write the file correctly sorted, include that trait
when we write or rewrite a `packed-refs` file. This means that the
scan described in the previous paragraph should only have to be done
for `packed-refs` files that were written by older versions of the Git
command-line client, or by other clients that haven't yet learned to
write the `sorted` trait.

If `packed-refs` was already sorted, then (if the system allows it) we
can use the mmapped file contents directly. But if the system doesn't
allow a file that is currently mmapped to be replaced using
`rename()`, then it would be bad for us to keep the file mmapped for
any longer than necessary. So, on such systems, always make a copy of
the file contents, either as part of the sorting process, or
afterwards.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packed_ref_cache: keep the `packed-refs` file mmapped... Michael Haggerty Mon, 25 Sep 2017 08:00:10 +0000 (10:00 +0200)

packed_ref_cache: keep the `packed-refs` file mmapped if possible

Keep a copy of the `packed-refs` file contents in memory for as long
as a `packed_ref_cache` object is in use:

* If the system allows it, keep the `packed-refs` file mmapped.

* If not (either because the system doesn't support `mmap()` at all,
or because a file that is currently mmapped cannot be replaced via
`rename()`), then make a copy of the file's contents in
heap-allocated space, and keep that around instead.

We base the choice of behavior on a new build-time switch,
`MMAP_PREVENTS_DELETE`. By default, this switch is set for Windows
variants.

After this commit, `MMAP_NONE` and `MMAP_TEMPORARY` are still handled
identically. But the next commit will introduce a difference.

This whole change is still pointless, because we only read the
`packed-refs` file contents immediately after instantiating the
`packed_ref_cache`. But that will soon change.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packed-backend.c: reorder some definitionsMichael Haggerty Mon, 25 Sep 2017 08:00:09 +0000 (10:00 +0200)

packed-backend.c: reorder some definitions

No code has been changed. This will make subsequent patches more
self-contained.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mmapped_ref_iterator_advance(): no peeled value for... Michael Haggerty Mon, 25 Sep 2017 08:00:08 +0000 (10:00 +0200)

mmapped_ref_iterator_advance(): no peeled value for broken refs

If a reference is broken, suppress its peeled value.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

mmapped_ref_iterator: add iterator over a packed-refs... Michael Haggerty Mon, 25 Sep 2017 08:00:07 +0000 (10:00 +0200)

mmapped_ref_iterator: add iterator over a packed-refs file

Add a new `mmapped_ref_iterator`, which can iterate over the
references in an mmapped `packed-refs` file directly. Use this
iterator from `read_packed_refs()` to fill the packed refs cache.

Note that we are not yet willing to promise that the new iterator
generates its output in order. That doesn't matter for now, because
the packed refs cache doesn't care what order it is filled.

This change adds a lot of boilerplate without providing any obvious
benefits. The benefits will come soon, when we get rid of the
`ref_cache` for packed references altogether.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packed_ref_cache: remember the file-wide peeling stateMichael Haggerty Mon, 25 Sep 2017 08:00:06 +0000 (10:00 +0200)

packed_ref_cache: remember the file-wide peeling state

Rather than store the peeling state (i.e., the one defined by traits
in the `packed-refs` file header line) in a local variable in
`read_packed_refs()`, store it permanently in `packed_ref_cache`. This
will be needed when we stop reading all packed refs at once.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_packed_refs(): read references with minimal copyingMichael Haggerty Mon, 25 Sep 2017 08:00:05 +0000 (10:00 +0200)

read_packed_refs(): read references with minimal copying

Instead of copying data from the `packed-refs` file one line at time
and then processing it, process the data in place as much as possible.

Also, instead of processing one line per iteration of the main loop,
process a reference line plus its corresponding peeled line (if
present) together.

Note that this change slightly tightens up the parsing of the
`packed-refs` file. Previously, the parser would have accepted
multiple "peeled" lines for a single reference (ignoring all but the
last one). Now it would reject that.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_packed_refs(): make parsing of the header line... Michael Haggerty Wed, 13 Sep 2017 17:16:01 +0000 (19:16 +0200)

read_packed_refs(): make parsing of the header line more robust

The old code parsed the traits in the `packed-refs` header by looking
for the string " trait " (i.e., the name of the trait with a space on
either side) in the header line. This is fragile, because if any other
implementation of Git forgets to write the trailing space, the last
trait would silently be ignored (and the error might never be
noticed).

So instead, use `string_list_split_in_place()` to split the traits
into tokens then use `unsorted_string_list_has_string()` to look for
the tokens we are interested in. This means that we can read the
traits correctly even if the header line is missing a trailing
space (or indeed, if it is missing the space after the colon, or if it
has multiple spaces somewhere).

However, older Git clients (and perhaps other Git implementations)
still require the surrounding spaces, so we still have to output the
header with a trailing space.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_packed_refs(): only check for a header at the... Michael Haggerty Wed, 13 Sep 2017 17:16:00 +0000 (19:16 +0200)

read_packed_refs(): only check for a header at the top of the file

This tightens up the parsing a bit; previously, stray header-looking
lines would have been processed.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_packed_refs(): use mmap to read the `packed-refs... Michael Haggerty Wed, 13 Sep 2017 17:15:59 +0000 (19:15 +0200)

read_packed_refs(): use mmap to read the `packed-refs` file

It's still done in a pretty stupid way, involving more data copying
than necessary. That will improve in future commits.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

die_unterminated_line(), die_invalid_line(): new functionsMichael Haggerty Wed, 13 Sep 2017 17:15:58 +0000 (19:15 +0200)

die_unterminated_line(), die_invalid_line(): new functions

Extract some helper functions for reporting errors. While we're at it,
prevent them from spewing unlimited output to the terminal. These
functions will soon have more callers.

These functions accept the problematic line as a `(ptr, len)` pair
rather than a NUL-terminated string, and `die_invalid_line()` checks
for an EOL itself, because these calling conventions will be
convenient for future callers. (Efficiency is not a concern here
because these functions are only ever called if the `packed-refs` file
is corrupt.)

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packed_ref_cache: add a backlink to the associated... Michael Haggerty Wed, 13 Sep 2017 17:15:57 +0000 (19:15 +0200)

packed_ref_cache: add a backlink to the associated `packed_ref_store`

It will prove convenient in upcoming patches.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

prefix_ref_iterator: break when we leave the prefixJeff King Wed, 13 Sep 2017 17:15:56 +0000 (19:15 +0200)

prefix_ref_iterator: break when we leave the prefix

If the underlying iterator is ordered, then `prefix_ref_iterator` can
stop as soon as it sees a refname that comes after the prefix. This
will rarely make a big difference now, because `ref_cache_iterator`
only iterates over the directory containing the prefix (and usually
the prefix will span a whole directory anyway). But if *hint, hint* a
future reference backend doesn't itself know where to stop the
iteration, then this optimization will be a big win.

Note that there is no guarantee that the underlying iterator doesn't
include output preceding the prefix, so we have to skip over any
unwanted references before we get to the ones that we want.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

ref_iterator: keep track of whether the iterator output... Michael Haggerty Wed, 13 Sep 2017 17:15:55 +0000 (19:15 +0200)

ref_iterator: keep track of whether the iterator output is ordered

References are iterated over in order by refname, but reflogs are not.
Some consumers of reference iteration care about the difference. Teach
each `ref_iterator` to keep track of whether its output is ordered.

`overlay_ref_iterator` is one of the picky consumers. Add a sanity
check in `overlay_ref_iterator_begin()` to verify that its inputs are
ordered.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

files_transaction_finish(): delete reflogs before refer... Michael Haggerty Fri, 8 Sep 2017 13:51:53 +0000 (15:51 +0200)

files_transaction_finish(): delete reflogs before references

If the deletion steps unexpectedly fail, it is less bad to leave a
reference without its reflog than it is to leave a reflog without its
reference, since the latter is an invalid repository state.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packed-backend: rip out some now-unused codeMichael Haggerty Fri, 8 Sep 2017 13:51:52 +0000 (15:51 +0200)

packed-backend: rip out some now-unused code

Now the outside world interacts with the packed ref store only via the
generic refs API plus a few lock-related functions. This allows us to
delete some functions that are no longer used, thereby completing the
encapsulation of the packed ref store.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

files_ref_store: use a transaction to update packed... Michael Haggerty Fri, 8 Sep 2017 13:51:51 +0000 (15:51 +0200)

files_ref_store: use a transaction to update packed refs

When processing a `files_ref_store` transaction, it is sometimes
necessary to delete some references from the "packed-refs" file. Do
that using a reference transaction conducted against the
`packed_ref_store`.

This change further decouples `files_ref_store` from
`packed_ref_store`. It also fixes multiple problems, including the two
revealed by test cases added in the previous commit.

First, the old code didn't obtain the `packed-refs` lock until
`files_transaction_finish()`. This means that a failure to acquire the
`packed-refs` lock (e.g., due to contention with another process)
wasn't detected until it was too late (problems like this are supposed
to be detected in the "prepare" phase). The new code acquires the
`packed-refs` lock in `files_transaction_prepare()`, the same stage of
the processing when the loose reference locks are being acquired,
removing another reason why the "prepare" phase might succeed and the
"finish" phase might nevertheless fail.

Second, the old code deleted the loose version of a reference before
deleting any packed version of the same reference. This left a moment
when another process might think that the packed version of the
reference is current, which is incorrect. (Even worse, the packed
version of the reference can be arbitrarily old, and might even point
at an object that has since been garbage-collected.)

Third, if a reference deletion fails to acquire the `packed-refs` lock
altogether, then the old code might leave the repository in the
incorrect state (possibly corrupt) described in the previous
paragraph.

Now we activate the new "packed-refs" file (sans any references that
are being deleted) *before* deleting the corresponding loose
references. But we hold the "packed-refs" lock until after the loose
references have been finalized, thus preventing a simultaneous
"pack-refs" process from packing the loose version of the reference in
the time gap, which would otherwise defeat our attempt to delete it.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t1404: demonstrate two problems with reference transactionsMichael Haggerty Fri, 8 Sep 2017 13:51:50 +0000 (15:51 +0200)

t1404: demonstrate two problems with reference transactions

Currently, a loose reference is deleted even before locking the
`packed-refs` file, let alone deleting any packed version of the
reference. This leads to two problems, demonstrated by two new tests:

* While a reference is being deleted, other processes might see the
old, packed value of the reference for a moment before the packed
version is deleted. Normally this would be hard to observe, but we
can prolong the window by locking the `packed-refs` file externally
before running `update-ref`, then unlocking it before `update-ref`'s
attempt to acquire the lock times out.

* If the `packed-refs` file is locked so long that `update-ref` fails
to lock it, then the reference can be left permanently in the
incorrect state described in the previous point.

In a moment, both problems will be fixed.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

files_initial_transaction_commit(): use a transaction... Michael Haggerty Fri, 8 Sep 2017 13:51:49 +0000 (15:51 +0200)

files_initial_transaction_commit(): use a transaction for packed refs

Use a `packed_ref_store` transaction in the implementation of
`files_initial_transaction_commit()` rather than using internal
features of the packed ref store. This further decouples
`files_ref_store` from `packed_ref_store`.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

prune_refs(): also free the linked listMichael Haggerty Fri, 8 Sep 2017 13:51:48 +0000 (15:51 +0200)

prune_refs(): also free the linked list

At least since v1.7, the elements of the `refs_to_prune` linked list
have been leaked. Fix the leak by teaching `prune_refs()` to free the
list elements as it processes them.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

files_pack_refs(): use a reference transaction to write... Michael Haggerty Fri, 8 Sep 2017 13:51:47 +0000 (15:51 +0200)

files_pack_refs(): use a reference transaction to write packed refs

Now that the packed reference store supports transactions, we can use
a transaction to write the packed versions of references that we want
to pack. This decreases the coupling between `files_ref_store` and
`packed_ref_store`.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packed_delete_refs(): implement methodMichael Haggerty Fri, 8 Sep 2017 13:51:46 +0000 (15:51 +0200)

packed_delete_refs(): implement method

Implement `packed_delete_refs()` using a reference transaction. This
means that `files_delete_refs()` can use `refs_delete_refs()` instead
of `repack_without_refs()` to delete any packed references, decreasing
the coupling between the classes.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packed_ref_store: implement reference transactionsMichael Haggerty Fri, 8 Sep 2017 13:51:45 +0000 (15:51 +0200)

packed_ref_store: implement reference transactions

Implement the methods needed to support reference transactions for
the packed-refs backend. The new methods are not yet used.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

struct ref_transaction: add a place for backends to... Michael Haggerty Fri, 8 Sep 2017 13:51:44 +0000 (15:51 +0200)

struct ref_transaction: add a place for backends to store data

`packed_ref_store` is going to want to store some transaction-wide
data, so make a place for it.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

packed-backend: don't adjust the reference count on... Michael Haggerty Fri, 8 Sep 2017 13:51:43 +0000 (15:51 +0200)

packed-backend: don't adjust the reference count on lock/unlock

The old code incremented the packed ref cache reference count when
acquiring the packed-refs lock, and decremented the count when
releasing the lock. This is unnecessary because:

* Another process cannot change the packed-refs file because it is
locked.

* When we ourselves change the packed-refs file, we do so by first
modifying the packed ref-cache, and then writing the data from the
ref-cache to disk. So the packed ref-cache remains fresh because any
changes that we plan to make to the file are made in the cache first
anyway.

So there is no reason for the cache to become stale.

Moreover, the extra reference count causes a problem if we
intentionally clear the packed refs cache, as we sometimes need to do
if we change the cache in anticipation of writing a change to disk,
but then the write to disk fails. In that case, `packed_refs_unlock()`
would have no easy way to find the cache whose reference count it
needs to decrement.

This whole issue will soon become moot due to upcoming changes that
avoid changing the in-memory cache as part of updating the packed-refs
on disk, but this change makes that transition easier.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

The fifth batch post 2.14Junio C Hamano Sun, 27 Aug 2017 06:00:01 +0000 (23:00 -0700)

The fifth batch post 2.14

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

Merge branch 'mg/killed-merge'Junio C Hamano Sun, 27 Aug 2017 05:55:10 +0000 (22:55 -0700)

Merge branch 'mg/killed-merge'

Killing "git merge --edit" before the editor returns control left
the repository in a state with MERGE_MSG but without MERGE_HEAD,
which incorrectly tells the subsequent "git commit" that there was
a squash merge in progress. This has been fixed.

* mg/killed-merge:
merge: save merge state earlier
merge: split write_merge_state in two
merge: clarify call chain
Documentation/git-merge: explain --continue

Merge branch 'jt/packmigrate'Junio C Hamano Sun, 27 Aug 2017 05:55:09 +0000 (22:55 -0700)

Merge branch 'jt/packmigrate'

Code movement to make it easier to hack later.

* jt/packmigrate: (23 commits)
pack: move for_each_packed_object()
pack: move has_pack_index()
pack: move has_sha1_pack()
pack: move find_pack_entry() and make it global
pack: move find_sha1_pack()
pack: move find_pack_entry_one(), is_pack_valid()
pack: move check_pack_index_ptr(), nth_packed_object_offset()
pack: move nth_packed_object_{sha1,oid}
pack: move clear_delta_base_cache(), packed_object_info(), unpack_entry()
pack: move unpack_object_header()
pack: move get_size_from_delta()
pack: move unpack_object_header_buffer()
pack: move {,re}prepare_packed_git and approximate_object_count
pack: move install_packed_git()
pack: move add_packed_git()
pack: move unuse_pack()
pack: move use_pack()
pack: move pack-closing functions
pack: move release_pack_memory()
pack: move open_pack_index(), parse_pack_index()
...

Merge branch 'mh/ref-lock-entry'Junio C Hamano Sun, 27 Aug 2017 05:55:09 +0000 (22:55 -0700)

Merge branch 'mh/ref-lock-entry'

The code to acquire a lock on a reference (e.g. while accepting a
push from a client) used to immediately fail when the reference is
already locked---now it waits for a very short while and retries,
which can make it succeed if the lock holder was holding it during
a read-only operation.

* mh/ref-lock-entry:
refs: retry acquiring reference locks for 100ms

Merge branch 'jt/doc-pack-objects-fix'Junio C Hamano Sun, 27 Aug 2017 05:55:09 +0000 (22:55 -0700)

Merge branch 'jt/doc-pack-objects-fix'

Doc updates.

* jt/doc-pack-objects-fix:
Doc: clarify that pack-objects makes packs, plural

Merge branch 'jc/cutoff-config'Junio C Hamano Sun, 27 Aug 2017 05:55:08 +0000 (22:55 -0700)

Merge branch 'jc/cutoff-config'

"[gc] rerereResolved = 5.days" used to be invalid, as the variable
is defined to take an integer counting the number of days. It now
is allowed.

* jc/cutoff-config:
rerere: allow approxidate in gc.rerereResolved/gc.rerereUnresolved
rerere: represent time duration in timestamp_t internally
t4200: parameterize "rerere gc" custom expiry test
t4200: gather "rerere gc" together
t4200: make "rerere gc" test more robust
t4200: give us a clean slate after "rerere gc" tests

Merge branch 'kw/write-index-reduce-alloc'Junio C Hamano Sun, 27 Aug 2017 05:55:08 +0000 (22:55 -0700)

Merge branch 'kw/write-index-reduce-alloc'

We used to spend more than necessary cycles allocating and freeing
piece of memory while writing each index entry out. This has been
optimized.

* kw/write-index-reduce-alloc:
read-cache: avoid allocating every ondisk entry when writing
read-cache: fix memory leak in do_write_index
perf: add test for writing the index

Merge branch 'bw/submodule-config-cleanup'Junio C Hamano Sun, 27 Aug 2017 05:55:07 +0000 (22:55 -0700)

Merge branch 'bw/submodule-config-cleanup'

Code clean-up to avoid mixing values read from the .gitmodules file
and values read from the .git/config file.

* bw/submodule-config-cleanup:
submodule: remove gitmodules_config
unpack-trees: improve loading of .gitmodules
submodule-config: lazy-load a repository's .gitmodules file
submodule-config: move submodule-config functions to submodule-config.c
submodule-config: remove support for overlaying repository config
diff: stop allowing diff to have submodules configured in .git/config
submodule: remove submodule_config callback routine
unpack-trees: don't respect submodule.update
submodule: don't rely on overlayed config when setting diffopts
fetch: don't overlay config with submodule-config
submodule--helper: don't overlay config in update-clone
submodule--helper: don't overlay config in remote_submodule_branch
add, reset: ensure submodules can be added or reset
submodule: don't use submodule_from_name
t7411: check configuration parsing errors

Merge branch 'js/gitweb-raw-blob-link-in-history'Junio C Hamano Sun, 27 Aug 2017 05:55:07 +0000 (22:55 -0700)

Merge branch 'js/gitweb-raw-blob-link-in-history'

"gitweb" shows a link to visit the 'raw' contents of blbos in the
history overview page.

* js/gitweb-raw-blob-link-in-history:
gitweb: add 'raw' blob_plain link in history overview

Merge branch 'po/object-id'Junio C Hamano Sun, 27 Aug 2017 05:55:06 +0000 (22:55 -0700)

Merge branch 'po/object-id'

* po/object-id:
sha1_file: convert index_stream to struct object_id
sha1_file: convert hash_sha1_file_literally to struct object_id
sha1_file: convert index_fd to struct object_id
sha1_file: convert index_path to struct object_id
read-cache: convert to struct object_id
builtin/hash-object: convert to struct object_id

Merge branch 'jn/vcs-svn-cleanup'Junio C Hamano Sun, 27 Aug 2017 05:55:06 +0000 (22:55 -0700)

Merge branch 'jn/vcs-svn-cleanup'

Code clean-up.

* jn/vcs-svn-cleanup:
vcs-svn: move remaining repo_tree functions to fast_export.h
vcs-svn: remove repo_delete wrapper function
vcs-svn: remove custom mode constants
vcs-svn: remove more unused prototypes and declarations

Merge branch 'bc/vcs-svn-cleanup'Junio C Hamano Sun, 27 Aug 2017 05:55:05 +0000 (22:55 -0700)

Merge branch 'bc/vcs-svn-cleanup'

Code clean-up.

* bc/vcs-svn-cleanup:
vcs-svn: rename repo functions to "svn_repo"
vcs-svn: remove unused prototypes

Merge branch 'tb/apply-with-crlf'Junio C Hamano Sun, 27 Aug 2017 05:55:05 +0000 (22:55 -0700)

Merge branch 'tb/apply-with-crlf'

"git apply" that is used as a better "patch -p1" failed to apply a
taken from a file with CRLF line endings to a file with CRLF line
endings. The root cause was because it misused convert_to_git()
that tried to do "safe-crlf" processing by looking at the index
entry at the same path, which is a nonsense---in that mode, "apply"
is not working on the data in (or derived from) the index at all.
This has been fixed.

* tb/apply-with-crlf:
apply: file commited with CRLF should roundtrip diff and apply
convert: add SAFE_CRLF_KEEP_CRLF

Merge branch 'jt/stash-tests'Junio C Hamano Sun, 27 Aug 2017 05:55:04 +0000 (22:55 -0700)

Merge branch 'jt/stash-tests'

Test update to improve coverage for "git stash" operations.

* jt/stash-tests:
stash: add a test for stashing in a detached state
stash: add a test for when apply fails during stash branch
stash: add a test for stash create with no files

Merge branch 'jk/trailers-parse'Junio C Hamano Sun, 27 Aug 2017 05:55:04 +0000 (22:55 -0700)

Merge branch 'jk/trailers-parse'

"git interpret-trailers" has been taught a "--parse" and a few
other options to make it easier for scripts to grab existing
trailer lines from a commit log message.

* jk/trailers-parse:
doc/interpret-trailers: fix "the this" typo
pretty: support normalization options for %(trailers)
t4205: refactor %(trailers) tests
pretty: move trailer formatting to trailer.c
interpret-trailers: add --parse convenience option
interpret-trailers: add an option to unfold values
interpret-trailers: add an option to show only existing trailers
interpret-trailers: add an option to show only the trailers
trailer: put process_trailers() options into a struct

Merge branch 'pb/trailers-from-command-line'Junio C Hamano Sun, 27 Aug 2017 05:55:04 +0000 (22:55 -0700)

Merge branch 'pb/trailers-from-command-line'

"git interpret-trailers" learned to take the trailer specifications
from the command line that overrides the configured values.

* pb/trailers-from-command-line:
interpret-trailers: fix documentation typo
interpret-trailers: add options for actions
trailers: introduce struct new_trailer_item
trailers: export action enums and corresponding lookup functions

Merge branch 'jt/diff-color-move-fix'Junio C Hamano Sun, 27 Aug 2017 05:55:04 +0000 (22:55 -0700)

Merge branch 'jt/diff-color-move-fix'

A handful of bugfixes and an improvement to "diff --color-moved".

* jt/diff-color-move-fix:
diff: define block by number of alphanumeric chars
diff: respect MIN_BLOCK_LENGTH for last block
diff: avoid redundantly clearing a flag

Merge branch 'sb/diff-color-move'Junio C Hamano Sun, 27 Aug 2017 05:55:03 +0000 (22:55 -0700)

Merge branch 'sb/diff-color-move'

"git diff" has been taught to optionally paint new lines that are
the same as deleted lines elsewhere differently from genuinely new
lines.

* sb/diff-color-move: (25 commits)
diff: document the new --color-moved setting
diff.c: add dimming to moved line detection
diff.c: color moved lines differently, plain mode
diff.c: color moved lines differently
diff.c: buffer all output if asked to
diff.c: emit_diff_symbol learns about DIFF_SYMBOL_SUMMARY
diff.c: emit_diff_symbol learns about DIFF_SYMBOL_STAT_SEP
diff.c: convert word diffing to use emit_diff_symbol
diff.c: convert show_stats to use emit_diff_symbol
diff.c: convert emit_binary_diff_body to use emit_diff_symbol
submodule.c: migrate diff output to use emit_diff_symbol
diff.c: emit_diff_symbol learns DIFF_SYMBOL_REWRITE_DIFF
diff.c: emit_diff_symbol learns about DIFF_SYMBOL_BINARY_FILES
diff.c: emit_diff_symbol learns DIFF_SYMBOL_HEADER
diff.c: emit_diff_symbol learns DIFF_SYMBOL_FILEPAIR_{PLUS, MINUS}
diff.c: emit_diff_symbol learns DIFF_SYMBOL_CONTEXT_INCOMPLETE
diff.c: emit_diff_symbol learns DIFF_SYMBOL_WORDS[_PORCELAIN]
diff.c: migrate emit_line_checked to use emit_diff_symbol
diff.c: emit_diff_symbol learns DIFF_SYMBOL_NO_LF_EOF
diff.c: emit_diff_symbol learns DIFF_SYMBOL_CONTEXT_FRAGINFO
...

The fourth batch post 2.14Junio C Hamano Thu, 24 Aug 2017 17:37:44 +0000 (10:37 -0700)

The fourth batch post 2.14

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

Merge branch 'jk/doc-the-this'Junio C Hamano Thu, 24 Aug 2017 17:20:03 +0000 (10:20 -0700)

Merge branch 'jk/doc-the-this'

Doc clean-up.

* jk/doc-the-this:
doc: fix typo in sendemail.identity

Merge branch 'rs/commit-h-single-parent-cleanup'Junio C Hamano Thu, 24 Aug 2017 17:20:03 +0000 (10:20 -0700)

Merge branch 'rs/commit-h-single-parent-cleanup'

Code clean-up.

* rs/commit-h-single-parent-cleanup:
commit: remove unused inline function single_parent()

Merge branch 'jc/simplify-progress'Junio C Hamano Thu, 24 Aug 2017 17:20:02 +0000 (10:20 -0700)

Merge branch 'jc/simplify-progress'

The API to start showing progress meter after a short delay has
been simplified.

* jc/simplify-progress:
progress: simplify "delayed" progress API

Merge branch 'tc/curl-with-backports'Junio C Hamano Thu, 24 Aug 2017 17:20:02 +0000 (10:20 -0700)

Merge branch 'tc/curl-with-backports'

Updates to the HTTP layer we made recently unconditionally used
features of libCurl without checking the existence of them, causing
compilation errors, which has been fixed. Also migrate the code to
check feature macros, not version numbers, to cope better with
libCurl that vendor ships with backported features.

* tc/curl-with-backports:
http: use a feature check to enable GSSAPI delegation control
http: fix handling of missing CURLPROTO_*

Merge branch 'cc/subprocess-handshake-missing-capabilities'Junio C Hamano Thu, 24 Aug 2017 17:20:02 +0000 (10:20 -0700)

Merge branch 'cc/subprocess-handshake-missing-capabilities'

When handshake with a subprocess filter notices that the process
asked for an unknown capability, Git did not report what program
the offending subprocess was running. This has been corrected.

* cc/subprocess-handshake-missing-capabilities:
sub-process: print the cmd when a capability is unsupported

Merge branch 'rs/object-id'Junio C Hamano Thu, 24 Aug 2017 17:20:02 +0000 (10:20 -0700)

Merge branch 'rs/object-id'

Conversion from uchar[20] to struct object_id continues.

* rs/object-id:
tree-walk: convert fill_tree_descriptor() to object_id

Merge branch 'lg/merge-signoff'Junio C Hamano Thu, 24 Aug 2017 17:20:01 +0000 (10:20 -0700)

Merge branch 'lg/merge-signoff'

"git merge" learned a "--signoff" option to add the Signed-off-by:
trailer with the committer's name.

* lg/merge-signoff:
merge: add a --signoff flag

pack: move for_each_packed_object()Jonathan Tan Fri, 18 Aug 2017 22:20:38 +0000 (15:20 -0700)

pack: move for_each_packed_object()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move has_pack_index()Jonathan Tan Fri, 18 Aug 2017 22:20:37 +0000 (15:20 -0700)

pack: move has_pack_index()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move has_sha1_pack()Jonathan Tan Fri, 18 Aug 2017 22:20:36 +0000 (15:20 -0700)

pack: move has_sha1_pack()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move find_pack_entry() and make it globalJonathan Tan Fri, 18 Aug 2017 22:20:35 +0000 (15:20 -0700)

pack: move find_pack_entry() and make it global

This function needs to be global as it is used by sha1_file.c and will
be used by packfile.c.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move find_sha1_pack()Jonathan Tan Fri, 18 Aug 2017 22:20:34 +0000 (15:20 -0700)

pack: move find_sha1_pack()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move find_pack_entry_one(), is_pack_valid()Jonathan Tan Fri, 18 Aug 2017 22:20:33 +0000 (15:20 -0700)

pack: move find_pack_entry_one(), is_pack_valid()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move check_pack_index_ptr(), nth_packed_object_of... Jonathan Tan Fri, 18 Aug 2017 22:20:32 +0000 (15:20 -0700)

pack: move check_pack_index_ptr(), nth_packed_object_offset()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move nth_packed_object_{sha1,oid}Jonathan Tan Fri, 18 Aug 2017 22:20:31 +0000 (15:20 -0700)

pack: move nth_packed_object_{sha1,oid}

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move clear_delta_base_cache(), packed_object_info... Jonathan Tan Fri, 18 Aug 2017 22:20:30 +0000 (15:20 -0700)

pack: move clear_delta_base_cache(), packed_object_info(), unpack_entry()

Both sha1_file.c and packfile.c now need read_object(), so a copy of
read_object() was created in packfile.c.

This patch makes both mark_bad_packed_object() and has_packed_and_bad()
global. Unlike most of the other patches in this series, these 2
functions need to remain global.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move unpack_object_header()Jonathan Tan Fri, 18 Aug 2017 22:20:29 +0000 (15:20 -0700)

pack: move unpack_object_header()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move get_size_from_delta()Jonathan Tan Fri, 18 Aug 2017 22:20:28 +0000 (15:20 -0700)

pack: move get_size_from_delta()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move unpack_object_header_buffer()Jonathan Tan Fri, 18 Aug 2017 22:20:27 +0000 (15:20 -0700)

pack: move unpack_object_header_buffer()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move {,re}prepare_packed_git and approximate_obje... Jonathan Tan Fri, 18 Aug 2017 22:20:26 +0000 (15:20 -0700)

pack: move {,re}prepare_packed_git and approximate_object_count

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move install_packed_git()Jonathan Tan Fri, 18 Aug 2017 22:20:25 +0000 (15:20 -0700)

pack: move install_packed_git()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move add_packed_git()Jonathan Tan Fri, 18 Aug 2017 22:20:24 +0000 (15:20 -0700)

pack: move add_packed_git()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move unuse_pack()Jonathan Tan Fri, 18 Aug 2017 22:20:23 +0000 (15:20 -0700)

pack: move unuse_pack()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move use_pack()Jonathan Tan Fri, 18 Aug 2017 22:20:22 +0000 (15:20 -0700)

pack: move use_pack()

The function open_packed_git() needs to be temporarily made global. Its
scope will be restored to static in a subsequent commit.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move pack-closing functionsJonathan Tan Fri, 18 Aug 2017 22:20:21 +0000 (15:20 -0700)

pack: move pack-closing functions

The function close_pack_fd() needs to be temporarily made global. Its
scope will be restored to static in a subsequent commit.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move release_pack_memory()Jonathan Tan Fri, 18 Aug 2017 22:20:20 +0000 (15:20 -0700)

pack: move release_pack_memory()

The function unuse_one_window() needs to be temporarily made global. Its
scope will be restored to static in a subsequent commit.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move open_pack_index(), parse_pack_index()Jonathan Tan Fri, 18 Aug 2017 22:20:19 +0000 (15:20 -0700)

pack: move open_pack_index(), parse_pack_index()

alloc_packed_git() in packfile.c is duplicated from sha1_file.c. In a
subsequent commit, alloc_packed_git() will be removed from sha1_file.c.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move pack_report()Jonathan Tan Fri, 18 Aug 2017 22:20:18 +0000 (15:20 -0700)

pack: move pack_report()

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move static state variablesJonathan Tan Fri, 18 Aug 2017 22:20:17 +0000 (15:20 -0700)

pack: move static state variables

sha1_file.c declares some static variables that store packfile-related
state. Move them to packfile.c.

They are temporarily made global, but subsequent commits will restore
their scope back to static.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

pack: move pack name-related functionsJonathan Tan Fri, 18 Aug 2017 22:20:16 +0000 (15:20 -0700)

pack: move pack name-related functions

Currently, sha1_file.c and cache.h contain many functions, both related
to and unrelated to packfiles. This makes both files very large and
causes an unclear separation of concerns.

Create a new file, packfile.c, to hold all packfile-related functions
currently in sha1_file.c. It has a corresponding header packfile.h.

In this commit, the pack name-related functions are moved. Subsequent
commits will move the other functions.

Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Sync with maintJunio C Hamano Wed, 23 Aug 2017 21:36:38 +0000 (14:36 -0700)

Sync with maint

* maint:
Prepare for 2.14.2

Prepare for 2.14.2Junio C Hamano Wed, 23 Aug 2017 21:36:03 +0000 (14:36 -0700)

Prepare for 2.14.2

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

Merge branch 'jt/t1450-fsck-corrupt-packfile' into... Junio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'jt/t1450-fsck-corrupt-packfile' into maint

A test update.

* jt/t1450-fsck-corrupt-packfile:
tests: ensure fsck fails on corrupt packfiles

Merge branch 'jb/t8008-cleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'jb/t8008-cleanup' into maint

Code clean-up.

* jb/t8008-cleanup:
t8008: rely on rev-parse'd HEAD instead of sha1 value

Merge branch 'jt/subprocess-handshake' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'jt/subprocess-handshake' into maint

Code cleanup.

* jt/subprocess-handshake:
sub-process: refactor handshake to common function
Documentation: migrate sub-process docs to header
convert: add "status=delayed" to filter process protocol
convert: refactor capabilities negotiation
convert: move multiple file filter error handling to separate function
convert: put the flags field before the flag itself for consistent style
t0021: write "OUT <size>" only on success
t0021: make debug log file name configurable
t0021: keep filter log files on comparison

Merge branch 'dc/fmt-merge-msg-microcleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:52 +0000 (14:33 -0700)

Merge branch 'dc/fmt-merge-msg-microcleanup' into maint

Code cleanup.

* dc/fmt-merge-msg-microcleanup:
fmt-merge-msg: fix coding style

Merge branch 'ah/doc-wserrorhighlight' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:51 +0000 (14:33 -0700)

Merge branch 'ah/doc-wserrorhighlight' into maint

Doc update.

* ah/doc-wserrorhighlight:
doc: add missing values "none" and "default" for diff.wsErrorHighlight

Merge branch 'cc/ref-is-hidden-microcleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:50 +0000 (14:33 -0700)

Merge branch 'cc/ref-is-hidden-microcleanup' into maint

Code cleanup.

* cc/ref-is-hidden-microcleanup:
refs: use skip_prefix() in ref_is_hidden()

Merge branch 'js/run-process-parallel-api-fix' into... Junio C Hamano Wed, 23 Aug 2017 21:33:49 +0000 (14:33 -0700)

Merge branch 'js/run-process-parallel-api-fix' into maint

API fix.

* js/run-process-parallel-api-fix:
run_processes_parallel: change confusing task_cb convention

Merge branch 'rs/pack-objects-pbase-cleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:48 +0000 (14:33 -0700)

Merge branch 'rs/pack-objects-pbase-cleanup' into maint

Code clean-up.

* rs/pack-objects-pbase-cleanup:
pack-objects: remove unnecessary NULL check

Merge branch 'jt/fsck-code-cleanup' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:48 +0000 (14:33 -0700)

Merge branch 'jt/fsck-code-cleanup' into maint

Code clean-up.

* jt/fsck-code-cleanup:
fsck: cleanup unused variable
object: remove "used" field from struct object
fsck: remove redundant parse_tree() invocation

Merge branch 'rs/stat-data-unaligned-reads-fix' into... Junio C Hamano Wed, 23 Aug 2017 21:33:47 +0000 (14:33 -0700)

Merge branch 'rs/stat-data-unaligned-reads-fix' into maint

Code clean-up.

* rs/stat-data-unaligned-reads-fix:
dir: support platforms that require aligned reads

Merge branch 'rs/move-array' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:46 +0000 (14:33 -0700)

Merge branch 'rs/move-array' into maint

Code clean-up.

* rs/move-array:
ls-files: don't try to prune an empty index
apply: use COPY_ARRAY and MOVE_ARRAY in update_image()
use MOVE_ARRAY
add MOVE_ARRAY

Merge branch 'rs/bswap-ubsan-fix' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:46 +0000 (14:33 -0700)

Merge branch 'rs/bswap-ubsan-fix' into maint

Code clean-up.

* rs/bswap-ubsan-fix:
bswap: convert get_be16, get_be32 and put_be32 to inline functions
bswap: convert to unsigned before shifting in get_be32

Merge branch 'dl/credential-cache-socket-in-xdg-cache... Junio C Hamano Wed, 23 Aug 2017 21:33:45 +0000 (14:33 -0700)

Merge branch 'dl/credential-cache-socket-in-xdg-cache' into maint

A recently added test for the "credential-cache" helper revealed
that EOF detection done around the time the connection to the cache
daemon is torn down were flaky. This was fixed by reacting to
ECONNRESET and behaving as if we got an EOF.

* dl/credential-cache-socket-in-xdg-cache:
credential-cache: interpret an ECONNRESET as an EOF

Merge branch 'hb/gitweb-project-list' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:44 +0000 (14:33 -0700)

Merge branch 'hb/gitweb-project-list' into maint

When a directory is not readable, "gitweb" fails to build the
project list. Work this around by skipping such a directory.

It might end up hiding a problem under the rug and a better
solution might be to loudly complain to the administrator pointing
out the problematic directory, but this will at least make it
"work".

* hb/gitweb-project-list:
gitweb: skip unreadable subdirectories

Merge branch 'ks/commit-abort-on-empty-message-fix... Junio C Hamano Wed, 23 Aug 2017 21:33:44 +0000 (14:33 -0700)

Merge branch 'ks/commit-abort-on-empty-message-fix' into maint

"git commit" when seeing an totally empty message said "you did not
edit the message", which is clearly wrong. The message has been
corrected.

* ks/commit-abort-on-empty-message-fix:
commit: check for empty message before the check for untouched template

Merge branch 'jk/reflog-walk' into maintJunio C Hamano Wed, 23 Aug 2017 21:33:43 +0000 (14:33 -0700)

Merge branch 'jk/reflog-walk' into maint

Numerous bugs in walking of reflogs via "log -g" and friends have
been fixed.

* jk/reflog-walk:
reflog-walk: apply --since/--until to reflog dates
reflog-walk: stop using fake parents
rev-list: check reflog_info before showing usage
get_revision_1(): replace do-while with an early return
log: do not free parents when walking reflog
log: clarify comment about reflog cycles
revision: disallow reflog walking with revs->limited
t1414: document some reflog-walk oddities

Merge branch 'jc/http-sslkey-and-ssl-cert-are-paths... Junio C Hamano Wed, 23 Aug 2017 21:33:43 +0000 (14:33 -0700)

Merge branch 'jc/http-sslkey-and-ssl-cert-are-paths' into maint

The http.{sslkey,sslCert} configuration variables are to be
interpreted as a pathname that honors "~[username]/" prefix, but
weren't, which has been fixed.

* jc/http-sslkey-and-ssl-cert-are-paths:
http.c: http.sslcert and http.sslkey are both pathnames