gitweb.git
sequencer.c: remove a stray semicolonNguyễn Thái Ngọc Duy Sat, 3 Nov 2018 14:32:29 +0000 (15:32 +0100)

sequencer.c: remove a stray semicolon

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: move rebase--helper modes to rebase--interactiveAlban Gruin Thu, 27 Sep 2018 21:56:10 +0000 (23:56 +0200)

rebase -i: move rebase--helper modes to rebase--interactive

This moves the rebase--helper modes still used by
git-rebase--preserve-merges.sh (`--shorten-ids`, `--expand-ids`,
`--check-todo-list`, `--rearrange-squash` and `--add-exec-commands`) to
rebase--interactive.c.

git-rebase--preserve-merges.sh is modified accordingly, and
rebase--helper.c is removed as it is useless now.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: remove git-rebase--interactive.shAlban Gruin Thu, 27 Sep 2018 21:56:09 +0000 (23:56 +0200)

rebase -i: remove git-rebase--interactive.sh

This removes git-rebase--interactive.sh, as its functionnality has been
replaced by git-rebase--interactive2.

git-rebase--interactive2.c is then renamed to git-rebase--interactive.c.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase--interactive2: rewrite the submodes of interacti... Alban Gruin Thu, 27 Sep 2018 21:56:08 +0000 (23:56 +0200)

rebase--interactive2: rewrite the submodes of interactive rebase in C

This rewrites the submodes of interactive rebase (`--continue`,
`--skip`, `--edit-todo`, and `--show-current-patch`) in C.

git-rebase.sh is then modified to call directly git-rebase--interactive2
instead of git-rebase--interactive.sh.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: implement the main part of interactive rebas... Alban Gruin Thu, 27 Sep 2018 21:56:07 +0000 (23:56 +0200)

rebase -i: implement the main part of interactive rebase as a builtin

This rewrites the part of interactive rebase which initializes the
basic state, make the script and complete the action, as a buitin, named
git-rebase--interactive2 for now. Others modes (`--continue`,
`--edit-todo`, etc.) will be rewritten in the next commit.

git-rebase--interactive.sh is modified to call git-rebase--interactive2
instead of git-rebase--helper.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: rewrite init_basic_state() in CAlban Gruin Tue, 28 Aug 2018 12:10:41 +0000 (14:10 +0200)

rebase -i: rewrite init_basic_state() in C

This rewrites init_basic_state() from shell to C. The call to
write_basic_state() in cmd_rebase__helper() is replaced by a call to the
new function.

The shell version is then stripped from git-rebase--interactive.sh.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: rewrite write_basic_state() in CAlban Gruin Tue, 28 Aug 2018 12:10:40 +0000 (14:10 +0200)

rebase -i: rewrite write_basic_state() in C

This rewrites write_basic_state() from git-rebase.sh in C. This is the
first step in the conversion of init_basic_state(), hence the mode in
rebase--helper.c is called INIT_BASIC_STATE. init_basic_state() will be
converted in the next commit.

The part of read_strategy_opts() that parses the stategy options is
moved to a new function to allow its use in rebase--helper.c.

Finally, the call to write_basic_state() is removed from
git-rebase--interactive.sh, replaced by a call to `--init-basic-state`.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: rewrite the rest of init_revisions_and_short... Alban Gruin Tue, 28 Aug 2018 12:10:39 +0000 (14:10 +0200)

rebase -i: rewrite the rest of init_revisions_and_shortrevisions() in C

This rewrites the part of init_revisions_and_shortrevisions() needed by
`--complete-action` (which initialize $shortrevisions) from shell to C.

When `upstream` is empty, it means that the user launched a `rebase
--root`, and `onto` contains the ID of an empty commit. As a range
between an empty commit and `head` is not really meaningful, `onto` is
not used to initialize `shortrevisions` in this case.

The corresponding arguments passed to `--complete-action` are then
dropped, and init_revisions_and_shortrevisions() is stripped from
git-rebase--interactive.sh

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: implement the logic to initialize $revisions... Alban Gruin Tue, 28 Aug 2018 12:10:38 +0000 (14:10 +0200)

rebase -i: implement the logic to initialize $revisions in C

This rewrites the part of init_revisions_and_shortrevisions() needed by
`--make-script` from shell to C. The new version is called
get_revision_ranges(), and is a static function inside of
rebase--helper.c. As this does not initialize $shortrevision, the
original shell version is not yet stripped.

Unlike init_revisions_and_shortrevisions(), get_revision_ranges()
doesn’t write $squash_onto to the state directory, it’s done by the
handler of `--make-script` instead.

Finally, this drops the $revision argument passed to `--make-script` in
git-rebase--interactive.sh, and rebase--helper is changed accordingly.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: remove unused modes and functionsAlban Gruin Tue, 28 Aug 2018 12:10:37 +0000 (14:10 +0200)

rebase -i: remove unused modes and functions

This removes the modes `--skip-unnecessary-picks`, `--append-todo-help`,
and `--checkout-onto` from rebase--helper.c, the functions of
git-rebase--interactive.sh that were rendered useless by the rewrite of
complete_action(), and append_todo_help_to_file() from
rebase-interactive.c.

skip_unnecessary_picks() and checkout_onto() becomes static, as they are
only used inside of the sequencer.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: rewrite complete_action() in CAlban Gruin Tue, 28 Aug 2018 12:10:36 +0000 (14:10 +0200)

rebase -i: rewrite complete_action() in C

This rewrites complete_action() from shell to C.

A new mode is added to rebase--helper (`--complete-action`), as well as
a new flag (`--autosquash`).

Finally, complete_action() is stripped from git-rebase--interactive.sh.

The original complete_action() would return the code 2 when the todo
list contained no actions. This was a special case for rebase -i and
-p; git-rebase.sh would then apply the autostash, delete the state
directory, and die with the message "Nothing to do". This cleanup is
rewritten in C instead of returning 2. As rebase -i no longer returns
2, the comment describing this behaviour in git-rebase.sh is updated to
reflect this change.

The message "Nothing to do" is now printed with error(), and so becomes
"error: nothing to do". Some tests in t3404 check this value, so they
are updated to fit this change.

The first check might seem useless as we write "noop" to the todo list
if it is empty. Actually, the todo list might contain commented
commands (ie. empty commits). In this case, complete_action() won’t
write "noop", and will abort without starting the editor.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3404: todo list with commented-out commands only abortsAlban Gruin Fri, 10 Aug 2018 16:51:37 +0000 (18:51 +0200)

t3404: todo list with commented-out commands only aborts

