gitweb.git
grep: fix NO_LIBPCRE1_JIT to fully disable JITCharles Bailey Sun, 12 Nov 2017 16:59:38 +0000 (16:59 +0000)

grep: fix NO_LIBPCRE1_JIT to fully disable JIT

If you have a pcre1 library which is compiled with JIT enabled then
PCRE_STUDY_JIT_COMPILE will be defined whether or not the
NO_LIBPCRE1_JIT configuration is set.

This means that we enable JIT functionality when calling pcre_study
even if NO_LIBPCRE1_JIT has been explicitly set and we just use plain
pcre_exec later.

Fix this by using own macro (GIT_PCRE_STUDY_JIT_COMPILE) which we set to
PCRE_STUDY_JIT_COMPILE only if NO_LIBPCRE1_JIT is not set and define to
0 otherwise, as before.

Reviewed-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t4201: make use of abbreviation in the test more robustCharles Bailey Sun, 12 Nov 2017 15:25:23 +0000 (15:25 +0000)

t4201: make use of abbreviation in the test more robust

The test for '--abbrev' in t4201-shortlog.sh assumes that the commits
generated in the test can always be uniquely abbreviated to 5 hex digits
but this is not always the case. If you were unlucky and happened to run
the test at (say) Thu Jun 22 03:04:49 2017 +0000, you would find that
the first commit generated would collide with a tree object created
later in the same test.

This can be simulated in the version of t4201-shortlog.sh prior to this
commit by setting GIT_COMMITTER_DATE and GIT_AUTHOR_DATE to 1498100689
after sourcing test-lib.sh.

Change the test to test --abbrev=35 instead of --abbrev=5 to almost
completely avoid the possibility of a partial collision and add a call
to test_tick in the setup to make the test repeatable (the latter alone
is sufficient to make it robust enough).

Signed-off-by: Charles Bailey <cbailey32@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: mention "view" as an alternative to "visualize"Robert P. J. Day Sun, 12 Nov 2017 09:30:38 +0000 (04:30 -0500)

bisect: mention "view" as an alternative to "visualize"

Tweak a small number of files to mention "view" as an alternative to
"visualize".

Signed-off-by: Robert P. J. Day <rpjday@crashcourse.ca>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsmonitor: simplify determining the git worktree under... Ben Peart Fri, 10 Nov 2017 21:03:11 +0000 (16:03 -0500)

fsmonitor: simplify determining the git worktree under Windows

Simplify and speed up the process of finding the git worktree when
running on Windows by keeping it in perl and avoiding spawning helper
processes.

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

t/3512: demonstrate unrelated submodule/file conflict... Stefan Beller Sat, 11 Nov 2017 00:04:43 +0000 (16:04 -0800)

t/3512: demonstrate unrelated submodule/file conflict as cherry-pick failure

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

apply: avoid out-of-bounds access in fuzzy_matchlines()René Scharfe Sat, 11 Nov 2017 14:10:19 +0000 (15:10 +0100)

apply: avoid out-of-bounds access in fuzzy_matchlines()

fuzzy_matchlines() uses a pointers to the first and last characters of
two lines to keep track while matching them. This makes it impossible
to deal with empty strings. It accesses characters before the start of
empty lines. It can also access characters after the end when checking
for trailing whitespace in the main loop.

Avoid that by using pointers to the first character and the one *after*
the last one. This is well-defined as long as the latter is not
dereferenced. Basically rewrite the function based on that premise; it
becomes much simpler as a result. There is no need to check for
leading whitespace outside of the main loop anymore.

Reported-by: Mahmoud Al-Qudsi <mqudsi@neosmart.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

doc/SubmittingPatches: correct subject guidanceAdam Dinwoodie Fri, 10 Nov 2017 15:02:50 +0000 (15:02 +0000)

doc/SubmittingPatches: correct subject guidance

The examples and common practice for adding markers such as "RFC" or
"v2" to the subject of patch emails is to have them within the same
brackets as the "PATCH" text, not after the closing bracket. Further,
the practice of `git format-patch` and the like, as well as what appears
to be the more common pratice on the mailing list, is to use "[RFC
PATCH]", not "[PATCH/RFC]".

Update the SubmittingPatches article to match and to reference the
`format-patch` helper arguments, and also make some minor text
clarifications in the area.

Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>
Helped-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsmonitor: store fsmonitor bitmap before splitting... Alex Vandiver Thu, 9 Nov 2017 19:58:10 +0000 (11:58 -0800)

fsmonitor: store fsmonitor bitmap before splitting index

