Commit graph

49739 commits

Author SHA1 Message Date
Junio C Hamano f7bbca1cae Merge branch 'db/doc-workflows-neuter-the-maintainer'
Docfix.

* db/doc-workflows-neuter-the-maintainer:
  doc: reword gitworkflows.txt for neutrality
2017-12-27 11:16:25 -08:00
Junio C Hamano 0faff988ee 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
2017-12-27 11:16:25 -08:00
Junio C Hamano a13e45f1e7 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()
2017-12-27 11:16:24 -08:00
Junio C Hamano 1f9ce78df0 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()
2017-12-27 11:16:23 -08:00
Junio C Hamano 5c14bd6175 Merge branch 'rs/am-builtin-leakfix'
Leakfix.

* rs/am-builtin-leakfix:
  am: release strbuf after use in split_mail_mbox()
2017-12-27 11:16:23 -08:00
Junio C Hamano e87f9fc9d4 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)
2017-12-27 11:16:21 -08:00
Junio C Hamano 0da2ba4880 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
2017-12-27 11:16:21 -08:00
Junio C Hamano 720b1764de 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
2017-12-27 11:16:21 -08:00
Junio C Hamano 61061abba7 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
2017-12-27 11:16:21 -08:00
Junio C Hamano ee5462d6e7 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>
2017-12-27 11:12:45 -08:00
Junio C Hamano 936d1b9894 RelNotes: the tenth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-12-19 11:34:35 -08:00
Junio C Hamano 0c69a132cb 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
2017-12-19 11:33:59 -08:00
Junio C Hamano bdae4af870 Merge branch 'sg/setup-doc-update'
Comment update.

* sg/setup-doc-update:
  setup.c: fix comment about order of .git directory discovery
2017-12-19 11:33:58 -08:00
Junio C Hamano 8d7fefaac4 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").
2017-12-19 11:33:58 -08:00
Junio C Hamano 66d3f19324 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
2017-12-19 11:33:57 -08:00
Junio C Hamano 1974f4791a 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
2017-12-19 11:33:57 -08:00
Junio C Hamano 6f3a0b6da5 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
2017-12-19 11:33:57 -08:00
Junio C Hamano a328b2cb63 Merge branch 'sb/clone-recursive-submodule-doc'
Doc update.

* sb/clone-recursive-submodule-doc:
  Documentation/git-clone: improve description for submodule recursing
2017-12-19 11:33:56 -08:00
Junio C Hamano e7d1b526d1 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
2017-12-19 11:33:56 -08:00
Junio C Hamano f4f233e13d 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
2017-12-19 11:33:56 -08:00
Junio C Hamano d7c6c2369a 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)
2017-12-19 11:33:56 -08:00
Junio C Hamano 6d2c4619a5 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
2017-12-19 11:33:55 -08:00
Junio C Hamano 646685460c 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
2017-12-19 11:33:55 -08:00
Todd Zullinger 52015aaf9d RelNotes: minor typo fixes in 2.16.0 draft
Signed-off-by: Todd Zullinger <tmz@pobox.com>
2017-12-14 10:46:09 -08:00
Junio C Hamano d9a3764af7 RelNotes: the ninth batch
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-12-13 13:32:34 -08:00
Junio C Hamano d9195982d8 Merge branch 'js/hashmap-update-sample'
Code comment update.

* js/hashmap-update-sample:
  hashmap: adjust documentation to reflect reality
2017-12-13 13:28:58 -08:00
Junio C Hamano 37cba00448 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
2017-12-13 13:28:58 -08:00
Junio C Hamano e6bf6afe27 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
2017-12-13 13:28:58 -08:00
Junio C Hamano 97e1f857fc 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()
2017-12-13 13:28:57 -08:00
Junio C Hamano 36ddee941e 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%
2017-12-13 13:28:57 -08:00
Junio C Hamano 706566524e 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
2017-12-13 13:28:57 -08:00
Junio C Hamano 577051bca4 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
2017-12-13 13:28:56 -08:00
Junio C Hamano d22512e019 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
2017-12-13 13:28:56 -08:00
Junio C Hamano 41a05ee3a6 Merge branch 'pc/submodule-helper'
A message fix.

* pc/submodule-helper:
  submodule--helper.c: i18n: add a missing space in message
2017-12-13 13:28:56 -08:00
Junio C Hamano e49ac11089 Merge branch 'jc/receive-pack-hook-doc'
Doc update.

* jc/receive-pack-hook-doc:
  hooks doc: clarify when receive-pack invokes its hooks
2017-12-13 13:28:55 -08:00
Junio C Hamano b3f04e5b4c 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
2017-12-13 13:28:54 -08:00
Junio C Hamano 6c3daa2346 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
2017-12-13 13:28:54 -08:00
Junio C Hamano 721cc4314c 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
2017-12-13 13:28:54 -08:00
Torsten Bögershausen 649f1f0948 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>
2017-12-08 10:16:57 -08:00
Daniel Bensoussan 6b0eb884f9 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>
2017-12-08 09:22:23 -08:00
Kaartic Sivaraam 255073ca59 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>
2017-12-07 15:06:46 -08:00
Kaartic Sivaraam a48ebe9724 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>
2017-12-07 15:06:43 -08:00
Kaartic Sivaraam e2bbd0cc4c 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>
2017-12-07 15:06:42 -08:00
Kaartic Sivaraam f6cea74de6 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>
2017-12-07 15:06:38 -08:00
Eric Sunshine ade546be47 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>
2017-12-07 14:02:28 -08:00
René Scharfe c3ff8f6c14 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>
2017-12-07 13:19:23 -08:00
René Scharfe addcf6cfde 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>
2017-12-07 12:34:35 -08:00
René Scharfe 1b09073514 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>
2017-12-07 12:30:04 -08:00
Lars Schneider abfb04d0c7 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>
2017-12-07 10:10:19 -08:00
SZEDER Gábor 176b2d328c 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>
2017-12-07 08:09:06 -08:00