If the todo list generated by `--make-script` is empty,
complete_action() writes a noop, but if it has only commented-out
commands, it will abort with the message "Nothing to do", and does not
launch the editor. This adds a new test to ensure that
complete_action() behaves this way.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: change the way skip_unnecessary_picks()... Alban Gruin Fri, 10 Aug 2018 16:51:36 +0000 (18:51 +0200)

sequencer: change the way skip_unnecessary_picks() returns its result

Instead of skip_unnecessary_picks() printing its result to stdout, it
returns it into a struct object_id, as the rewrite of complete_action()
(to come in the next commit) will need it.

rebase--helper then is modified to fit this change.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: refactor append_todo_help() to write its... Alban Gruin Fri, 10 Aug 2018 16:51:35 +0000 (18:51 +0200)

sequencer: refactor append_todo_help() to write its message to a buffer

This refactors append_todo_help() to write its message to a buffer
instead of the todo-list. This is needed for the rewrite of
complete_action(), which will come after the next commit.

As rebase--helper still needs the file manipulation part of
append_todo_help(), it is extracted to a temporary function,
append_todo_help_to_file(). This function will go away after the
rewrite of complete_action().

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: rewrite checkout_onto() in CAlban Gruin Fri, 10 Aug 2018 16:51:34 +0000 (18:51 +0200)

rebase -i: rewrite checkout_onto() in C

This rewrites checkout_onto() from shell to C.

A new command (“checkout-onto”) is added to rebase--helper.c. The shell
version is then stripped.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: rewrite setup_reflog_action() in CAlban Gruin Fri, 10 Aug 2018 16:51:33 +0000 (18:51 +0200)

rebase -i: rewrite setup_reflog_action() in C

This rewrites (the misnamed) setup_reflog_action() from shell to C. The
new version is called prepare_branch_to_be_rebased().

A new command is added to rebase--helper.c, “checkout-base”, as well as
a new flag, “verbose”, to avoid silencing the output of the checkout
operation called by checkout_base_commit().

The function `run_git_checkout()` will also be used in the next commit,
therefore its code is not part of `checkout_base_commit()`.

The shell version is then stripped in favour of a call to the helper.

As $GIT_REFLOG_ACTION is no longer set at the first call of
checkout_onto(), a call to comment_for_reflog() is added at the
beginning of this function.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: add a new function to silence a command... Alban Gruin Fri, 10 Aug 2018 16:51:32 +0000 (18:51 +0200)

sequencer: add a new function to silence a command, except if it fails

This adds a new function, run_command_silent_on_success(), to
redirect the stdout and stderr of a command to a strbuf, and then to run
that command. This strbuf is printed only if the command fails. It is
functionnaly similar to output() from git-rebase.sh.

run_git_commit() is then refactored to use of
run_command_silent_on_success().

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: rewrite the edit-todo functionality in CAlban Gruin Fri, 10 Aug 2018 16:51:31 +0000 (18:51 +0200)

rebase -i: rewrite the edit-todo functionality in C

This rewrites the edit-todo functionality from shell to C.

To achieve that, a new command mode, `edit-todo`, is added, and the
`write-edit-todo` flag is removed, as the shell script does not need to
write the edit todo help message to the todo list anymore.

The shell version is then stripped in favour of a call to the helper.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

editor: add a function to launch the sequence editorAlban Gruin Fri, 10 Aug 2018 16:51:30 +0000 (18:51 +0200)

editor: add a function to launch the sequence editor

As part of the rewrite of interactive rebase, the sequencer will need to
open the sequence editor to allow the user to edit the todo list.
Instead of duplicating the existing launch_editor() function, this
refactors it to a new function, launch_specified_editor(), which takes
the editor as a parameter, in addition to the path, the buffer and the
environment variables. launch_sequence_editor() is then added to launch
the sequence editor.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

rebase -i: rewrite append_todo_help() in CAlban Gruin Fri, 10 Aug 2018 16:51:29 +0000 (18:51 +0200)

rebase -i: rewrite append_todo_help() in C

This rewrites append_todo_help() from shell to C. It also incorporates
some parts of initiate_action() and complete_action() that also write
help texts to the todo file.

This also introduces the source file rebase-interactive.c. This file
will contain functions necessary for interactive rebase that are too
specific for the sequencer, and is part of libgit.a.

Two flags are added to rebase--helper.c: one to call
append_todo_help() (`--append-todo-help`), and another one to tell
append_todo_help() to write the help text suited for the edit-todo
mode (`--write-edit-todo`).

Finally, append_todo_help() is removed from git-rebase--interactive.sh
to use `rebase--helper --append-todo-help` instead.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

sequencer: make three functions and an enum from sequen... Alban Gruin Fri, 10 Aug 2018 16:51:28 +0000 (18:51 +0200)

sequencer: make three functions and an enum from sequencer.c public

This makes rebase_path_todo(), get_missing_commit_check_level(),
write_message() and the enum check_level accessible outside sequencer.c,
renames check_level to missing_commit_check_level, and prefixes its
value names by MISSING_COMMIT_ to avoid namespace pollution.

This function and this enum will eventually be moved to
rebase-interactive.c and become static again, so no special attention
was given to the naming.

This will be needed for the rewrite of append_todo_help() from shell to
C, as it will be in a new library source file, rebase-interactive.c.

Signed-off-by: Alban Gruin <alban.gruin@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Third batch for 2.19 cycleJunio C Hamano Wed, 18 Jul 2018 19:24:17 +0000 (12:24 -0700)

Third batch for 2.19 cycle

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

Merge branch 'js/enhanced-version-info'Junio C Hamano Wed, 18 Jul 2018 19:20:35 +0000 (12:20 -0700)

Merge branch 'js/enhanced-version-info'

Build fix.

* js/enhanced-version-info:
Makefile: fix the "built from commit" code

Merge branch 'sb/mailmap'Junio C Hamano Wed, 18 Jul 2018 19:20:35 +0000 (12:20 -0700)

Merge branch 'sb/mailmap'

* sb/mailmap:
.mailmap: merge different spellings of names

Merge branch 'ms/core-icase-doc'Junio C Hamano Wed, 18 Jul 2018 19:20:35 +0000 (12:20 -0700)

Merge branch 'ms/core-icase-doc'

Clarify that setting core.ignoreCase to deviate from reality would
not turn a case-incapable filesystem into a case-capable one.

* ms/core-icase-doc:
Documentation: declare "core.ignoreCase" as internal variable

Merge branch 'ds/commit-graph'Junio C Hamano Wed, 18 Jul 2018 19:20:34 +0000 (12:20 -0700)

Merge branch 'ds/commit-graph'

Docfix.

* ds/commit-graph:
commit-graph: fix documentation inconsistencies