ba1b9cac ("fsmonitor: delay updating state until after split index
is merged", 2017-10-27) resolved the problem of the fsmonitor data
being applied to the non-base index when reading; however, a similar
problem exists when writing the index. Specifically, writing of the
fsmonitor extension happens only after the work to split the index
has been applied -- as such, the information in the index is only
for the non-"base" index, and thus the extension information
contains only partial data.

When saving, compute the ewah bitmap before the index is split, and
store it in the fsmonitor_dirty field, mirroring the behavior that
occurred during reading. fsmonitor_dirty is kept from being leaked by
being freed when the extension data is written -- which always happens
precisely once, no matter the split index configuration.

Signed-off-by: Alex Vandiver <alexmv@dropbox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fsmonitor: read from getcwd(), not the PWD environment... Alex Vandiver Thu, 9 Nov 2017 19:58:09 +0000 (11:58 -0800)

fsmonitor: read from getcwd(), not the PWD environment variable

Though the process has chdir'd to the root of the working tree, the
PWD environment variable is only guaranteed to be updated accordingly
if a shell is involved -- which is not guaranteed to be the case.
That is, if `/usr/bin/perl` is a binary, $ENV{PWD} is unchanged from
whatever spawned `git` -- if `/usr/bin/perl` is a trivial shell
wrapper to the real `perl`, `$ENV{PWD}` will have been updated to the
root of the working copy.

Update to read from the Cwd module using the `getcwd` syscall, not the
PWD environment variable. The Cygwin case is left unchanged, as it
necessarily _does_ go through a shell.

Signed-off-by: Alex Vandiver <alexmv@dropbox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

RelNotes: the third batch for 2.16Junio C Hamano Thu, 9 Nov 2017 05:36:39 +0000 (14:36 +0900)

RelNotes: the third batch for 2.16

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

Merge branch 'js/mingw-redirect-std-handles'Junio C Hamano Thu, 9 Nov 2017 05:31:31 +0000 (14:31 +0900)

Merge branch 'js/mingw-redirect-std-handles'

MinGW updates.

* js/mingw-redirect-std-handles:
mingw: document the standard handle redirection
mingw: optionally redirect stderr/stdout via the same handle
mingw: add experimental feature to redirect standard handles

Merge branch 'js/wincred-empty-cred'Junio C Hamano Thu, 9 Nov 2017 05:31:31 +0000 (14:31 +0900)

Merge branch 'js/wincred-empty-cred'

MinGW updates.

* js/wincred-empty-cred:
wincred: handle empty username/password correctly
t0302: check helper can handle empty credentials

Merge branch 'js/mingw-full-version-in-resources'Junio C Hamano Thu, 9 Nov 2017 05:31:31 +0000 (14:31 +0900)

Merge branch 'js/mingw-full-version-in-resources'

MinGW updates.

* js/mingw-full-version-in-resources:
mingw: include the full version information in the resources

Merge branch 'dk/libsecret-unlock-to-load-fix'Junio C Hamano Thu, 9 Nov 2017 05:31:30 +0000 (14:31 +0900)

Merge branch 'dk/libsecret-unlock-to-load-fix'

The credential helper for libsecret (in contrib/) has been improved
to allow possibly prompting the end user to unlock secrets that are
currently locked (otherwise the secrets may not be loaded).

* dk/libsecret-unlock-to-load-fix:
credential-libsecret: unlock locked secrets

Merge branch 'ks/mailmap'Junio C Hamano Thu, 9 Nov 2017 05:31:29 +0000 (14:31 +0900)

Merge branch 'ks/mailmap'

* ks/mailmap:
mailmap: use Kaartic Sivaraam's new address

Merge branch 'js/early-config'Junio C Hamano Thu, 9 Nov 2017 05:31:29 +0000 (14:31 +0900)

Merge branch 'js/early-config'

Correct start-up sequence so that a repository could be placed
immediately under the root directory again (which was broken at
around Git 2.13).

* js/early-config:
setup: avoid double slashes when looking for HEAD

Merge branch 'sg/travis-fixes'Junio C Hamano Thu, 9 Nov 2017 05:31:28 +0000 (14:31 +0900)

Merge branch 'sg/travis-fixes'

TravisCI build updates.

* sg/travis-fixes:
travis-ci: don't build Git for the static analysis job
travis-ci: fix running P4 and Git LFS tests in Linux build jobs

Merge branch 'bw/diff-opt-impl-to-bitfields'Junio C Hamano Thu, 9 Nov 2017 05:31:27 +0000 (14:31 +0900)

Merge branch 'bw/diff-opt-impl-to-bitfields'

A single-word "unsigned flags" in the diff options is being split
into a structure with many bitfields.

* bw/diff-opt-impl-to-bitfields:
diff: make struct diff_flags members lowercase
diff: remove DIFF_OPT_CLR macro
diff: remove DIFF_OPT_SET macro
diff: remove DIFF_OPT_TST macro
diff: remove touched flags
diff: add flag to indicate textconv was set via cmdline
diff: convert flags to be stored in bitfields
add, reset: use DIFF_OPT_SET macro to set a diff flag

Merge branch 'rs/hex-to-bytes-cleanup'Junio C Hamano Thu, 9 Nov 2017 05:31:27 +0000 (14:31 +0900)

Merge branch 'rs/hex-to-bytes-cleanup'

Code cleanup.

* rs/hex-to-bytes-cleanup:
sha1_file: use hex_to_bytes()
http-push: use hex_to_bytes()
notes: move hex_to_bytes() to hex.c and export it

Merge branch 'ad/5580-unc-tests-on-cygwin'Junio C Hamano Thu, 9 Nov 2017 05:31:27 +0000 (14:31 +0900)

Merge branch 'ad/5580-unc-tests-on-cygwin'

UNC paths are also relevant in Cygwin builds and they are now
tested just like Mingw builds.

* ad/5580-unc-tests-on-cygwin:
t5580: add Cygwin support

Merge branch 'ao/diff-populate-filespec-lstat-errorpath... Junio C Hamano Thu, 9 Nov 2017 05:31:26 +0000 (14:31 +0900)

Merge branch 'ao/diff-populate-filespec-lstat-errorpath-fix'

After an error from lstat(), diff_populate_filespec() function
sometimes still went ahead and used invalid data in struct stat,
which has been fixed.

* ao/diff-populate-filespec-lstat-errorpath-fix:
diff: fix lstat() error handling in diff_populate_filespec()

Merge branch 'sb/blame-config-doc'Junio C Hamano Thu, 9 Nov 2017 05:31:25 +0000 (14:31 +0900)

Merge branch 'sb/blame-config-doc'

Description of blame.{showroot,blankboundary,showemail,date}
configuration variables have been added to "git config --help".

* sb/blame-config-doc:
config: document blame configuration

Merge branch 'jm/relnotes-2.15-typofix'Junio C Hamano Thu, 9 Nov 2017 05:31:25 +0000 (14:31 +0900)

Merge branch 'jm/relnotes-2.15-typofix'

Typofix.

* jm/relnotes-2.15-typofix:
fix typos in 2.15.0 release notes

Merge branch 'tz/fsf-address-update' of ../git-gui... Junio C Hamano Thu, 9 Nov 2017 04:24:43 +0000 (13:24 +0900)

Merge branch 'tz/fsf-address-update' of ../git-gui into tz/fsf-address-update

* 'tz/fsf-address-update' of ../git-gui:
Replace Free Software Foundation address in license notices

Replace Free Software Foundation address in license... Todd Zullinger Tue, 7 Nov 2017 05:39:33 +0000 (00:39 -0500)

Replace Free Software Foundation address in license notices

The mailing address for the FSF has changed over the years. Rather than
updating the address across all files, refer readers to gnu.org, as the
GNU GPL documentation now suggests for license notices. The mailing
address is retained in the full license files (COPYING and LGPL-2.1).

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

Replace Free Software Foundation address in license... Todd Zullinger Tue, 7 Nov 2017 05:39:33 +0000 (00:39 -0500)

Replace Free Software Foundation address in license notices

The mailing address for the FSF has changed over the years. Rather than
updating the address across all files, refer readers to gnu.org, as the
GNU GPL documentation now suggests for license notices. The mailing
address is retained in the full license files (COPYING and LGPL-2.1).

The old address is still present in t/diff-lib/COPYING. This is
intentional, as the file is used in tests and the contents are not
expected to change.

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

rebase -i: fix comment typoAdam Dinwoodie Wed, 8 Nov 2017 13:20:20 +0000 (13:20 +0000)

rebase -i: fix comment typo

Signed-off-by: Adam Dinwoodie <adam@dinwoodie.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

merge-base --fork-point doc: clarify the example and... Junio C Hamano Thu, 9 Nov 2017 02:49:45 +0000 (11:49 +0900)

merge-base --fork-point doc: clarify the example and failure modes

The illustrated history used to explain the `--fork-point` mode
named three keypoint commits B3, B2 and B1 from the oldest to the
newest, which was hard to read. Relabel them to B0, B1, B2. Also
illustrate the history after the rebase using the `--fork-point`
facility was made.

The text already mentions use of reflog, but the description is not
clear what benefit we are trying to gain by using reflog. Clarify
that it is to find the commits that were known to be at the tip of
the remote-tracking branch. This in turn necessitates users to know
the ramifications of the underlying assumptions, namely, expiry of
reflog entries will make it impossible to determine which commits
were at the tip of the remote-tracking branches and we fail when in
doubt (instead of giving a random and incorrect result without even
warning). Another limitation is that it won't be useful if you did
not fork from the tip of a remote-tracking branch but from in the
middle.

Describe them.

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

reduce_heads: fix memory leaksMartin Ågren Tue, 7 Nov 2017 20:39:45 +0000 (21:39 +0100)

reduce_heads: fix memory leaks

We currently have seven callers of `reduce_heads(foo)`. Six of them do
not use the original list `foo` again, and actually, all six of those
end up leaking it.

Introduce and use `reduce_heads_replace(&foo)` as a leak-free version of
`foo = reduce_heads(foo)` to fix several of these. Fix the remaining
leaks using `free_commit_list()`.

While we're here, document `reduce_heads()` and mark it as `extern`.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/merge-base: free commit listsMartin Ågren Tue, 7 Nov 2017 20:39:44 +0000 (21:39 +0100)

builtin/merge-base: free commit lists

In several functions, we iterate through a commit list by assigning
`result = result->next`. As a consequence, we lose the original pointer
and eventually leak the list.

Rewrite the loops so that we keep the original pointers, then call
`free_commit_list()`. Various alternatives were considered:

1) Use `UNLEAK(result)` before the loop. Simple change, but not very
pretty. These would definitely be new lows among our usages of UNLEAK.
2) Use `pop_commit()` when looping. Slightly less simple change, but it
feels slightly preferable to first display the list, then free it.
3) As in this patch, but with `UNLEAK()` instead of freeing. We'd still
go through all the trouble of refactoring the loop, and because it's not
super-obvious that we're about to exit, let's just free the lists -- it
probably doesn't affect the runtime much.

