OSDN Git Service
Junio C Hamano [Wed, 27 Dec 2017 19:16:29 +0000 (11:16 -0800)]
Merge branch 'ot/pretty'
Code clean-up.
* ot/pretty:
format: create docs for pretty.h
format: create pretty.h file
Junio C Hamano [Wed, 27 Dec 2017 19:16:28 +0000 (11:16 -0800)]
Merge branch 'bw/submodule-sans-cache-compat'
Code clean-up.
* bw/submodule-sans-cache-compat:
submodule: convert get_next_submodule to not rely on the_index
submodule: used correct index in is_staging_gitmodules_ok
submodule: convert stage_updated_gitmodules to take a struct index_state
Junio C Hamano [Wed, 27 Dec 2017 19:16:28 +0000 (11:16 -0800)]
Merge branch 'es/clone-shared-worktree'
"git clone --shared" to borrow from a (secondary) worktree did not
work, even though "git clone --local" did. Both are now accepted.
* es/clone-shared-worktree:
clone: support 'clone --shared' from a worktree
Junio C Hamano [Wed, 27 Dec 2017 19:16:27 +0000 (11:16 -0800)]
Merge branch 'tb/delimit-pretty-trailers-args-with-comma'
Doc updates.
* tb/delimit-pretty-trailers-args-with-comma:
docs/pretty-formats: mention commas in %(trailers) syntax
Junio C Hamano [Wed, 27 Dec 2017 19:16:26 +0000 (11:16 -0800)]
Merge branch 'rs/fmt-merge-msg-leakfix'
Leakfix.
* rs/fmt-merge-msg-leakfix:
transport-helper: plug strbuf and string_list leaks
Junio C Hamano [Wed, 27 Dec 2017 19:16:26 +0000 (11:16 -0800)]
Merge branch 'jt/decorate-api'
A few structures and variables that are implementation details of
the decorate API have been renamed and then the API got documented
better.
* jt/decorate-api:
decorate: clean up and document API
Junio C Hamano [Wed, 27 Dec 2017 19:16:26 +0000 (11:16 -0800)]
Merge branch 'jk/cvsimport-quoting'
Typo/Logico fix.
* jk/cvsimport-quoting:
cvsimport: apply shell-quoting regex globally
Junio C Hamano [Wed, 27 Dec 2017 19:16:25 +0000 (11:16 -0800)]
Merge branch 'db/doc-workflows-neuter-the-maintainer'
Docfix.
* db/doc-workflows-neuter-the-maintainer:
doc: reword gitworkflows.txt for neutrality
Junio C Hamano [Wed, 27 Dec 2017 19:16:25 +0000 (11:16 -0800)]
Merge branch 'ks/branch-cleanup'
Code clean-up.
* ks/branch-cleanup:
builtin/branch: strip refs/heads/ using skip_prefix
branch: update warning message shown when copying a misnamed branch
branch: group related arguments of create_branch()
branch: improve documentation and naming of create_branch() parameters
Junio C Hamano [Wed, 27 Dec 2017 19:16:24 +0000 (11:16 -0800)]
Merge branch 'rs/strbuf-read-once-reset-length'
Leakfix.
* rs/strbuf-read-once-reset-length:
strbuf: release memory on read error in strbuf_read_once()
Junio C Hamano [Wed, 27 Dec 2017 19:16:23 +0000 (11:16 -0800)]
Merge branch 'rs/fmt-merge-msg-string-leak-fix'
Leakfix.
* rs/fmt-merge-msg-string-leak-fix:
fmt-merge-msg: avoid leaking strbuf in shortlog()
Junio C Hamano [Wed, 27 Dec 2017 19:16:22 +0000 (11:16 -0800)]
Merge branch 'rs/am-builtin-leakfix'
Leakfix.
* rs/am-builtin-leakfix:
am: release strbuf after use in split_mail_mbox()
Junio C Hamano [Wed, 27 Dec 2017 19:16:21 +0000 (11:16 -0800)]
Merge branch 'es/worktree-checkout-hook'
"git worktree add" learned to run the post-checkout hook, just like
"git checkout" does, after the initial checkout.
* es/worktree-checkout-hook:
worktree: invoke post-checkout hook (unless --no-checkout)
Junio C Hamano [Wed, 27 Dec 2017 19:16:21 +0000 (11:16 -0800)]
Merge branch 'lb/rebase-i-short-command-names'
With a configuration variable rebase.abbreviateCommands set,
"git rebase -i" produces the todo list with a single-letter
command names.
* lb/rebase-i-short-command-names:
sequencer.c: drop 'const' from function return type
t3404: add test case for abbreviated commands
rebase -i: learn to abbreviate command names
rebase -i -x: add exec commands via the rebase--helper
rebase -i: update functions to use a flags parameter
rebase -i: replace reference to sha1 with oid
rebase -i: refactor transform_todo_ids
rebase -i: set commit to null in exec commands
Documentation: use preferred name for the 'todo list' script
Documentation: move rebase.* configs to new file
Junio C Hamano [Wed, 27 Dec 2017 19:16:21 +0000 (11:16 -0800)]
Merge branch 'tb/check-crlf-for-safe-crlf'
The "safe crlf" check incorrectly triggered for contents that does
not use CRLF as line endings, which has been corrected.
* tb/check-crlf-for-safe-crlf:
t0027: Adapt the new MIX tests to Windows
convert: tighten the safe autocrlf handling
Junio C Hamano [Wed, 27 Dec 2017 19:16:20 +0000 (11:16 -0800)]
Merge branch 'jh/object-filtering'
In preparation for implementing narrow/partial clone, the object
walking machinery has been taught a way to tell it to "filter" some
objects from enumeration.
* jh/object-filtering:
rev-list: support --no-filter argument
list-objects-filter-options: support --no-filter
list-objects-filter-options: fix 'keword' typo in comment
pack-objects: add list-objects filtering
rev-list: add list-objects filtering support
list-objects: filter objects in traverse_commit_list
oidset: add iterator methods to oidset
oidmap: add oidmap iterator methods
dir: allow exclusions from blob in addition to file
Junio C Hamano [Wed, 27 Dec 2017 19:12:45 +0000 (11:12 -0800)]
sequencer.c: drop 'const' from function return type
With -Werror=ignored-qualifiers, a function that claims to return
"const char" gets this error:
CC sequencer.o
sequencer.c:798:19: error: type qualifiers ignored on function return
type [-Werror=ignored-qualifiers]
static const char command_to_char(const enum todo_command command)
^
Reported-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 19 Dec 2017 19:34:35 +0000 (11:34 -0800)]
RelNotes: the tenth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Tue, 19 Dec 2017 19:33:59 +0000 (11:33 -0800)]
Merge branch 'ls/editor-waiting-message'
Git shows a message to tell the user that it is waiting for the
user to finish editing when spawning an editor, in case the editor
opens to a hidden window or somewhere obscure and the user gets
lost.
* ls/editor-waiting-message:
launch_editor(): indicate that Git waits for user input
refactor "dumb" terminal determination
Junio C Hamano [Tue, 19 Dec 2017 19:33:58 +0000 (11:33 -0800)]
Merge branch 'sg/setup-doc-update'
Comment update.
* sg/setup-doc-update:
setup.c: fix comment about order of .git directory discovery
Junio C Hamano [Tue, 19 Dec 2017 19:33:58 +0000 (11:33 -0800)]
Merge branch 'ar/unconfuse-three-dots'
Ancient part of codebase still shows dots after an abbreviated
object name just to show that it is not a full object name, but
these ellipses are confusing to people who newly discovered Git
who are used to seeing abbreviated object names and find them
confusing with the range syntax.
* ar/unconfuse-three-dots:
t2020: test variations that matter
t4013: test new output from diff --abbrev --raw
diff: diff_aligned_abbrev: remove ellipsis after abbreviated SHA-1 value
t4013: prepare for upcoming "diff --raw --abbrev" output format change
checkout: describe_detached_head: remove ellipsis after committish
print_sha1_ellipsis: introduce helper
Documentation: user-manual: limit usage of ellipsis
Documentation: revisions: fix typo: "three dot" ---> "three-dot" (in line with "two-dot").
Junio C Hamano [Tue, 19 Dec 2017 19:33:57 +0000 (11:33 -0800)]
Merge branch 'tg/worktree-create-tracking'
The way "git worktree add" determines what branch to create from
where and checkout in the new worktree has been updated a bit.
* tg/worktree-create-tracking:
add worktree.guessRemote config option
worktree: add --guess-remote flag to add subcommand
worktree: make add <path> <branch> dwim
worktree: add --[no-]track option to the add subcommand
worktree: add can be created from any commit-ish
checkout: factor out functions to new lib file
Junio C Hamano [Tue, 19 Dec 2017 19:33:57 +0000 (11:33 -0800)]
Merge branch 'gk/tracing-optimization'
The tracing infrastructure has been optimized for cases where no
tracing is requested.
* gk/tracing-optimization:
trace: improve performance while category is disabled
trace: remove trace key normalization
Junio C Hamano [Tue, 19 Dec 2017 19:33:57 +0000 (11:33 -0800)]
Merge branch 'bw/submodule-config-cleanup'
Recent update to the submodule configuration code broke "diff-tree"
by accidentally stopping to read from the index upfront.
* bw/submodule-config-cleanup:
diff-tree: read the index so attribute checks work in bare repositories
Junio C Hamano [Tue, 19 Dec 2017 19:33:56 +0000 (11:33 -0800)]
Merge branch 'sb/clone-recursive-submodule-doc'
Doc update.
* sb/clone-recursive-submodule-doc:
Documentation/git-clone: improve description for submodule recursing
Junio C Hamano [Tue, 19 Dec 2017 19:33:56 +0000 (11:33 -0800)]
Merge branch 'ls/git-gui-no-double-utf8-author-name'
Amending commits in git-gui broke the author name that is non-ascii
due to incorrect enconding conversion.
* ls/git-gui-no-double-utf8-author-name:
git-gui: prevent double UTF-8 conversion
Junio C Hamano [Tue, 19 Dec 2017 19:33:56 +0000 (11:33 -0800)]
Merge branch 'bw/pathspec-match-submodule-boundary'
An v2.12-era regression in pathspec match logic, which made it look
into submodule tree even when it is not desired, has been fixed.
* bw/pathspec-match-submodule-boundary:
pathspec: only match across submodule boundaries when requested
Junio C Hamano [Tue, 19 Dec 2017 19:33:56 +0000 (11:33 -0800)]
Merge branch 'jt/diff-anchored-patience'
"git diff" learned a variant of the "--patience" algorithm, to
which the user can specify which 'unique' line to be used as
anchoring points.
* jt/diff-anchored-patience:
diff: support anchoring line(s)
Junio C Hamano [Tue, 19 Dec 2017 19:33:55 +0000 (11:33 -0800)]
Merge branch 'en/merge-recursive-icase-removal'
The code internal to the recursive merge strategy was not fully
prepared to see a path that is renamed to try overwriting another
path that is only different in case on case insensitive systems.
This does not matter in the current code, but will start to matter
once the rename detection logic starts taking hints from nearby
paths moving to some directory and moves a new path along with them.
* en/merge-recursive-icase-removal:
merge-recursive: ignore_case shouldn't reject intentional removals
Junio C Hamano [Tue, 19 Dec 2017 19:33:55 +0000 (11:33 -0800)]
Merge branch 'en/rename-progress'
Historically, the diff machinery for rename detection had a
hardcoded limit of 32k paths; this is being lifted to allow users
trade cycles with a (possibly) easier to read result.
* en/rename-progress:
diffcore-rename: make diff-tree -l0 mean -l<large>
sequencer: show rename progress during cherry picks
diff: remove silent clamp of renameLimit
progress: fix progress meters when dealing with lots of work
sequencer: warn when internal merge may be suboptimal due to renameLimit
Todd Zullinger [Thu, 14 Dec 2017 02:42:44 +0000 (21:42 -0500)]
RelNotes: minor typo fixes in 2.16.0 draft
Signed-off-by: Todd Zullinger <tmz@pobox.com>
Junio C Hamano [Wed, 13 Dec 2017 21:32:34 +0000 (13:32 -0800)]
RelNotes: the ninth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 13 Dec 2017 21:28:58 +0000 (13:28 -0800)]
Merge branch 'js/hashmap-update-sample'
Code comment update.
* js/hashmap-update-sample:
hashmap: adjust documentation to reflect reality
Junio C Hamano [Wed, 13 Dec 2017 21:28:58 +0000 (13:28 -0800)]
Merge branch 'en/remove-stripspace'
An internal function that was left for backward compatibility has
been removed, as there is no remaining callers.
* en/remove-stripspace:
strbuf: remove unused stripspace function alias
Junio C Hamano [Wed, 13 Dec 2017 21:28:58 +0000 (13:28 -0800)]
Merge branch 'jk/no-optional-locks'
Doc update for a feature available in Git v2.14 and upwards.
* jk/no-optional-locks:
git-status.txt: mention --no-optional-locks
Junio C Hamano [Wed, 13 Dec 2017 21:28:57 +0000 (13:28 -0800)]
Merge branch 'ds/for-each-file-in-obj-micro-optim'
The code to iterate over loose object files got optimized.
* ds/for-each-file-in-obj-micro-optim:
sha1_file: use strbuf_add() instead of strbuf_addf()
Junio C Hamano [Wed, 13 Dec 2017 21:28:57 +0000 (13:28 -0800)]
Merge branch 'jk/progress-delay-fix'
A regression in the progress eye-candy was fixed.
* jk/progress-delay-fix:
progress: drop delay-threshold code
progress: set default delay threshold to 100%, not 0%
Junio C Hamano [Wed, 13 Dec 2017 21:28:57 +0000 (13:28 -0800)]
Merge branch 'ks/doc-checkout-previous'
@{-N} in "git checkout @{-N}" may refer to a detached HEAD state,
but the documentation was not clear about it, which has been fixed.
* ks/doc-checkout-previous:
Doc/checkout: checking out using @{-N} can lead to detached state
Junio C Hamano [Wed, 13 Dec 2017 21:28:56 +0000 (13:28 -0800)]
Merge branch 'fk/sendmail-from-path'
"git send-email" tries to see if the sendmail program is available
in /usr/lib and /usr/sbin; extend the list of locations to be
checked to also include directories on $PATH.
* fk/sendmail-from-path:
git-send-email: honor $PATH for sendmail binary
Junio C Hamano [Wed, 13 Dec 2017 21:28:56 +0000 (13:28 -0800)]
Merge branch 'tg/t-readme-updates'
Developer doc updates.
* tg/t-readme-updates:
t/README: document test_cmp_rev
t/README: remove mention of adding copyright notices
Junio C Hamano [Wed, 13 Dec 2017 21:28:56 +0000 (13:28 -0800)]
Merge branch 'pc/submodule-helper'
A message fix.
* pc/submodule-helper:
submodule--helper.c: i18n: add a missing space in message
Junio C Hamano [Wed, 13 Dec 2017 21:28:55 +0000 (13:28 -0800)]
Merge branch 'jc/receive-pack-hook-doc'
Doc update.
* jc/receive-pack-hook-doc:
hooks doc: clarify when receive-pack invokes its hooks
Junio C Hamano [Wed, 13 Dec 2017 21:28:54 +0000 (13:28 -0800)]
Merge branch 'ab/pcre2-grep'
"git grep" compiled with libpcre2 sometimes triggered a segfault,
which is being fixed.
* ab/pcre2-grep:
grep: fix segfault under -P + PCRE2 <=10.30 + (*NO_JIT)
test-lib: add LIBPCRE1 & LIBPCRE2 prerequisites
Junio C Hamano [Wed, 13 Dec 2017 21:28:54 +0000 (13:28 -0800)]
Merge branch 'ra/decorate-limit-refs'
The tagnames "git log --decorate" uses to annotate the commits can
now be limited to subset of available refs with the two additional
options, --decorate-refs[-exclude]=<pattern>.
* ra/decorate-limit-refs:
log: add option to choose which refs to decorate
Junio C Hamano [Wed, 13 Dec 2017 21:28:54 +0000 (13:28 -0800)]
Merge branch 'bc/hash-algo'
An infrastructure to define what hash function is used in Git is
introduced, and an effort to plumb that throughout various
codepaths has been started.
* bc/hash-algo:
repository: fix a sparse 'using integer as NULL pointer' warning
Switch empty tree and blob lookups to use hash abstraction
Integrate hash algorithm support with repo setup
Add structure representing hash algorithm
setup: expose enumerated repo info
Brandon Williams [Tue, 12 Dec 2017 19:53:52 +0000 (11:53 -0800)]
submodule: convert get_next_submodule to not rely on the_index
Instead of implicitly relying on the global 'the_index', convert
'get_next_submodule()' to use the index of the repository stored in the
callback data 'struct submodule_parallel_fetch'.
Since this removes the last user of the index compatibility macros,
define 'NO_THE_INDEX_COMPATIBILITY_MACROS' to prevent future users of
these macros in submodule.c.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Williams [Tue, 12 Dec 2017 19:53:51 +0000 (11:53 -0800)]
submodule: used correct index in is_staging_gitmodules_ok
Commit
883e248b8 (fsmonitor: teach git to optionally utilize a file
system monitor to speed up detecting new or changed files., 2017-09-22)
introduced a call to 'ce_match_stat()' in 'is_staging_gitmodules_ok()'
which implicitly relys on the the global 'the_index' instead of the
passed in 'struct index_state'. Fix this by changing the call to
'ie_match_stat()' and using the passed in index_state struct.
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Williams [Tue, 12 Dec 2017 19:53:50 +0000 (11:53 -0800)]
submodule: convert stage_updated_gitmodules to take a struct index_state
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Olga Telezhnaya [Tue, 12 Dec 2017 08:55:35 +0000 (08:55 +0000)]
format: create docs for pretty.h
Write some docs for functions in pretty.h.
Take it as a first draft, they would be changed later.
Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Olga Telezhnaya [Tue, 12 Dec 2017 08:55:35 +0000 (08:55 +0000)]
format: create pretty.h file
Create header for pretty.c to make formatting interface more structured.
This is a middle point, this file would be merged further with other
files which contain formatting stuff.
Signed-off-by: Olga Telezhnaia <olyatelezhnaya@gmail.com>
Mentored-by: Christian Couder <christian.couder@gmail.com>
Mentored by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Sunshine [Mon, 11 Dec 2017 23:16:12 +0000 (18:16 -0500)]
clone: support 'clone --shared' from a worktree
When worktree functionality was originally implemented, the possibility
of 'clone --local' from within a worktree was overlooked, with the
result that the location of the "objects" directory of the source
repository was computed incorrectly, thus the objects could not be
copied or hard-linked by the clone. This shortcoming was addressed by
744e469755 (clone: allow --local from a linked checkout, 2015-09-28).
However, the related case of 'clone --shared' (despite being handled
only a few lines away from the 'clone --local' case) was not fixed by
744e469755, with a similar result of the "objects" directory location
being incorrectly computed for insertion into the 'alternates' file.
Fix this.
Reported-by: Marc-André Lureau <marcandre.lureau@gmail.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Fri, 8 Dec 2017 17:29:31 +0000 (18:29 +0100)]
transport-helper: plug strbuf and string_list leaks
Transfer ownership of detached strbufs to string_lists of the
duplicating variety by calling string_list_append_nodup() instead of
string_list_append() to avoid duplicating and then leaking the buffer.
While at it make sure to release the string_list when done;
push_refs_with_export() already does that.
Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Torsten Bögershausen [Fri, 8 Dec 2017 17:46:36 +0000 (18:46 +0100)]
t0027: Adapt the new MIX tests to Windows
The new MIX tests don't pass under Windows, adapt them
to use the correct native line ending.
Signed-off-by: Torsten Bögershausen <tboegi@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Daniel Bensoussan [Fri, 8 Dec 2017 15:18:07 +0000 (16:18 +0100)]
doc: reword gitworkflows.txt for neutrality
Change 'he' to 'them' to be more neutral in "gitworkflows.txt".
Signed-off-by: Matthieu Moy <matthieu.moy@univ-lyon1.fr>
Signed-off-by: Timothee Albertin <timothee.albertin@etu.univ-lyon1.fr>
Signed-off-by: Nathan Payre <nathan.payre@etu.univ-lyon1.fr>
Signed-off-by: Daniel Bensoussan <daniel.bensoussan--bohm@etu.univ-lyon1.fr>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jonathan Tan [Fri, 8 Dec 2017 00:14:24 +0000 (16:14 -0800)]
decorate: clean up and document API
Improve the names of the identifiers in decorate.h, document them, and
add an example of how to use these functions.
The example is compiled and run as part of the test suite.
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Fri, 8 Dec 2017 09:58:19 +0000 (04:58 -0500)]
cvsimport: apply shell-quoting regex globally
Commit
5b4efea666 (cvsimport: shell-quote variable used in
backticks, 2017-09-11) tried to shell-quote a variable, but
forgot to use the "/g" modifier to apply the quoting to the
whole variable. This means we'd miss any embedded
single-quotes after the first one.
Reported-by: <littlelailo@yahoo.com>
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King [Fri, 8 Dec 2017 05:16:36 +0000 (00:16 -0500)]
docs/pretty-formats: mention commas in %(trailers) syntax
Commit
84ff053d47 (pretty.c: delimit "%(trailers)" arguments
with ",", 2017-10-01) switched the syntax of the trailers
placeholder, but forgot to update the documentation in
pretty-formats.txt.
There's no need to mention the old syntax; it was never in a
released version of Git.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Kaartic Sivaraam [Fri, 1 Dec 2017 05:59:33 +0000 (11:29 +0530)]
builtin/branch: strip refs/heads/ using skip_prefix
Instead of hard-coding the offset strlen("refs/heads/") to skip
the prefix "refs/heads/" use the skip_prefix() function which
is more communicative and verifies that the string actually
starts with that prefix.
Signed-off-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Kaartic Sivaraam [Sat, 18 Nov 2017 17:26:47 +0000 (22:56 +0530)]
branch: update warning message shown when copying a misnamed branch
When a user tries to rename a branch that has a "bad name" (e.g.,
starts with a '-') then we warn them that the misnamed branch has
been renamed "away". A similar message is shown when trying to create
a copy of a misnamed branch even though it doesn't remove the misnamed
branch. This is not correct and may confuse the user.
So, update the warning message shown to be more precise that only a copy
of the misnamed branch has been created. It's better to show the warning
message than not showing it at all as it makes the user aware of the
presence of a misnamed branch.
Signed-off-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Kaartic Sivaraam [Sat, 18 Nov 2017 17:26:46 +0000 (22:56 +0530)]
branch: group related arguments of create_branch()
39bd6f726 (Allow checkout -B <current-branch> to update the current
branch, 2011-11-26) added 'clobber_head' (now, 'clobber_head_ok')
"before" 'track' as 'track' was closely related 'clobber_head' for
the purpose the commit wanted to achieve. Looking from the perspective
of how the arguments are used it turns out that 'clobber_head' is
more related to 'force' than it is to 'track'.
So, re-order the arguments to keep the related arguments close
to each other.
Signed-off-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Kaartic Sivaraam [Sat, 18 Nov 2017 17:26:45 +0000 (22:56 +0530)]
branch: improve documentation and naming of create_branch() parameters
The documentation for 'create_branch()' was incomplete as it didn't say
what certain parameters were used for. Further a parameter name wasn't
very communicative.
So, add missing documentation for the sake of completeness and easy
reference. Also, rename the concerned parameter to make its name more
communicative.
Signed-off-by: Kaartic Sivaraam <kaartic.sivaraam@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Eric Sunshine [Thu, 7 Dec 2017 21:20:17 +0000 (16:20 -0500)]
worktree: invoke post-checkout hook (unless --no-checkout)
git-clone and git-checkout both invoke the post-checkout hook following
a successful checkout, yet git-worktree neglects to do so even though it
too "checks out" the worktree. Fix this oversight.
Implementation note: The newly-created worktree may reference a branch
or be detached. In the latter case, a commit lookup is performed, though
the result is used only in a boolean sense to (a) determine if the
commit actually exists, and (b) assign either the branch name or commit
ID to HEAD. Since the post-commit hook needs to know the ID of the
checked-out commit, the lookup now needs to be done in all cases, rather
than only when detached. Consequently, a new boolean is needed to handle
(b) since the lookup result itself can no longer perform that role.
Reported-by: Matthew K Gumbel <matthew.k.gumbel@intel.com>
Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Thu, 7 Dec 2017 20:51:26 +0000 (21:51 +0100)]
strbuf: release memory on read error in strbuf_read_once()
If other strbuf add functions cause the first allocation and
subsequently encounter an error then they release the memory, restoring
the pristine state of the strbuf. That simplifies error handling for
callers.
Do the same in strbuf_read_once(), and do it also in case no bytes were
read -- which may or may not be an error as well, depending on the
caller.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Thu, 7 Dec 2017 20:22:49 +0000 (21:22 +0100)]
fmt-merge-msg: avoid leaking strbuf in shortlog()
Use string_list_append_nodup() instead of string_list_append() to hand
over ownership of a detached strbuf and thus avoid leaking its memory.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
René Scharfe [Thu, 7 Dec 2017 20:20:19 +0000 (21:20 +0100)]
am: release strbuf after use in split_mail_mbox()
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Lars Schneider [Thu, 7 Dec 2017 15:16:41 +0000 (16:16 +0100)]
launch_editor(): indicate that Git waits for user input
When a graphical GIT_EDITOR is spawned by a Git command that opens
and waits for user input (e.g. "git rebase -i"), then the editor window
might be obscured by other windows. The user might be left staring at
the original Git terminal window without even realizing that s/he needs
to interact with another window before Git can proceed. To this user Git
appears hanging.
Print a message that Git is waiting for editor input in the original
terminal and get rid of it when the editor returns, if the terminal
supports erasing the last line. Also, make sure that our message is
terminated with a whitespace so that any message the editor may show
upon starting up will be kept separate from our message.
Power users might not want to see this message or their editor might
already print such a message (e.g. emacsclient). Allow these users to
suppress the message by disabling the "advice.waitingForEditor" config.
The standard advise() function is not used here as it would always add
a newline which would make deleting the message harder.
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Lars Schneider <larsxschneider@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
SZEDER Gábor [Thu, 7 Dec 2017 08:59:49 +0000 (09:59 +0100)]
setup.c: fix comment about order of .git directory discovery
Since gitfiles were introduced in
b44ebb19e (Add platform-independent
.git "symlink", 2008-02-20) the order of checks during .git directory
discovery is: gitfile, gitdir, bare repo. However, that commit did
only partially update the in-code comment describing this order,
missing the last line which still puts gitdir before gitfile.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Williams [Wed, 6 Dec 2017 22:02:56 +0000 (14:02 -0800)]
diff-tree: read the index so attribute checks work in bare repositories
A regression was introduced in
557a5998d (submodule: remove
gitmodules_config, 2017-08-03) to how attribute processing was handled
in bare repositories when running the diff-tree command.
By default the attribute system will first try to read ".gitattribute"
files from the working tree and then falls back to reading them from the
index if there isn't a copy checked out in the worktree. Prior to
557a5998d the index was read as a side effect of the call to
'gitmodules_config()' which ensured that the index was already populated
before entering the attribute subsystem.
Since the call to 'gitmodules_config()' was removed the index is no
longer being read so when the attribute system tries to read from the
in-memory index it doesn't find any ".gitattribute" entries effectively
ignoring any configured attributes.
Fix this by explicitly reading the index during the setup of diff-tree.
Reported-by: Ben Boeckel <ben.boeckel@kitware.com>
Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Gummerer [Wed, 29 Nov 2017 20:04:51 +0000 (20:04 +0000)]
add worktree.guessRemote config option
Some users might want to have the --guess-remote option introduced in
the previous commit on by default, so they don't have to type it out
every time they create a new worktree.
Add a config option worktree.guessRemote that allows users to configure
the default behaviour for themselves.
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Thomas Gummerer [Wed, 29 Nov 2017 20:04:50 +0000 (20:04 +0000)]
worktree: add --guess-remote flag to add subcommand
Currently 'git worktree add <path>' creates a new branch named after the
basename of the <path>, that matches the HEAD of whichever worktree we
were on when calling "git worktree add <path>".
It's sometimes useful to have 'git worktree add <path> behave more like
the dwim machinery in 'git checkout <new-branch>', i.e. check if the new
branch name, derived from the basename of the <path>, uniquely matches
the branch name of a remote-tracking branch, and if so check out that
branch and set the upstream to the remote-tracking branch.
Add a new --guess-remote option that enables exactly that behaviour.
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Gennady Kupava [Sun, 26 Nov 2017 20:11:19 +0000 (20:11 +0000)]
trace: improve performance while category is disabled
Move just enough code from trace.c into trace.h header so all code
necessary to determine that trace is disabled could be inlined to
calling functions. Then perform the check if the trace key is
enabled sooner in call chain.
Signed-off-by: Gennady Kupava <gkupava@bloomberg.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 6 Dec 2017 17:29:50 +0000 (09:29 -0800)]
RelNotes: the eighth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 6 Dec 2017 17:27:59 +0000 (09:27 -0800)]
Sync with maint
Junio C Hamano [Wed, 6 Dec 2017 17:23:45 +0000 (09:23 -0800)]
Merge branch 'jn/ssh-wrappers'
The ssh-variant 'simple' introduced earlier broke existing
installations by not passing --port/-4/-6 and not diagnosing an
attempt to pass these as an error. Instead, default to
automatically detect how compatible the GIT_SSH/GIT_SSH_COMMAND is
to OpenSSH convention and then error out an invocation to make it
easier to diagnose connection errors.
* jn/ssh-wrappers:
connect: correct style of C-style comment
ssh: 'simple' variant does not support --port
ssh: 'simple' variant does not support -4/-6
ssh: 'auto' variant to select between 'ssh' and 'simple'
connect: split ssh option computation to its own function
connect: split ssh command line options into separate function
connect: split git:// setup into a separate function
connect: move no_fork fallback to git_tcp_connect
ssh test: make copy_ssh_wrapper_as clean up after itself
Junio C Hamano [Wed, 6 Dec 2017 17:23:44 +0000 (09:23 -0800)]
Merge branch 'bw/protocol-v1'
A new mechanism to upgrade the wire protocol in place is proposed
and demonstrated that it works with the older versions of Git
without harming them.
* bw/protocol-v1:
Documentation: document Extra Parameters
ssh: introduce a 'simple' ssh variant
i5700: add interop test for protocol transition
http: tell server that the client understands v1
connect: tell server that the client understands v1
connect: teach client to recognize v1 server response
upload-pack, receive-pack: introduce protocol version 1
daemon: recognize hidden request arguments
protocol: introduce protocol extension mechanisms
pkt-line: add packet_write function
connect: in ref advertisement, shallows are last
Junio C Hamano [Wed, 6 Dec 2017 17:23:43 +0000 (09:23 -0800)]
Merge branch 'sp/doc-info-attributes'
Doc update.
* sp/doc-info-attributes:
doc: Mention info/attributes in gitrepository-layout
Junio C Hamano [Wed, 6 Dec 2017 17:23:42 +0000 (09:23 -0800)]
Merge branch 'ph/stash-save-m-option-fix'
In addition to "git stash -m message", the command learned to
accept "git stash -mmessage" form.
* ph/stash-save-m-option-fix:
stash: learn to parse -m/--message like commit does
Junio C Hamano [Wed, 6 Dec 2017 17:23:42 +0000 (09:23 -0800)]
Merge branch 'jk/fewer-pack-rescan'
Internaly we use 0{40} as a placeholder object name to signal the
codepath that there is no such object (e.g. the fast-forward check
while "git fetch" stores a new remote-tracking ref says "we know
there is no 'old' thing pointed at by the ref, as we are creating
it anew" by passing 0{40} for the 'old' side), and expect that a
codepath to locate an in-core object to return NULL as a sign that
the object does not exist. A look-up for an object that does not
exist however is quite costly with a repository with large number
of packfiles. This access pattern has been optimized.
* jk/fewer-pack-rescan:
sha1_file: fast-path null sha1 as a missing object
everything_local: use "quick" object existence check
p5551: add a script to test fetch pack-dir rescans
t/perf/lib-pack: use fast-import checkpoint to create packs
p5550: factor out nonsense-pack creation
Junio C Hamano [Wed, 6 Dec 2017 17:23:41 +0000 (09:23 -0800)]
Merge branch 'tg/deprecate-stash-save'
Doc update.
* tg/deprecate-stash-save:
doc: prefer 'stash push' over 'stash save'
Junio C Hamano [Wed, 6 Dec 2017 17:23:40 +0000 (09:23 -0800)]
Merge branch 'rd/doc-notes-prune-fix'
Doc update.
* rd/doc-notes-prune-fix:
notes: correct 'git notes prune' options to '[-n] [-v]'
Junio C Hamano [Wed, 6 Dec 2017 17:23:39 +0000 (09:23 -0800)]
Merge branch 'rd/man-reflog-add-n'
Doc update.
* rd/man-reflog-add-n:
doc: add missing "-n" (dry-run) option to reflog man page
Junio C Hamano [Wed, 6 Dec 2017 17:23:39 +0000 (09:23 -0800)]
Merge branch 'rd/man-prune-progress'
Doc update.
* rd/man-prune-progress:
prune: add "--progress" to man page and usage msg
Junio C Hamano [Wed, 6 Dec 2017 17:23:38 +0000 (09:23 -0800)]
Merge branch 'jt/submodule-tests-cleanup'
Further test clean-up.
* jt/submodule-tests-cleanup:
Tests: clean up submodule recursive helpers
Junio C Hamano [Wed, 6 Dec 2017 17:23:37 +0000 (09:23 -0800)]
Merge branch 'jn/reproducible-build'
The build procedure has been taught to avoid some unnecessary
instability in the build products.
* jn/reproducible-build:
generate-cmdlist: avoid non-deterministic output
git-gui: sort entries in optimized tclIndex
Junio C Hamano [Wed, 6 Dec 2017 17:23:37 +0000 (09:23 -0800)]
Merge branch 'cc/git-packet-pm'
Code clean-up.
* cc/git-packet-pm:
Git/Packet.pm: use 'if' instead of 'unless'
Git/Packet: clarify that packet_required_key_val_read allows EOF
Junio C Hamano [Wed, 6 Dec 2017 17:23:37 +0000 (09:23 -0800)]
Merge branch 'ac/complete-pull-autostash'
The shell completion (in contrib/) learned that "git pull" can take
the "--autostash" option.
* ac/complete-pull-autostash:
completion: add --autostash and --no-autostash to pull
Junio C Hamano [Wed, 6 Dec 2017 17:23:37 +0000 (09:23 -0800)]
Merge branch 'hm/config-parse-expiry-date'
"git config --expiry-date gc.reflogexpire" can read "2.weeks" from
the configuration and report it as a timestamp, just like "--int"
would read "1k" and report 1024, to help consumption by scripts.
* hm/config-parse-expiry-date:
config: add --expiry-date
Junio C Hamano [Wed, 6 Dec 2017 17:23:36 +0000 (09:23 -0800)]
Merge branch 'tz/branch-doc-remove-set-upstream'
"git branch --set-upstream" has been deprecated and (sort of)
removed, as "--set-upstream-to" is the preferred one these days.
The documentation still had "--set-upstream" listed on its
synopsys section, which has been corrected.
* tz/branch-doc-remove-set-upstream:
branch doc: remove --set-upstream from synopsis
Junio C Hamano [Wed, 6 Dec 2017 17:23:36 +0000 (09:23 -0800)]
Merge branch 'cc/perf-run-config'
* cc/perf-run-config:
perf: store subsection results in "test-results/$GIT_PERF_SUBSECTION/"
perf/run: show name of rev being built
perf/run: add run_subsection()
perf/run: update get_var_from_env_or_config() for subsections
perf/run: add get_subsections()
perf/run: add calls to get_var_from_env_or_config()
perf/run: add GIT_PERF_DIRS_OR_REVS
perf/run: add get_var_from_env_or_config()
perf/run: add '--config' option to the 'run' script
Junio C Hamano [Wed, 6 Dec 2017 17:23:35 +0000 (09:23 -0800)]
Merge branch 'sb/submodule-recursive-checkout-detach-head'
"git checkout --recursive" may overwrite and rewind the history of
the branch that happens to be checked out in submodule
repositories, which might not be desirable. Detach the HEAD but
still allow the recursive checkout to succeed in such a case.
* sb/submodule-recursive-checkout-detach-head:
Documentation/checkout: clarify submodule HEADs to be detached
recursive submodules: detach HEAD from new state
Junio C Hamano [Wed, 6 Dec 2017 17:10:35 +0000 (09:10 -0800)]
Prepare for 2.15.2
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano [Wed, 6 Dec 2017 17:09:05 +0000 (09:09 -0800)]
Merge branch 'jc/merge-base-fork-point-doc' into maint
Clarify and enhance documentation for "merge-base --fork-point", as
it was clear what it computed but not why/what for.
* jc/merge-base-fork-point-doc:
merge-base --fork-point doc: clarify the example and failure modes
Junio C Hamano [Wed, 6 Dec 2017 17:09:04 +0000 (09:09 -0800)]
Merge branch 'tz/redirect-fix' into maint
A few scripts (both in production and tests) incorrectly redirected
their error output. These have been corrected.
* tz/redirect-fix:
rebase: fix stderr redirect in apply_autostash()
t/lib-gpg: fix gpgconf stderr redirect to /dev/null
Junio C Hamano [Wed, 6 Dec 2017 17:09:04 +0000 (09:09 -0800)]
Merge branch 'tz/notes-error-to-stderr' into maint
"git notes" sent its error message to its standard output stream,
which was corrected.
* tz/notes-error-to-stderr:
notes: send "Automatic notes merge failed" messages to stderr
Junio C Hamano [Wed, 6 Dec 2017 17:09:03 +0000 (09:09 -0800)]
Merge branch 'sb/test-cherry-pick-submodule-getting-in-a-way' into maint
The three-way merge performed by "git cherry-pick" was confused
when a new submodule was added in the meantime, which has been
fixed (or "papered over").
* sb/test-cherry-pick-submodule-getting-in-a-way:
merge-recursive: handle addition of submodule on our side of history
t/3512: demonstrate unrelated submodule/file conflict as cherry-pick failure
Junio C Hamano [Wed, 6 Dec 2017 17:09:03 +0000 (09:09 -0800)]
Merge branch 'pw/sequencer-recover-from-unlockable-index' into maint
The sequencer machinery (used by "git cherry-pick A..B", and "git
rebase -i", among other things) would have lost a commit if stopped
due to an unlockable index file, which has been fixed.
* pw/sequencer-recover-from-unlockable-index:
sequencer: reschedule pick if index can't be locked
Junio C Hamano [Wed, 6 Dec 2017 17:09:03 +0000 (09:09 -0800)]
Merge branch 'rs/apply-inaccurate-eof-with-incomplete-line' into maint
"git apply --inaccurate-eof" when used with "--ignore-space-change"
triggered an internal sanity check, which has been fixed.
* rs/apply-inaccurate-eof-with-incomplete-line:
apply: update line lengths for --inaccurate-eof
Junio C Hamano [Wed, 6 Dec 2017 17:09:02 +0000 (09:09 -0800)]
Merge branch 'tz/complete-branch-copy' into maint
Command line completion (in contrib/) has been taught about the
"--copy" option of "git branch".
* tz/complete-branch-copy:
completion: add '--copy' option to 'git branch'
Junio C Hamano [Wed, 6 Dec 2017 17:09:01 +0000 (09:09 -0800)]
Merge branch 'ew/rebase-mboxrd' into maint
When "git rebase" prepared an mailbox of changes and fed it to "git
am" to replay them, it was confused when a stray "From " happened
to be in the log message of one of the replayed changes. This has
been corrected.
* ew/rebase-mboxrd:
rebase: use mboxrd format to avoid split errors
Junio C Hamano [Wed, 6 Dec 2017 17:09:01 +0000 (09:09 -0800)]
Merge branch 'sd/branch-copy' into maint
Code clean-up.
* sd/branch-copy:
config: avoid "write_in_full(fd, buf, len) != len" pattern