Merge branch 'tz/exclude-doc-smallfixes'Junio C Hamano Wed, 18 Jul 2018 19:20:34 +0000 (12:20 -0700)

Merge branch 'tz/exclude-doc-smallfixes'

Doc updates.

* tz/exclude-doc-smallfixes:
dir.c: fix typos in core.excludesfile comment
gitignore.txt: clarify default core.excludesfile path

Merge branch 'js/rebase-recreate-merge'Junio C Hamano Wed, 18 Jul 2018 19:20:33 +0000 (12:20 -0700)

Merge branch 'js/rebase-recreate-merge'

Docfix.

* js/rebase-recreate-merge:
rebase: fix documentation formatting

Merge branch 'en/rebase-i-microfixes'Junio C Hamano Wed, 18 Jul 2018 19:20:33 +0000 (12:20 -0700)

Merge branch 'en/rebase-i-microfixes'

* en/rebase-i-microfixes:
git-rebase--merge: modernize "git-$cmd" to "git $cmd"
Fix use of strategy options with interactive rebases
t3418: add testcase showing problems with rebase -i and strategy options

Merge branch 'mb/filter-branch-optim'Junio C Hamano Wed, 18 Jul 2018 19:20:32 +0000 (12:20 -0700)

Merge branch 'mb/filter-branch-optim'

"git filter-branch" when used with the "--state-branch" option
still attempted to rewrite the commits whose filtered result is
known from the previous attempt (which is recorded on the state
branch); the command has been corrected not to waste cycles doing
so.

* mb/filter-branch-optim:
filter-branch: skip commits present on --state-branch

Merge branch 'dj/runtime-prefix'Junio C Hamano Wed, 18 Jul 2018 19:20:32 +0000 (12:20 -0700)

Merge branch 'dj/runtime-prefix'

POSIX portability fix in Makefile to fix a glitch introduced a few
releases ago.

* dj/runtime-prefix:
Makefile: tweak sed invocation

Merge branch 'ao/config-from-gitmodules'Junio C Hamano Wed, 18 Jul 2018 19:20:31 +0000 (12:20 -0700)

Merge branch 'ao/config-from-gitmodules'

Tighten the API to make it harder to misuse in-tree .gitmodules
file, even though it shares the same syntax with configuration
files, to read random configuration items from it.

* ao/config-from-gitmodules:
submodule-config: reuse config_from_gitmodules in repo_read_gitmodules
submodule-config: pass repository as argument to config_from_gitmodules
submodule-config: make 'config_from_gitmodules' private
submodule-config: add helper to get 'update-clone' config from .gitmodules
submodule-config: add helper function to get 'fetch' config from .gitmodules
config: move config_from_gitmodules to submodule-config.c

Merge branch 'jk/branch-l-0-deprecation'Junio C Hamano Wed, 18 Jul 2018 19:20:31 +0000 (12:20 -0700)

Merge branch 'jk/branch-l-0-deprecation'

The "-l" option in "git branch -l" is an unfortunate short-hand for
"--create-reflog", but many users, both old and new, somehow expect
it to be something else, perhaps "--list". This step warns when "-l"
is used as a short-hand for "--create-reflog" and warns about the
future repurposing of the it when it is used.

* jk/branch-l-0-deprecation:
branch: deprecate "-l" option
t: switch "branch -l" to "branch --create-reflog"
t3200: unset core.logallrefupdates when testing reflog creation

Merge branch 'tb/grep-column'Junio C Hamano Wed, 18 Jul 2018 19:20:31 +0000 (12:20 -0700)

Merge branch 'tb/grep-column'

"git grep" learned the "--column" option that gives not just the
line number but the column number of the hit.

* tb/grep-column:
contrib/git-jump/git-jump: jump to exact location
grep.c: add configuration variables to show matched option
builtin/grep.c: add '--column' option to 'git-grep(1)'
grep.c: display column number of first match
grep.[ch]: extend grep_opt to allow showing matched column
grep.c: expose {,inverted} match column in match_line()
Documentation/config.txt: camel-case lineNumber for consistency

Merge branch 'vs/typofixes'Junio C Hamano Wed, 18 Jul 2018 19:20:31 +0000 (12:20 -0700)

Merge branch 'vs/typofixes'

Doc fix.

* vs/typofixes:
Documentation: spelling and grammar fixes

Merge branch 'bw/protocol-v2'Junio C Hamano Wed, 18 Jul 2018 19:20:30 +0000 (12:20 -0700)

Merge branch 'bw/protocol-v2'

Doc fix.

* bw/protocol-v2:
protocol-v2 doc: put HTTP headers after request

Merge branch 'jt/remove-pack-bitmap-global'Junio C Hamano Wed, 18 Jul 2018 19:20:30 +0000 (12:20 -0700)

Merge branch 'jt/remove-pack-bitmap-global'

The effort to move globals to per-repository in-core structure
continues.

* jt/remove-pack-bitmap-global:
pack-bitmap: add free function
pack-bitmap: remove bitmap_git global variable

Merge branch 'bw/config-refer-to-gitsubmodules-doc'Junio C Hamano Wed, 18 Jul 2018 19:20:30 +0000 (12:20 -0700)

Merge branch 'bw/config-refer-to-gitsubmodules-doc'

Docfix.

* bw/config-refer-to-gitsubmodules-doc:
docs: link to gitsubmodules

Merge branch 'xy/format-patch-prereq-patch-id-fix'Junio C Hamano Wed, 18 Jul 2018 19:20:29 +0000 (12:20 -0700)

Merge branch 'xy/format-patch-prereq-patch-id-fix'

Recently added "--base" option to "git format-patch" command did
not correctly generate prereq patch ids.

* xy/format-patch-prereq-patch-id-fix:
format-patch: clear UNINTERESTING flag before prepare_bases

Merge branch 'pw/rebase-i-keep-reword-after-conflict'Junio C Hamano Wed, 18 Jul 2018 19:20:29 +0000 (12:20 -0700)

Merge branch 'pw/rebase-i-keep-reword-after-conflict'

Bugfix for "rebase -i" corner case regression.

* pw/rebase-i-keep-reword-after-conflict:
sequencer: do not squash 'reword' commits when we hit conflicts

Merge branch 'ld/p423'Junio C Hamano Wed, 18 Jul 2018 19:20:29 +0000 (12:20 -0700)

Merge branch 'ld/p423'

Code preparation to make "git p4" closer to be usable with Python 3.

* ld/p423:
git-p4: python3: fix octal constants
git-p4: python3: use print() function
git-p4: python3: basestring workaround
git-p4: python3: remove backticks
git-p4: python3: replace dict.has_key(k) with "k in dict"
git-p4: python3: replace <> with !=