In `handle_independent()` we can drop `result` while we're here and
reuse the `revs`-variable instead. That matches several other users of
`reduce_heads()`. The memory-leak that this hides will be addressed in
the next commit.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-mediawiki: show progress while fetching namespacesAntoine Beaupré Tue, 7 Nov 2017 16:07:01 +0000 (11:07 -0500)

remote-mediawiki: show progress while fetching namespaces

Without this, the fetch process seems hanged while we fetch page
listings across the namespaces. Obviously, it should be possible to
silence this with -q, but that's an issue already present everywhere
in the code and should be fixed separately:

https://github.com/Git-Mediawiki/Git-Mediawiki/issues/30

Signed-off-by: Antoine Beaupré <anarcat@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-mediawiki: process namespaces in orderAntoine Beaupré Tue, 7 Nov 2017 16:07:00 +0000 (11:07 -0500)

remote-mediawiki: process namespaces in order

Ideally, we'd process them in numeric order since that is more
logical, but we can't do that yet since this is where we find the
numeric identifiers in the first place. Lexicographic order is a good
compromise.

Signed-off-by: Antoine Beaupré <anarcat@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-mediawiki: support fetching from (Main) namespaceAntoine Beaupré Tue, 7 Nov 2017 16:06:59 +0000 (11:06 -0500)

remote-mediawiki: support fetching from (Main) namespace

When we specify a list of namespaces to fetch from, by default the MW
API will not fetch from the default namespace, refered to as "(Main)"
in the documentation:

https://www.mediawiki.org/wiki/Manual:Namespace#Built-in_namespaces

I haven't found a way to address that "(Main)" namespace when getting
the namespace ids: indeed, when listing namespaces, there is no
"canonical" field for the main namespace, although there is a "*"
field that is set to "" (empty). So in theory, we could specify the
empty namespace to get the main namespace, but that would make
specifying namespaces harder for the user: we would need to teach
users about the "empty" default namespace. It would also make the code
more complicated: we'd need to parse quotes in the configuration.

So we simply override the query here and allow the user to specify
"(Main)" since that is the publicly documented name.

Signed-off-by: Antoine Beaupré <anarcat@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-mediawiki: skip virtual namespacesAntoine Beaupré Tue, 7 Nov 2017 16:06:58 +0000 (11:06 -0500)

remote-mediawiki: skip virtual namespaces

Virtual namespaces do not correspond to pages in the database and are
automatically generated by MediaWiki. It makes little sense,
therefore, to fetch pages from those namespaces and the MW API doesn't
support listing those pages.

According to the documentation, those virtual namespaces are currently
"Special" (-1) and "Media" (-2) but we treat all negative namespaces
as "virtual" as a future-proofing mechanism.