Merge branch 'ds/ewah-cleanup'Junio C Hamano Wed, 18 Jul 2018 19:20:28 +0000 (12:20 -0700)

Merge branch 'ds/ewah-cleanup'

Remove unused function definitions and declarations from ewah
bitmap subsystem.

* ds/ewah-cleanup:
ewah: delete unused 'rlwit_discharge_empty()'
ewah: drop ewah_serialize_native function
ewah: drop ewah_deserialize function
ewah_io: delete unused 'ewah_serialize()'
ewah_bitmap: delete unused 'ewah_or()'
ewah_bitmap: delete unused 'ewah_not()'
ewah_bitmap: delete unused 'ewah_and_not()'
ewah_bitmap: delete unused 'ewah_and()'
ewah/bitmap.c: delete unused 'bitmap_each_bit()'
ewah/bitmap.c: delete unused 'bitmap_clear()'

Merge branch 'sb/submodule-core-worktree'Junio C Hamano Wed, 18 Jul 2018 19:20:28 +0000 (12:20 -0700)

Merge branch 'sb/submodule-core-worktree'

"git submodule" did not correctly adjust core.worktree setting that
indicates whether/where a submodule repository has its associated
working tree across various state transitions, which has been
corrected.

* sb/submodule-core-worktree:
submodule deinit: unset core.worktree
submodule: ensure core.worktree is set after update
submodule: unset core.worktree if no working tree is present

Merge branch 'sb/object-store-grafts'Junio C Hamano Wed, 18 Jul 2018 19:20:27 +0000 (12:20 -0700)

Merge branch 'sb/object-store-grafts'

The conversion to pass "the_repository" and then "a_repository"
throughout the object access API continues.

* sb/object-store-grafts:
commit: allow lookup_commit_graft to handle arbitrary repositories
commit: allow prepare_commit_graft to handle arbitrary repositories
shallow: migrate shallow information into the object parser
path.c: migrate global git_path_* to take a repository argument
cache: convert get_graft_file to handle arbitrary repositories
commit: convert read_graft_file to handle arbitrary repositories
commit: convert register_commit_graft to handle arbitrary repositories
commit: convert commit_graft_pos() to handle arbitrary repositories
shallow: add repository argument to is_repository_shallow
shallow: add repository argument to check_shallow_file_for_update
shallow: add repository argument to register_shallow
shallow: add repository argument to set_alternate_shallow_file
commit: add repository argument to lookup_commit_graft
commit: add repository argument to prepare_commit_graft
commit: add repository argument to read_graft_file
commit: add repository argument to register_commit_graft
commit: add repository argument to commit_graft_pos
object: move grafts to object parser
object-store: move object access functions to object-store.h

Merge branch 'en/merge-recursive-cleanup'Junio C Hamano Wed, 18 Jul 2018 19:20:27 +0000 (12:20 -0700)

Merge branch 'en/merge-recursive-cleanup'

Code cleanup.

* en/merge-recursive-cleanup:
merge-recursive: add pointer about unduly complex looking code
merge-recursive: rename conflict_rename_*() family of functions
merge-recursive: clarify the rename_dir/RENAME_DIR meaning
merge-recursive: align labels with their respective code blocks
merge-recursive: fix numerous argument alignment issues
merge-recursive: fix miscellaneous grammar error in comment

.mailmap: merge different spellings of namesStefan Beller Fri, 29 Jun 2018 02:10:48 +0000 (19:10 -0700)

.mailmap: merge different spellings of names

This is a continuation of 94b410bba86 (.mailmap: Map email
addresses to names, 2013-07-12), merging names that are
spelled differently but have the same author email to the
same person.

Most spellings differed in accents or the order of names.

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

Makefile: fix the "built from commit" codeJohannes Schindelin Wed, 27 Jun 2018 19:35:23 +0000 (21:35 +0200)

Makefile: fix the "built from commit" code

In ed32b788c06 (version --build-options: report commit, too, if
possible, 2017-12-15), we introduced code to let `git version
--build-options` report the current commit from which the binaries were
built, if any.

To prevent erroneous commits from being reported (e.g. when unpacking
Git's source code from a .tar.gz file into a subdirectory of a different
Git project, as e.g. git_osx_installer does), we painstakingly set
GIT_CEILING_DIRECTORIES when trying to determine the current commit.

Except that we got the quoting wrong, and that variable therefore does
not have the desired effect.

The issue is that the $(shell) is resolved before the output is stuffed
into the command-line with -DGIT_BUILT_FROM_COMMIT, and therefore is
*not* inside quotes. And thus backslashing the quotes is wrong, as the
quote gets literally inserted into the CEILING_DIRECTORIES variable.

Let's fix that quoting, and while at it, also suppress the unhelpful
message

fatal: not a git repository (or any of the parent directories): .git

that gets printed to stderr if no current commit could be determined,
and might scare the occasional developer who simply tries to build Git
from scratch.

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

Second batch for 2.19 cycleJunio C Hamano Thu, 28 Jun 2018 19:55:47 +0000 (12:55 -0700)

Second batch for 2.19 cycle

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

Merge branch 'sb/fix-fetching-moved-submodules'Junio C Hamano Thu, 28 Jun 2018 19:53:34 +0000 (12:53 -0700)

Merge branch 'sb/fix-fetching-moved-submodules'

The code to try seeing if a fetch is necessary in a submodule
during a fetch with --recurse-submodules got confused when the path
to the submodule was changed in the range of commits in the
superproject, sometimes showing "(null)". This has been corrected.

* sb/fix-fetching-moved-submodules:
t5526: test recursive submodules when fetching moved submodules
submodule: fix NULL correctness in renamed broken submodules

Merge branch 'tz/cred-netrc-cleanup'Junio C Hamano Thu, 28 Jun 2018 19:53:33 +0000 (12:53 -0700)

Merge branch 'tz/cred-netrc-cleanup'

Build and test procedure for netrc credential helper (in contrib/)
has been updated.

* tz/cred-netrc-cleanup:
git-credential-netrc: make "all" default target of Makefile
git-credential-netrc: fix exit status when tests fail
git-credential-netrc: use in-tree Git.pm for tests
git-credential-netrc: minor whitespace cleanup in test script

Merge branch 'jc/clean-after-sanity-tests'Junio C Hamano Thu, 28 Jun 2018 19:53:33 +0000 (12:53 -0700)

Merge branch 'jc/clean-after-sanity-tests'

test cleanup.

* jc/clean-after-sanity-tests:
tests: clean after SANITY tests

Merge branch 'nd/completion-negation'Junio C Hamano Thu, 28 Jun 2018 19:53:32 +0000 (12:53 -0700)

Merge branch 'nd/completion-negation'

Continuing with the idea to programmatically enumerate various
pieces of data required for command line completion, the codebase
has been taught to enumerate options prefixed with "--no-" to
negate them.

* nd/completion-negation:
completion: collapse extra --no-.. options
completion: suppress some -no- options
parse-options: option to let --git-completion-helper show negative form

Merge branch 'pw/add-p-recount'Junio C Hamano Thu, 28 Jun 2018 19:53:32 +0000 (12:53 -0700)

Merge branch 'pw/add-p-recount'

When user edits the patch in "git add -p" and the user's editor is
set to strip trailing whitespaces indiscriminately, an empty line
that is unchanged in the patch would become completely empty
(instead of a line with a sole SP on it). The code introduced in
Git 2.17 timeframe failed to parse such a patch, but now it learned
to notice the situation and cope with it.

* pw/add-p-recount:
add -p: fix counting empty context lines in edited patches

Merge branch 'jk/fetch-all-peeled-fix'Junio C Hamano Thu, 28 Jun 2018 19:53:32 +0000 (12:53 -0700)

Merge branch 'jk/fetch-all-peeled-fix'

"git fetch-pack --all" used to unnecessarily fail upon seeing an
annotated tag that points at an object other than a commit.

* jk/fetch-all-peeled-fix:
fetch-pack: test explicitly that --all can fetch tag references pointing to non-commits
fetch-pack: don't try to fetch peel values with --all

Merge branch 'ms/send-pack-honor-config'Junio C Hamano Thu, 28 Jun 2018 19:53:30 +0000 (12:53 -0700)

Merge branch 'ms/send-pack-honor-config'

"git send-pack --signed" (hence "git push --signed" over the http
transport) did not read user ident from the config mechanism to
determine whom to sign the push certificate as, which has been
corrected.

* ms/send-pack-honor-config:
builtin/send-pack: populate the default configs

Merge branch 'jh/partial-clone'Junio C Hamano Thu, 28 Jun 2018 19:53:30 +0000 (12:53 -0700)

Merge branch 'jh/partial-clone'

The recent addition of "partial clone" experimental feature kicked
in when it shouldn't, namely, when there is no partial-clone filter
defined even if extensions.partialclone is set.

* jh/partial-clone:
list-objects: check if filter is NULL before using

Merge branch 'sg/gpg-tests-fix'Junio C Hamano Thu, 28 Jun 2018 19:53:29 +0000 (12:53 -0700)

Merge branch 'sg/gpg-tests-fix'

Some flaky tests have been fixed.

* sg/gpg-tests-fix:
tests: make forging GPG signed commits and tags more robust
t7510-signed-commit: use 'test_must_fail'

Merge branch 'as/safecrlf-quiet-fix'Junio C Hamano Thu, 28 Jun 2018 19:53:29 +0000 (12:53 -0700)

Merge branch 'as/safecrlf-quiet-fix'

Fix for 2.17-era regression around `core.safecrlf`.

* as/safecrlf-quiet-fix:
config.c: fix regression for core.safecrlf false

Merge branch 'ab/refspec-init-fix'Junio C Hamano Thu, 28 Jun 2018 19:53:29 +0000 (12:53 -0700)

Merge branch 'ab/refspec-init-fix'

Make refspec parsing codepath more robust.

* ab/refspec-init-fix:
refspec: initalize `refspec_item` in `valid_fetch_refspec()`
refspec: add back a refspec_item_init() function
refspec: s/refspec_item_init/&_or_die/g

Documentation: declare "core.ignoreCase" as internal... Marc Strapetz Thu, 28 Jun 2018 11:21:57 +0000 (13:21 +0200)

Documentation: declare "core.ignoreCase" as internal variable

The current description of "core.ignoreCase" reads like an option which
is intended to be changed by the user while it's actually expected to
be set by Git on initialization only. Subsequently, Git relies on the
proper configuration of this variable, as noted by Bryan Turner [1]:

Git on a case-insensitive filesystem (APFS, HFS+, FAT32, exFAT,
vFAT, NTFS, etc.) is not designed to be run with anything other
than core.ignoreCase=true.

[1] https://marc.info/?l=git&m=152998665813997&w=2
mid:CAGyf7-GeE8jRGPkME9rHKPtHEQ6P1+ebpMMWAtMh01uO3bfy8w@mail.gmail.com

Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

commit-graph: fix documentation inconsistenciesDerrick Stolee Thu, 28 Jun 2018 12:52:45 +0000 (12:52 +0000)

commit-graph: fix documentation inconsistencies

The commit-graph feature shipped in Git 2.18 has some inconsistencies in
the constants used by the implementation and specified by the format
document.

The commit data chunk uses the key "CDAT" in the file format, but was
previously documented to say "CGET".

The commit data chunk stores commit parents using two 32-bit fields that
typically store the integer position of the parent in the list of commit
ids within the commit-graph file. When a parent does not exist, we had
documented the value 0xffffffff, but implemented the value 0x70000000.
This swap is easy to correct in the documentation, but unfortunately
reduces the number of commits that we can store in the commit-graph.
Update that estimate, too.

Reported-by: Grant Welch <gwelch925@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

git-rebase--merge: modernize "git-$cmd" to "git $cmd"Elijah Newren Wed, 27 Jun 2018 07:46:00 +0000 (00:46 -0700)

git-rebase--merge: modernize "git-$cmd" to "git $cmd"

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Fix use of strategy options with interactive rebasesElijah Newren Wed, 27 Jun 2018 15:48:04 +0000 (08:48 -0700)

Fix use of strategy options with interactive rebases

git-rebase.sh wrote strategy options to .git/rebase/merge/strategy_opts
in the following format:
'--ours' '--renormalize'
Note the double spaces.

git-rebase--interactive uses sequencer.c to parse that file, and
sequencer.c used split_cmdline() to get the individual strategy options.
After splitting, sequencer.c prefixed each "option" with a double dash,
so, concatenating all its options would result in:
-- --ours -- --renormalize

So, when it ended up calling try_merge_strategy(), that in turn would run
git merge-$strategy -- --ours -- --renormalize $merge_base -- $head $remote

instead of the expected/desired
git merge-$strategy --ours --renormalize $merge_base -- $head $remote

Remove the extra spaces so that when it goes through split_cmdline() we end
up with the desired command line.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

t3418: add testcase showing problems with rebase -i... Elijah Newren Wed, 27 Jun 2018 15:48:03 +0000 (08:48 -0700)