Signed-off-by: Antoine Beaupré <anarcat@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-mediawiki: show known namespace choices on failureAntoine Beaupré Tue, 7 Nov 2017 16:06:57 +0000 (11:06 -0500)

remote-mediawiki: show known namespace choices on failure

If we fail to find a requested namespace, we should tell the user
which ones we know about, since those were already fetched. This
allows users to fetch all namespaces by specifying a dummy namespace,
failing, then copying the list of namespaces in the config.

Eventually, we should have a flag that allows fetching all namespaces
automatically.

Reviewed-by: Antoine Beaupré <anarcat@debian.org>
Signed-off-by: Antoine Beaupré <anarcat@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

read_index_from(): speed index loading by skipping... Ben Peart Wed, 18 Oct 2017 14:27:25 +0000 (10:27 -0400)

read_index_from(): speed index loading by skipping verification of the entry order

There is code in post_read_index_from() to catch out of order
entries when reading an index file. This order verification is ~13%
of the cost of every call to read_index_from().

Update check_ce_order() so that it skips this verification unless
the "verify_ce_order" global variable is set.

Teach fsck to force this verification.

The effect can be seen using t/perf/p0002-read-cache.sh:

Test HEAD HEAD~1
--------------------------------------------------------------------------------------
0002.1: read_cache/discard_cache 1000 times 0.41(0.04+0.04) 0.50(0.00+0.10) +22.0%

Signed-off-by: Ben Peart <benpeart@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

for-each-ref: test :remotename and :remoterefJohannes Schindelin Tue, 7 Nov 2017 16:31:14 +0000 (17:31 +0100)

for-each-ref: test :remotename and :remoteref

This not only prevents regressions, but also serves as documentation
what this new feature is expected to do.

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

for-each-ref: let upstream/push report the remote ref... J Wyman Tue, 7 Nov 2017 16:31:08 +0000 (17:31 +0100)

for-each-ref: let upstream/push report the remote ref name

There are times when scripts want to know not only the name of the
push branch on the remote, but also the name of the branch as known
by the remote repository.

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

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

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

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

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

Tests: clean up and document submodule helpersJonathan Tan Tue, 7 Nov 2017 18:45:08 +0000 (10:45 -0800)

Tests: clean up and document submodule helpers

Factor out the commonalities from test_submodule_switch() and
test_submodule_forced_switch() in lib-submodule-update.sh, and document
their usage.

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

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

diff: --ignore-cr-at-eolJunio C Hamano Thu, 26 Oct 2017 06:32:27 +0000 (15:32 +0900)

diff: --ignore-cr-at-eol

A new option --ignore-cr-at-eol tells the diff machinery to treat a
carriage-return at the end of a (complete) line as if it does not
exist.

Just like other "--ignore-*" options to ignore various kinds of
whitespace differences, this will help reviewing the real changes
you made without getting distracted by spurious CRLF<->LF conversion
made by your editor program.

Helped-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
[jch: squashed in command line completion by Dscho]
Signed-off-by: Junio C Hamano <gitster@pobox.com>

wt-status: actually ignore submodules when requestedBrandon Williams Mon, 6 Nov 2017 22:08:19 +0000 (14:08 -0800)

wt-status: actually ignore submodules when requested

Since ff6f1f564 (submodule-config: lazy-load a repository's .gitmodules
file, 2017-08-03) rebase interactive fails if there are any submodules
with unstaged changes which have been configured with a value for
'submodule.<name>.ignore' in the repository's config.

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

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

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

Reported-by: Orgad Shaneh <orgads@gmail.com>
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Git/Packet.pm: extract parts of t0021/rot13-filter... Christian Couder Sun, 5 Nov 2017 21:38:36 +0000 (22:38 +0100)

Git/Packet.pm: extract parts of t0021/rot13-filter.pl for reuse

And while at it let's simplify t0021/rot13-filter.pl by
using Git/Packet.pm.

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

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0021/rot13-filter: add capability functionsChristian Couder Sun, 5 Nov 2017 21:38:35 +0000 (22:38 +0100)

t0021/rot13-filter: add capability functions

These function help read and write capabilities.

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

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

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

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

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0021/rot13-filter: refactor checking final lfChristian Couder Sun, 5 Nov 2017 21:38:34 +0000 (22:38 +0100)

t0021/rot13-filter: refactor checking final lf

As checking for a lf character at the end of a buffer
will be useful in another function, let's refactor this
functionality into a small remove_final_lf_or_die()
helper function.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0021/rot13-filter: add packet_initialize()Christian Couder Sun, 5 Nov 2017 21:38:33 +0000 (22:38 +0100)

t0021/rot13-filter: add packet_initialize()

Let's refactor the code to initialize communication into its own
packet_initialize() function, so that we can reuse this
functionality in following patches.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0021/rot13-filter: improve error messageChristian Couder Sun, 5 Nov 2017 21:38:32 +0000 (22:38 +0100)

t0021/rot13-filter: improve error message

If there is no new line at the end of something it receives,
the packet_txt_read() function die()s, but it's difficult to
debug without much context.

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

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0021/rot13-filter: improve 'if .. elsif .. else' styleChristian Couder Sun, 5 Nov 2017 21:38:31 +0000 (22:38 +0100)

t0021/rot13-filter: improve 'if .. elsif .. else' style

Before further refactoring the "t0021/rot13-filter.pl" script,
let's modernize the style of its 'if .. elsif .. else' clauses
to improve its readability by making it more similar to our
other perl scripts.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0021/rot13-filter: refactor packet reading functionsChristian Couder Sun, 5 Nov 2017 21:38:30 +0000 (22:38 +0100)

t0021/rot13-filter: refactor packet reading functions

To make it possible in a following commit to move packet
reading and writing functions into a Packet.pm module,
let's refactor these functions, so they don't handle
printing debug output and exiting.

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

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t0021/rot13-filter: fix list comparisonChristian Couder Sun, 5 Nov 2017 21:38:29 +0000 (22:38 +0100)

t0021/rot13-filter: fix list comparison