t3418: add testcase showing problems with rebase -i and strategy options

We are not passing the same args to merge strategies when we are doing an
--interactive rebase as we do with a --merge rebase. The merge strategy
should not need to be aware of which type of rebase is in effect. Add a
testcase which checks for the appropriate args.

Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

dir.c: fix typos in core.excludesfile commentTodd Zullinger Wed, 27 Jun 2018 04:46:52 +0000 (00:46 -0400)

dir.c: fix typos in core.excludesfile comment

Make it easier to find references to core.excludesfile and the default
$XDG_CONFIG_HOME/git/ignore path.

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

gitignore.txt: clarify default core.excludesfile pathTodd Zullinger Wed, 27 Jun 2018 04:46:51 +0000 (00:46 -0400)

gitignore.txt: clarify default core.excludesfile path

The default core.excludesfile path is $XDG_CONFIG_HOME/git/ignore.
$HOME/.config/git/ignore is used if XDG_CONFIG_HOME is empty or unset,
as described later in the document.

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

rebase: fix documentation formattingVladimir Parfinenko Wed, 27 Jun 2018 08:57:43 +0000 (15:57 +0700)

rebase: fix documentation formatting

Last sections are squashed into non-formatted block after adding
"REBASING MERGES".
To reproduce the error see bottom of page:
https://git-scm.com/docs/git-rebase

Signed-off-by: Vladimir Parfinenko <vparfinenko@excelsior-usa.com>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

filter-branch: skip commits present on --state-branchMichael Barabanov Tue, 26 Jun 2018 04:07:33 +0000 (21:07 -0700)

filter-branch: skip commits present on --state-branch

The commits in state:filter.map have already been processed, so don't
filter them again. This makes incremental git filter-branch much faster.

Also add tests for --state-branch option.

Signed-off-by: Michael Barabanov <michael.barabanov@gmail.com>
Acked-by: Ian Campbell <ijc@hellion.org.uk>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule-config: reuse config_from_gitmodules in repo_... Antonio Ospite Tue, 26 Jun 2018 10:47:10 +0000 (12:47 +0200)

submodule-config: reuse config_from_gitmodules in repo_read_gitmodules

Reuse config_from_gitmodules in repo_read_gitmodules to remove some
duplication and also have a single point where the .gitmodules file is
read.

The change does not introduce any new behavior, the same gitmodules_cb
config callback is still used, which only deals with configuration
specific to submodules.

The check about the repo's worktree is removed from repo_read_gitmodules
because it's already performed in config_from_gitmodules.

The config_from_gitmodules function is moved up in the file —unchanged—
before its users to avoid a forward declaration.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Acked-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule-config: pass repository as argument to config... Antonio Ospite Tue, 26 Jun 2018 10:47:09 +0000 (12:47 +0200)

submodule-config: pass repository as argument to config_from_gitmodules

Generalize config_from_gitmodules() to accept a repository as an argument.

This is in preparation to reuse the function in repo_read_gitmodules in
order to have a single point where the '.gitmodules' file is accessed.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Acked-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule-config: make 'config_from_gitmodules' privateAntonio Ospite Tue, 26 Jun 2018 10:47:08 +0000 (12:47 +0200)

submodule-config: make 'config_from_gitmodules' private

Now that 'config_from_gitmodules' is not used in the open, it can be
marked as private.

Hopefully this will prevent its usage for retrieving arbitrary
configuration form the '.gitmodules' file.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Acked-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule-config: add helper to get 'update-clone'... Antonio Ospite Tue, 26 Jun 2018 10:47:07 +0000 (12:47 +0200)

submodule-config: add helper to get 'update-clone' config from .gitmodules

Add a helper function to make it clearer that retrieving 'update-clone'
configuration from the .gitmodules file is a special case supported
solely for backward compatibility purposes.

This change removes one direct use of 'config_from_gitmodules' for
options not strictly related to submodules: "submodule.fetchjobs" does
not describe a property of a submodule, but a behavior of other commands
when dealing with submodules, so it does not really belong to the
.gitmodules file.

This is in the effort to communicate better that .gitmodules is not to
be used as a mechanism to store arbitrary configuration in the
repository that any command can retrieve.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Acked-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

submodule-config: add helper function to get 'fetch... Antonio Ospite Tue, 26 Jun 2018 10:47:06 +0000 (12:47 +0200)

submodule-config: add helper function to get 'fetch' config from .gitmodules

Add a helper function to make it clearer that retrieving 'fetch'
configuration from the .gitmodules file is a special case supported
solely for backward compatibility purposes.

This change removes one direct use of 'config_from_gitmodules' in code
not strictly related to submodules, in the effort to communicate better
that .gitmodules is not to be used as a mechanism to store arbitrary
configuration in the repository that any command can retrieve.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Acked-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

config: move config_from_gitmodules to submodule-config.cAntonio Ospite Tue, 26 Jun 2018 10:47:05 +0000 (12:47 +0200)

config: move config_from_gitmodules to submodule-config.c

The .gitmodules file is not meant as a place to store arbitrary
configuration to distribute with the repository.

Move config_from_gitmodules() out of config.c and into
submodule-config.c to make it even clearer that it is not a mechanism to
retrieve arbitrary configuration from the .gitmodules file.

Signed-off-by: Antonio Ospite <ao2@ao2.it>
Acked-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Makefile: tweak sed invocationAlejandro R. Sedeño Mon, 25 Jun 2018 19:13:25 +0000 (15:13 -0400)

Makefile: tweak sed invocation

With GNU sed, the r command doesn't care if a space separates it and
the filename it reads from.

With SunOS sed, the space is required.

Signed-off-by: Alejandro R. Sedeño <asedeno@mit.edu>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

First batch for 2.19 cycleJunio C Hamano Mon, 25 Jun 2018 20:27:15 +0000 (13:27 -0700)

First batch for 2.19 cycle

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

Merge branch 'sb/plug-misc-leaks'Junio C Hamano Mon, 25 Jun 2018 20:22:41 +0000 (13:22 -0700)

Merge branch 'sb/plug-misc-leaks'

Misc leak plugging.

* sb/plug-misc-leaks:
sequencer.c: plug mem leak in git_sequencer_config
sequencer.c: plug leaks in do_pick_commit
submodule--helper: plug mem leak in print_default_remote
refs/packed-backend.c: close fd of empty file

Merge branch 'cc/tests-without-assuming-ref-files-backend'Junio C Hamano Mon, 25 Jun 2018 20:22:41 +0000 (13:22 -0700)

Merge branch 'cc/tests-without-assuming-ref-files-backend'

Instead of mucking with filesystem directly, use plumbing commands
update-ref etc. to manipulate the refs in the tests.

* cc/tests-without-assuming-ref-files-backend:
t9104: kosherly remove remote refs

Merge branch 'sg/update-ref-stdin-cleanup'Junio C Hamano Mon, 25 Jun 2018 20:22:40 +0000 (13:22 -0700)

Merge branch 'sg/update-ref-stdin-cleanup'

Code cleanup.

* sg/update-ref-stdin-cleanup:
update-ref --stdin: use skip_prefix()

Merge branch 'nd/reject-empty-shallow-request'Junio C Hamano Mon, 25 Jun 2018 20:22:40 +0000 (13:22 -0700)

Merge branch 'nd/reject-empty-shallow-request'

"git fetch --shallow-since=<cutoff>" that specifies the cut-off
point that is newer than the existing history used to end up
grabbing the entire history. Such a request now errors out.

* nd/reject-empty-shallow-request:
upload-pack: reject shallow requests that would return nothing

Merge branch 'ls/complete-remote-update-names'Junio C Hamano Mon, 25 Jun 2018 20:22:39 +0000 (13:22 -0700)

Merge branch 'ls/complete-remote-update-names'

"git remote update" can take both a single remote nickname and a
nickname for remote groups, and the completion script (in contrib/)
has been taught about it.

* ls/complete-remote-update-names:
completion: complete remote names too

Merge branch 'ag/rebase-p'Junio C Hamano Mon, 25 Jun 2018 20:22:39 +0000 (13:22 -0700)

Merge branch 'ag/rebase-p'

Separate "rebase -p" codepath out of "rebase -i" implementation to
slim down the latter and make it easier to manage.

* ag/rebase-p:
rebase: remove -p code from git-rebase--interactive.sh
rebase: use the new git-rebase--preserve-merges.sh
rebase: strip unused code in git-rebase--preserve-merges.sh
rebase: introduce a dedicated backend for --preserve-merges

Merge branch 'nd/complete-config-vars'Junio C Hamano Mon, 25 Jun 2018 20:22:38 +0000 (13:22 -0700)

Merge branch 'nd/complete-config-vars'

Continuing with the idea to programatically enumerate various
pieces of data required for command line completion, teach the
codebase to report the list of configuration variables
subcommands care about to help complete them.

* nd/complete-config-vars:
completion: complete general config vars in two steps
log-tree: allow to customize 'grafted' color
completion: support case-insensitive config vars
completion: keep other config var completion in camelCase
completion: drop the hard coded list of config vars
am: move advice.amWorkDir parsing back to advice.c
advice: keep config name in camelCase in advice_config[]
fsck: produce camelCase config key names
help: add --config to list all available config
fsck: factor out msg_id_info[] lazy initialization code
grep: keep all colors in an array
Add and use generic name->id mapping code for color slot parsing

Merge branch 'sb/object-store-alloc'Junio C Hamano Mon, 25 Jun 2018 20:22:38 +0000 (13:22 -0700)

Merge branch 'sb/object-store-alloc'

The conversion to pass "the_repository" and then "a_repository"
throughout the object access API continues.

* sb/object-store-alloc:
alloc: allow arbitrary repositories for alloc functions
object: allow create_object to handle arbitrary repositories
object: allow grow_object_hash to handle arbitrary repositories
alloc: add repository argument to alloc_commit_index
alloc: add repository argument to alloc_report
alloc: add repository argument to alloc_object_node
alloc: add repository argument to alloc_tag_node
alloc: add repository argument to alloc_commit_node
alloc: add repository argument to alloc_tree_node
alloc: add repository argument to alloc_blob_node
object: add repository argument to grow_object_hash
object: add repository argument to create_object
repository: introduce parsed objects field

Merge branch 'jk/show-index'Junio C Hamano Mon, 25 Jun 2018 20:22:37 +0000 (13:22 -0700)

Merge branch 'jk/show-index'

Modernize a less often used command.

* jk/show-index:
show-index: update documentation for index v2
make show-index a builtin

Merge branch 'en/merge-recursive-tests'Junio C Hamano Mon, 25 Jun 2018 20:22:36 +0000 (13:22 -0700)

Merge branch 'en/merge-recursive-tests'

Clean up tests in t6xxx series about 'merge' command.

* en/merge-recursive-tests:
t6036: prefer test_when_finished to manual cleanup in following test
t6036, t6042: prefer test_cmp to sequences of test
t6036, t6042: prefer test_path_is_file, test_path_is_missing
t6036, t6042: use test_line_count instead of wc -l
t6036, t6042: use test_create_repo to keep tests independent

Merge branch 'nd/diff-apply-ita'Junio C Hamano Mon, 25 Jun 2018 20:22:36 +0000 (13:22 -0700)

Merge branch 'nd/diff-apply-ita'

"git diff" compares the index and the working tree. For paths
added with intent-to-add bit, the command shows the full contents
of them as added, but the paths themselves were not marked as new
files. They are now shown as new by default.

"git apply" learned the "--intent-to-add" option so that an
otherwise working-tree-only application of a patch will add new
paths to the index marked with the "intent-to-add" bit.

* nd/diff-apply-ita:
apply: add --intent-to-add
t2203: add a test about "diff HEAD" case
diff: turn --ita-invisible-in-index on by default
diff: ignore --ita-[in]visible-in-index when diffing worktree-to-tree

Merge branch 'ds/commit-graph-lockfile-fix'Junio C Hamano Mon, 25 Jun 2018 20:22:36 +0000 (13:22 -0700)

Merge branch 'ds/commit-graph-lockfile-fix'

Update to ds/generation-numbers topic.

* ds/commit-graph-lockfile-fix:
commit-graph: fix UX issue when .lock file exists
commit-graph.txt: update design document
merge: check config before loading commits
commit: use generation number in remove_redundant()
commit: add short-circuit to paint_down_to_common()
commit: use generation numbers for in_merge_bases()
ref-filter: use generation number for --contains
commit-graph: always load commit-graph information
commit: use generations in paint_down_to_common()
commit-graph: compute generation numbers
commit: add generation number to struct commit
ref-filter: fix outdated comment on in_commit_list

Merge branch 'nd/commit-util-to-slab'Junio C Hamano Mon, 25 Jun 2018 20:22:35 +0000 (13:22 -0700)

Merge branch 'nd/commit-util-to-slab'

The in-core "commit" object had an all-purpose "void *util" field,
which was tricky to use especially in library-ish part of the
code. All of the existing uses of the field has been migrated to a
more dedicated "commit-slab" mechanism and the field is eliminated.