Since edcc8581 ("convert: add filter.<driver>.process
option", 2016-10-16) when t0021/rot13-filter.pl was created, list
comparison in this perl script have been quite broken.

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

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-mediawiki: allow fetching namespaces with spacesIngo Ruhnke Mon, 6 Nov 2017 21:19:48 +0000 (16:19 -0500)

remote-mediawiki: allow fetching namespaces with spaces

we still want to use spaces as separators in the config, but we should
allow the user to specify namespaces with spaces, so we use underscore
for this.

Reviewed-by: Antoine Beaupré <anarcat@debian.org>
Signed-off-by: Antoine Beaupré <anarcat@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

remote-mediawiki: add namespace supportKevin Mon, 6 Nov 2017 21:19:47 +0000 (16:19 -0500)

remote-mediawiki: add namespace support

This introduces a new remote.origin.namespaces argument that is a
space-separated list of namespaces. The list of pages extract is then
taken from all the specified namespaces.

Reviewed-by: Antoine Beaupré <anarcat@debian.org>
Signed-off-by: Antoine Beaupré <anarcat@debian.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

RelNotes: the second batch post 2.15 comesJunio C Hamano Mon, 6 Nov 2017 05:31:16 +0000 (14:31 +0900)

RelNotes: the second batch post 2.15 comes

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

Merge branch 'tg/deprecate-stash-save'Junio C Hamano Mon, 6 Nov 2017 05:24:32 +0000 (14:24 +0900)

Merge branch 'tg/deprecate-stash-save'

"git stash save" has been deprecated in favour of "git stash push".

* tg/deprecate-stash-save:
stash: remove now superfluos help for "stash push"
stash: mark "git stash save" deprecated in the man page
stash: replace "git stash save" with "git stash push" in the documentation

Merge branch 'tb/complete-checkout'Junio C Hamano Mon, 6 Nov 2017 05:24:31 +0000 (14:24 +0900)

Merge branch 'tb/complete-checkout'

Command line completion (in contrib/) update.

* tb/complete-checkout:
completion: add remaining flags to checkout

Merge branch 'gc/gitweb-filetest-acl'Junio C Hamano Mon, 6 Nov 2017 05:24:30 +0000 (14:24 +0900)

Merge branch 'gc/gitweb-filetest-acl'

"gitweb" checks if a directory is searchable with Perl's "-x"
operator, which can be enhanced by using "filetest 'access'"
pragma, which now we do.

* gc/gitweb-filetest-acl:
gitweb: use filetest to allow ACLs

Merge branch 'mp/push-pushoption-config'Junio C Hamano Mon, 6 Nov 2017 05:24:30 +0000 (14:24 +0900)

Merge branch 'mp/push-pushoption-config'

The "--push-option=<string>" option to "git push" now defaults to a
list of strings configured via push.pushOption variable.

* mp/push-pushoption-config:
builtin/push.c: add push.pushOption config

Merge branch 'hv/fetch-moved-submodules-on-demand'Junio C Hamano Mon, 6 Nov 2017 05:24:29 +0000 (14:24 +0900)

Merge branch 'hv/fetch-moved-submodules-on-demand'

"git fetch --recurse-submodules" now knows that submodules can be
moved around in the superproject in addition to getting updated,
and finds the ones that need to be fetched accordingly.

* hv/fetch-moved-submodules-on-demand:
submodule: simplify decision tree whether to or not to fetch
implement fetching of moved submodules
fetch: add test to make sure we stay backwards compatible

Merge branch 'jc/check-ref-format-oor'Junio C Hamano Mon, 6 Nov 2017 05:24:28 +0000 (14:24 +0900)

Merge branch 'jc/check-ref-format-oor'

"git check-ref-format --branch @{-1}" bit a "BUG()" when run
outside a repository for obvious reasons; clarify the documentation
and make sure we do not even try to expand the at-mark magic in
such a case, but still call the validation logic for branch names.

* jc/check-ref-format-oor:
check-ref-format doc: --branch validates and expands <branch>
check-ref-format --branch: strip refs/heads/ using skip_prefix
check-ref-format --branch: do not expand @{...} outside repository

Merge branch 'jc/t5601-copy-workaround'Junio C Hamano Mon, 6 Nov 2017 05:24:27 +0000 (14:24 +0900)

Merge branch 'jc/t5601-copy-workaround'

A (possibly flakey) test fix.

* jc/t5601-copy-workaround:
t5601: rm the target file of cp that could still be executing

Merge branch 'bc/object-id'Junio C Hamano Mon, 6 Nov 2017 05:24:27 +0000 (14:24 +0900)

Merge branch 'bc/object-id'

Conversion from uchar[20] to struct object_id continues.

* bc/object-id: (25 commits)
refs/files-backend: convert static functions to object_id
refs: convert read_raw_ref backends to struct object_id
refs: convert peel_object to struct object_id
refs: convert resolve_ref_unsafe to struct object_id
worktree: convert struct worktree to object_id
refs: convert resolve_gitlink_ref to struct object_id
Convert remaining callers of resolve_gitlink_ref to object_id
sha1_file: convert index_path and index_fd to struct object_id
refs: convert reflog_expire parameter to struct object_id
refs: convert read_ref_at to struct object_id
refs: convert peel_ref to struct object_id
builtin/pack-objects: convert to struct object_id
pack-bitmap: convert traverse_bitmap_commit_list to object_id
refs: convert dwim_log to struct object_id
builtin/reflog: convert remaining unsigned char uses to object_id
refs: convert dwim_ref and expand_ref to struct object_id
refs: convert read_ref and read_ref_full to object_id
refs: convert resolve_refdup and refs_resolve_refdup to struct object_id
Convert check_connected to use struct object_id
refs: update ref transactions to use struct object_id
...

Merge branch 'jk/revision-pruning-optim'Junio C Hamano Mon, 6 Nov 2017 05:24:26 +0000 (14:24 +0900)

Merge branch 'jk/revision-pruning-optim'

Pathspec-limited revision traversal was taught not to keep finding
unneeded differences once it knows two trees are different inside
given pathspec.

* jk/revision-pruning-optim:
revision: quit pruning diff more quickly when possible

Merge branch 'ds/find-unique-abbrev-optim'Junio C Hamano Mon, 6 Nov 2017 05:24:25 +0000 (14:24 +0900)

Merge branch 'ds/find-unique-abbrev-optim'

Optimize the code to find shortest unique prefix of object names.

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

Merge branch 'wk/pull-signoff'Junio C Hamano Mon, 6 Nov 2017 05:24:24 +0000 (14:24 +0900)

Merge branch 'wk/pull-signoff'

"git pull" has been taught to accept "--[no-]signoff" option and
pass it down to "git merge".

* wk/pull-signoff:
pull: pass --signoff/--no-signoff to "git merge"

Merge branch 'pc/submodule-helper'Junio C Hamano Mon, 6 Nov 2017 05:24:23 +0000 (14:24 +0900)

Merge branch 'pc/submodule-helper'

GSoC.

* pc/submodule-helper:
submodule: port submodule subcommand 'status' from shell to C
submodule--helper: introduce for_each_listed_submodule()
submodule--helper: introduce get_submodule_displaypath()

Merge branch 'pb/bisect-helper'Junio C Hamano Mon, 6 Nov 2017 05:24:23 +0000 (14:24 +0900)

Merge branch 'pb/bisect-helper'

An early part of piece-by-piece rewrite of "git bisect".

* pb/bisect-helper:
bisect--helper: `is_expected_rev` & `check_expected_revs` shell function in C
t6030: explicitly test for bisection cleanup
bisect--helper: `bisect_clean_state` shell function in C
bisect--helper: `write_terms` shell function in C
bisect--helper: rewrite `check_term_format` shell function in C
bisect--helper: use OPT_CMDMODE instead of OPT_BOOL

Merge branch 'dm/run-command-ignored-hook-advise'Junio C Hamano Mon, 6 Nov 2017 05:24:22 +0000 (14:24 +0900)

Merge branch 'dm/run-command-ignored-hook-advise'

A hook script that is set unexecutable is simply ignored. Git
notifies when such a file is ignored, unless the message is
squelched via advice.ignoredHook configuration.

* dm/run-command-ignored-hook-advise:
run-command: add hint when a hook is ignored

The first batch for 2.16Junio C Hamano Mon, 6 Nov 2017 04:18:22 +0000 (13:18 +0900)

The first batch for 2.16

The most notable change is that we no longer take "git add ''" and
add everything. An empty string is now an error when used as a
pathspec element.

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

Merge branch 'ex/deprecate-empty-pathspec-as-match... Junio C Hamano Mon, 6 Nov 2017 04:11:29 +0000 (13:11 +0900)

Merge branch 'ex/deprecate-empty-pathspec-as-match-all'

The final step to make an empty string as a pathspec element
illegal. We started this by first deprecating and warning a
pathspec that has such an element in 2.11 (Nov 2016).

Hopefully we can merge this down to the 'master' by the end of the
year? A deprecation warning period that is about 1 year does not
sound too bad.

* ex/deprecate-empty-pathspec-as-match-all:
pathspec: die on empty strings as pathspec
t0027: do not use an empty string as a pathspec element

Merge branch 'jk/rebase-i-exec-gitdir-fix'Junio C Hamano Mon, 6 Nov 2017 04:11:28 +0000 (13:11 +0900)

Merge branch 'jk/rebase-i-exec-gitdir-fix'

A recent regression in "git rebase -i" that broke execution of git
commands from subdirectories via "exec" insn has been fixed.

* jk/rebase-i-exec-gitdir-fix:
sequencer: pass absolute GIT_DIR to exec commands

Merge branch 'cn/diff-indent-no-longer-is-experimental'Junio C Hamano Mon, 6 Nov 2017 04:11:27 +0000 (13:11 +0900)

Merge branch 'cn/diff-indent-no-longer-is-experimental'

Doc update.

* cn/diff-indent-no-longer-is-experimental:
diff: --indent-heuristic is no longer experimental

Merge branch 'bw/grep-recurse-submodules'Junio C Hamano Mon, 6 Nov 2017 04:11:27 +0000 (13:11 +0900)

Merge branch 'bw/grep-recurse-submodules'

A broken access to object databases in recent update to "git grep
--recurse-submodules" has been fixed.

* bw/grep-recurse-submodules:
grep: take the read-lock when adding a submodule

Merge branch 'mh/test-local-canary'Junio C Hamano Mon, 6 Nov 2017 04:11:26 +0000 (13:11 +0900)

Merge branch 'mh/test-local-canary'

We try to see if somebody runs our test suite with a shell that
does not support "local" like bash/dash does.

* mh/test-local-canary:
t0000: check whether the shell supports the "local" keyword

Merge branch 'js/submodule-in-excluded'Junio C Hamano Mon, 6 Nov 2017 04:11:26 +0000 (13:11 +0900)

Merge branch 'js/submodule-in-excluded'

"git status --ignored -u" did not stop at a working tree of a
separate project that is embedded in an ignored directory and
listed files in that other project, instead of just showing the
directory itself as ignored.

* js/submodule-in-excluded:
status: do not get confused by submodules in excluded directories

Merge branch 'ao/check-resolve-ref-unsafe-result'Junio C Hamano Mon, 6 Nov 2017 04:11:25 +0000 (13:11 +0900)

Merge branch 'ao/check-resolve-ref-unsafe-result'

"git commit", after making a commit, did not check for errors when
asking on what branch it made the commit, which has been correted.

* ao/check-resolve-ref-unsafe-result:
commit: check result of resolve_ref_unsafe

Merge branch 'jk/misc-resolve-ref-unsafe-fixes'Junio C Hamano Mon, 6 Nov 2017 04:11:24 +0000 (13:11 +0900)

Merge branch 'jk/misc-resolve-ref-unsafe-fixes'

Some codepaths did not check for errors when asking what branch the
HEAD points at, which have been fixed.

* jk/misc-resolve-ref-unsafe-fixes:
worktree: handle broken symrefs in find_shared_symref()
log: handle broken HEAD in decoration check
remote: handle broken symrefs
test-ref-store: avoid passing NULL to printf

Merge branch 'sb/diff-color-moved-use-xdl-recmatch'Junio C Hamano Mon, 6 Nov 2017 04:11:24 +0000 (13:11 +0900)

Merge branch 'sb/diff-color-moved-use-xdl-recmatch'

Instead of using custom line comparison and hashing functions to
implement "moved lines" coloring in the diff output, use the pair
of these functions from lower-layer xdiff/ code.

* sb/diff-color-moved-use-xdl-recmatch:
diff.c: get rid of duplicate implementation
xdiff-interface: export comparing and hashing strings

Merge branch 'jk/diff-color-moved-fix'Junio C Hamano Mon, 6 Nov 2017 04:11:23 +0000 (13:11 +0900)

Merge branch 'jk/diff-color-moved-fix'

The experimental "color moved lines differently in diff output"
feature was buggy around "ignore whitespace changes" edges, whihch
has been corrected.

* jk/diff-color-moved-fix:
diff: handle NULs in get_string_hash()
diff: fix whitespace-skipping with --color-moved
t4015: test the output of "diff --color-moved -b"
t4015: check "negative" case for "-w --color-moved"
t4015: refactor --color-moved whitespace test

Merge branch 'kd/auto-col-with-pager-fix'Junio C Hamano Mon, 6 Nov 2017 04:11:22 +0000 (13:11 +0900)

Merge branch 'kd/auto-col-with-pager-fix'

"auto" as a value for the columnar output configuration ought to
judge "is the output consumed by humans?" with the same criteria as
"auto" for coloured output configuration, i.e. either the standard
output stream is going to tty, or a pager is in use. We forgot the
latter, which has been fixed.

* kd/auto-col-with-pager-fix:
column: do not include pager.c
column: show auto columns when pager is active

Merge branch 'jc/no-cmd-as-subroutine'Junio C Hamano Mon, 6 Nov 2017 04:11:21 +0000 (13:11 +0900)

Merge branch 'jc/no-cmd-as-subroutine'

Calling cmd_foo() as if it is a general purpose helper function is
a no-no. Correct two instances of such to set an example.

* jc/no-cmd-as-subroutine:
merge-ours: do not use cmd_*() as a subroutine
describe: do not use cmd_*() as a subroutine

Merge branch 'ma/lockfile-fixes'Junio C Hamano Mon, 6 Nov 2017 04:11:21 +0000 (13:11 +0900)

Merge branch 'ma/lockfile-fixes'

An earlier update made it possible to use an on-stack in-core
lockfile structure (as opposed to having to deliberately leak an
on-heap one). Many codepaths have been updated to take advantage
of this new facility.

* ma/lockfile-fixes:
read_cache: roll back lock in `update_index_if_able()`
read-cache: leave lock in right state in `write_locked_index()`
read-cache: drop explicit `CLOSE_LOCK`-flag
cache.h: document `write_locked_index()`
apply: remove `newfd` from `struct apply_state`
apply: move lockfile into `apply_state`
cache-tree: simplify locking logic
checkout-index: simplify locking logic
tempfile: fix documentation on `delete_tempfile()`
lockfile: fix documentation on `close_lock_file_gently()`
treewide: prefer lockfiles on the stack
sha1_file: do not leak `lock_file`

wrapper.c: consistently quote filenames in error messagesSimon Ruderich Wed, 1 Nov 2017 14:44:44 +0000 (15:44 +0100)

wrapper.c: consistently quote filenames in error messages

All other error messages in the file use quotes around the file name.

This change removes two translations as "could not write to '%s'" and
"could not close '%s'" are already translated and these two are the only
occurrences without quotes.

Signed-off-by: Simon Ruderich <simon@ruderich.org>
[jc: adjusted tests I noticed were broken by the change]
Signed-off-by: Junio C Hamano <gitster@pobox.com>

fix typos in 2.15.0 release notesJean Carlo Machado Sat, 4 Nov 2017 12:16:16 +0000 (10:16 -0200)

fix typos in 2.15.0 release notes

Signed-off-by: Jean Carlo Machado <contato@jeancarlomachado.com.br>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

refs: update some more docs to use "oid" rather than... Michael Haggerty Sun, 5 Nov 2017 08:42:09 +0000 (09:42 +0100)

refs: update some more docs to use "oid" rather than "sha1"

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

write_packed_entry(): take `object_id` argumentsMichael Haggerty Sun, 5 Nov 2017 08:42:08 +0000 (09:42 +0100)

write_packed_entry(): take `object_id` arguments

Change `write_packed_entry()` to take `struct object_id *` rather than
`unsigned char *` arguments.

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

refs: rename constant `REF_ISPRUNING` to `REF_IS_PRUNING`Michael Haggerty Sun, 5 Nov 2017 08:42:07 +0000 (09:42 +0100)

refs: rename constant `REF_ISPRUNING` to `REF_IS_PRUNING`

Underscores are cheap, and help readability.

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

refs: rename constant `REF_NODEREF` to `REF_NO_DEREF`Michael Haggerty Sun, 5 Nov 2017 08:42:06 +0000 (09:42 +0100)

refs: rename constant `REF_NODEREF` to `REF_NO_DEREF`

Even after working with this code for years, I still see this constant
name as "ref node ref". Rename it to make it's meaning clearer.

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

refs: tidy up and adjust visibility of the `ref_update... Michael Haggerty Sun, 5 Nov 2017 08:42:05 +0000 (09:42 +0100)

refs: tidy up and adjust visibility of the `ref_update` flags

The constants used for `ref_update::flags` were rather disorganized:

* The definitions in `refs.h` were not close to the functions that
used them.

* Maybe constants were defined in `refs-internal.h`, making them
visible to the whole refs module, when in fact they only made sense
for the files backend.

* Their documentation wasn't very consistent and partly still referred
to sha1s rather than oids.

* The numerical values followed no rational scheme

Fix all of these problems. The main functional improvement is that
some constants' visibility is now limited to `files-backend.c`.

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

ref_transaction_add_update(): remove a checkMichael Haggerty Sun, 5 Nov 2017 08:42:04 +0000 (09:42 +0100)

ref_transaction_add_update(): remove a check

We want to make `REF_ISPRUNING` internal to the files backend. For
this to be possible, `ref_transaction_add_update()` mustn't know about
it. So move the check that `REF_ISPRUNING` is only used with
`REF_NODEREF` from this function to `files_transaction_prepare()`.

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

ref_transaction_update(): die on disallowed flagsMichael Haggerty Sun, 5 Nov 2017 08:42:03 +0000 (09:42 +0100)

ref_transaction_update(): die on disallowed flags

Callers shouldn't be passing disallowed flags into
`ref_transaction_update()`. So instead of masking them off, treat it
as a bug if any are set.

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

prune_ref(): call `ref_transaction_add_update()` directlyMichael Haggerty Sun, 5 Nov 2017 08:42:02 +0000 (09:42 +0100)

prune_ref(): call `ref_transaction_add_update()` directly

`prune_ref()` needs to use the `REF_ISPRUNING` flag, but we want to
make that flag private to the files backend. So instead of calling
`ref_transaction_delete()`, which is a public function and therefore
shouldn't allow the `REF_ISPRUNING` flag, change `prune_ref()` to call
`ref_transaction_add_update()`, which is private to the refs
module. (Note that we don't need any of the other services provided by
`ref_transaction_delete()`.)

This allows us to change `ref_transaction_update()` to reject the
`REF_ISPRUNING` flag. Do so by adjusting
`REF_TRANSACTION_UPDATE_ALLOWED_FLAGS`. Also add parentheses to its
definition to avoid potential future mishaps.

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

files_transaction_prepare(): don't leak flags to packed... Michael Haggerty Sun, 5 Nov 2017 08:42:01 +0000 (09:42 +0100)

files_transaction_prepare(): don't leak flags to packed transaction

The files backend uses `ref_update::flags` for several internal flags.
But those flags have no meaning to the packed backend. So when adding
updates for the packed-refs transaction, only use flags that make
sense to the packed backend.

`REF_NODEREF` is part of the public interface, and it's logically what
we want, so include it. In fact it is actually ignored by the packed
backend (which doesn't support symbolic references), but that's its
own business.

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

bisect: fix memory leak when returning best elementMartin Ågren Sun, 5 Nov 2017 20:24:31 +0000 (21:24 +0100)

bisect: fix memory leak when returning best element

When `find_bisection()` returns a single list entry, it leaks the other
entries. Move the to-be-returned item to the front and free the
remainder.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: fix off-by-one error in `best_bisection_sorted()`Martin Ågren Sun, 5 Nov 2017 20:24:30 +0000 (21:24 +0100)

bisect: fix off-by-one error in `best_bisection_sorted()`

After we have sorted the `cnt`-many commits that we have selected, we
place them into the commit list. We then set `p->next` to NULL, but as
we do so, `p` is already pointing one beyond item number `cnt`. Indeed,
we check whether `p` is NULL before dereferencing it.

This only matters if there are TREESAME-commits. Since they should be
skipped, they are not included in `cnt` and we will hit the situation
where we set `p->next` to NULL. As a result, the list will be one longer
than it should be. The last commit in the list will be one which occurs
earlier, or which shouldn't be included.

Do not update `p` the very last round in the loop. This ensures that
after the loop, `p->next` points to the remainder of the list, and we
can set it to NULL. While we're here, free that remainder to fix a
memory leak.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: fix memory leak in `find_bisection()`Martin Ågren Sun, 5 Nov 2017 20:24:29 +0000 (21:24 +0100)

bisect: fix memory leak in `find_bisection()`

`find_bisection()` rebuilds the commit list it is given by reversing it
and skipping uninteresting commits. The uninteresting list entries are
leaked. Free them to fix the leak.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

bisect: change calling-convention of `find_bisection()`Martin Ågren Sun, 5 Nov 2017 20:24:28 +0000 (21:24 +0100)

bisect: change calling-convention of `find_bisection()`

This function takes a commit list and returns a commit list. The
returned list is built by modifying the original list. Thus the caller
should not use the original list again (and after the next commit fixes
a memory leak, it must not).

Change the function signature so that it takes a **list and has void
return type. That should make it harder to misuse this function.

While we're here, document this function.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: document blame configurationStefan Beller Fri, 3 Nov 2017 19:21:58 +0000 (12:21 -0700)

config: document blame configuration

The options are currently only referenced by the git-blame man page,
also explain them in git-config, which is the canonical page to
contain all config options.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

credential-libsecret: unlock locked secretsDennis Kaarsemaker Fri, 3 Nov 2017 20:44:49 +0000 (21:44 +0100)

credential-libsecret: unlock locked secrets

Credentials exposed by the secret service DBUS interface may be locked.
Setting the SECRET_SEARCH_UNLOCK flag will make the secret service
unlock these secrets, possibly prompting the user for credentials to do
so. Without this flag, the secret is simply not loaded.

Signed-off-by: Dennis Kaarsemaker <dennis@kaarsemaker.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

setup: avoid double slashes when looking for HEADJeff King Fri, 3 Nov 2017 12:58:02 +0000 (13:58 +0100)

setup: avoid double slashes when looking for HEAD

Andrew Baumann reported that when called outside of any Git worktree,
`git rev-parse --is-inside-work-tree` eventually tries to access
`//HEAD`, i.e. any `HEAD` file in the root directory, but with a double
slash.

This double slash is not only unintentional, but is allowed by the POSIX
standard to have a special meaning. And most notably on Windows, it
does, where it refers to a UNC path of the form `//server/share/`.

As a consequence, afore-mentioned `rev-parse` call not only looks for
the wrong thing, but it also causes serious delays, as Windows will try
to access a server called `HEAD`. Let's simply avoid the unintended
double slash.

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

mailmap: use Kaartic Sivaraam's new addressKaartic Sivaraam Fri, 3 Nov 2017 05:43:41 +0000 (11:13 +0530)

mailmap: use Kaartic Sivaraam's new address

Map the old address to the new, hopefully more permanent one.

Signed-off-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

imap-send: handle missing response codes gracefullyRené Scharfe Thu, 2 Nov 2017 17:27:05 +0000 (18:27 +0100)

imap-send: handle missing response codes gracefully

Response codes are optional. Exit parse_response_code() early if it's
passed a NULL string, indicating that we reached the end of the reply.
This avoids dereferencing said NULL pointer.

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