* nd/commit-util-to-slab:
commit.h: delete 'util' field in struct commit
merge: use commit-slab in merge remote desc instead of commit->util
log: use commit-slab in prepare_bases() instead of commit->util
show-branch: note about its object flags usage
show-branch: use commit-slab for commit-name instead of commit->util
name-rev: use commit-slab for rev-name instead of commit->util
bisect.c: use commit-slab for commit weight instead of commit->util
revision.c: use commit-slab for show_source
sequencer.c: use commit-slab to associate todo items to commits
sequencer.c: use commit-slab to mark seen commits
shallow.c: use commit-slab for commit depth instead of commit->util
describe: use commit-slab for commit names instead of commit->util
blame: use commit-slab for blame suspects instead of commit->util
commit-slab: support shared commit-slab
commit-slab.h: code split

Merge branch 'pc/submodule-helper-foreach'Junio C Hamano Mon, 25 Jun 2018 20:22:35 +0000 (13:22 -0700)

Merge branch 'pc/submodule-helper-foreach'

The bulk of "git submodule foreach" has been rewritten in C.

* pc/submodule-helper-foreach:
submodule: port submodule subcommand 'foreach' from shell to C
submodule foreach: document variable '$displaypath'
submodule foreach: document '$sm_path' instead of '$path'
submodule foreach: correct '$path' in nested submodules from a subdirectory

Prepare to start 2.19 cycleJunio C Hamano Mon, 25 Jun 2018 20:22:27 +0000 (13:22 -0700)

Prepare to start 2.19 cycle

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

sequencer.c: plug mem leak in git_sequencer_configStefan Beller Fri, 1 Jun 2018 20:01:46 +0000 (13:01 -0700)

sequencer.c: plug mem leak in git_sequencer_config

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

Documentation: spelling and grammar fixesVille Skyttä Fri, 22 Jun 2018 06:50:37 +0000 (09:50 +0300)

Documentation: spelling and grammar fixes

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

branch: deprecate "-l" optionJeff King Fri, 22 Jun 2018 09:24:14 +0000 (05:24 -0400)

branch: deprecate "-l" option

The "-l" option is short for "--create-reflog". This has
caused much confusion over the years. Most people expect it
to work as "--list", because that would match the other
"mode" options like -d/--delete and -m/--move, as well as
the similar -l/--list option of git-tag.

Adding to the confusion, using "-l" _appears_ to work as
"--list" in some cases:

$ git branch -l
* master

because the branch command defaults to listing (so even
trying to specify --list in the command above is redundant).
But that may bite the user later when they add a pattern,
like:

$ git branch -l foo

which does not return an empty list, but in fact creates a
new branch (with a reflog, naturally) called "foo".

It's also probably quite uncommon for people to actually use
"-l" to create a reflog. Since 0bee591869 (Enable reflogs by
default in any repository with a working directory.,
2006-12-14), this is the default in non-bare repositories.
So it's rather unfortunate that the feature squats on the
short-and-sweet "-l" (which was only added in 3a4b3f269c
(Create/delete branch ref logs., 2006-05-19), meaning there
were only 7 months where it was actually useful).

Let's deprecate "-l" in hopes of eventually re-purposing it
to "--list".

Note that we issue the warning only when we're not in list
mode. This means that people for whom it works as a happy
accident, namely:

$ git branch -l
master

won't see the warning at all. And when we eventually switch
to it meaning "--list", that will just continue to work.

We do the issue the warning for these important cases:

- when we are actually creating a branch, in case the user
really did mean it as "--create-reflog"

- when we are in some _other_ mode, like deletion. There
the "-l" is a noop for now, but it will eventually
conflict with any other mode request, and the user
should be told that this is changing.

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

t: switch "branch -l" to "branch --create-reflog"Jeff King Fri, 22 Jun 2018 09:23:59 +0000 (05:23 -0400)

t: switch "branch -l" to "branch --create-reflog"

In preparation for deprecating "-l", let's make sure we're
using the recommended option ourselves.

This patch just mechanically converts "branch -l" to "branch
--create-reflog". Note that with the exception of the
actual "--create-reflog" test, we could actually remove "-l"
entirely from most of these callers. That's because these
days core.logallrefupdates defaults to true in a non-bare
repository.

I've left them in place, though, since they serve to
document the expectation of the test, even if they are
technically noops.

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

t3200: unset core.logallrefupdates when testing reflog... Jeff King Fri, 22 Jun 2018 09:23:52 +0000 (05:23 -0400)

t3200: unset core.logallrefupdates when testing reflog creation

This test checks that the "-l" option creates a reflog. But
in fact we'd create one even without it, since the default
in a non-bare repository is to do so. Let's unset the config
so we can be sure our "-l" option is kicking in.

Note that we can't do this with test_config, since that
would leave the variable unset after our test finishes,
confusing downstream tests (the helper is not not smart
enough to restore the previous value, and just always runs
test_unconfig).

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

protocol-v2 doc: put HTTP headers after requestJosh Steadmon Fri, 22 Jun 2018 19:01:12 +0000 (12:01 -0700)

protocol-v2 doc: put HTTP headers after request

HTTP servers return 400 if you send headers before the GET request.

Signed-off-by: Josh Steadmon <steadmon@google.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

contrib/git-jump/git-jump: jump to exact locationTaylor Blau Fri, 22 Jun 2018 15:49:54 +0000 (10:49 -0500)

contrib/git-jump/git-jump: jump to exact location

Take advantage of 'git-grep(1)''s new option, '--column' in order to
teach Peff's 'git-jump' script how to jump to the correct column for any
given match.

'git-grep(1)''s output is in the correct format for Vim's jump list, so
no additional cleanup is necessary.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

grep.c: add configuration variables to show matched... Taylor Blau Fri, 22 Jun 2018 15:49:49 +0000 (10:49 -0500)

grep.c: add configuration variables to show matched option

To support git-grep(1)'s new option, '--column', document and teach
grep.c how to interpret relevant configuration options, similar to those
associated with '--line-number'.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

builtin/grep.c: add '--column' option to 'git-grep(1)'Taylor Blau Fri, 22 Jun 2018 15:49:45 +0000 (10:49 -0500)

builtin/grep.c: add '--column' option to 'git-grep(1)'

Teach 'git-grep(1)' a new option, '--column', to show the column
number of the first match on a non-context line. This makes it possible
to teach 'contrib/git-jump/git-jump' how to seek to the first matching
position of a grep match in your editor, and allows similar additional
scripting capabilities.

For example:

$ git grep -n --column foo | head -n3
.clang-format:51:14:# myFunction(foo, bar, baz);
.clang-format:64:7:# int foo();
.clang-format:75:8:# void foo()

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>