1
0
mirror of https://github.com/git/git.git synced 2024-10-21 12:48:32 +02:00
Commit Graph

45815 Commits

Author SHA1 Message Date
Phillip Wood
4ab867b8fc rebase -i: fix reflog message
When rebase -i was converted to C a bug was introduced into the code
that creates the reflog message. Instead of saying
rebase -i (finish): <head-name> onto <onto>
it says
rebase -i (finish): <head-name> onto <orig-head><onto>
as the strbuf is not reset between reading the value of <orig-head>
and <onto>.

Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
Acked-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-05-20 18:24:25 +09:00
Brandon Williams
a42e1b4194 sequencer: fix missing newline
When using rebase --interactive where one of the lines is marked as
'edit' this is the resulting output:

    Stopped at ec3b9c4...  stuffYou can amend the commit now, with

      git commit --amend

    Once you are satisfied with your changes, run

      git rebase --continue

A newline character is missing at the end of the "Stopped at ..." line and
before the "You can amend ..." line.  This patch fixes the malformed output by
adding the missing newline character to the end of the "Stopped at ..." line.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-23 11:19:23 -07:00
Jeff King
9942921301 sequencer: drop "warning:" when stopping for edit
Since the conversion from shell to C in 56dc3ab04 (sequencer
(rebase -i): implement the 'edit' command, 2017-01-02),
stopping at an "edit" instruction went from:

  $ git rebase -i
  Stopped at 6ce6b914a... odb_pack_keep(): stop generating keepfile name
  You can amend the commit now, with
    [...more instructions...]

to:

  $ git rebase -i
  warning: stopped at 6ce6b914a... odb_pack_keep(): stop generating keepfile name
  You can amend the commit now, with
    [...more instructions...]

The "warning" implies that it's something unexpected, but
it's not. Let's switch back to the original message.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-03-17 10:31:48 -07:00
Johannes Schindelin
18633e1a22 rebase -i: use the rebase--helper builtin
Now that the sequencer learned to process a "normal" interactive rebase,
we use it. The original shell script is still used for "non-normal"
interactive rebases, i.e. when --root or --preserve-merges was passed.

Please note that the --root option (via the $squash_onto variable) needs
special handling only for the very first command, hence it is still okay
to use the helper upon continue/skip.

Also please note that the --no-ff setting is volatile, i.e. when the
interactive rebase is interrupted at any stage, there is no record of
it. Therefore, we have to pass it from the shell script to the
rebase--helper.

Note: the test t3404 had to be adjusted because the the error messages
produced by the sequencer comply with our current convention to start with
a lower-case letter.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-09 14:55:40 -08:00
Johannes Schindelin
4557f1add2 rebase--helper: add a builtin helper for interactive rebases
Git's interactive rebase is still implemented as a shell script, despite
its complexity. This implies that it suffers from the portability point
of view, from lack of expressibility, and of course also from
performance. The latter issue is particularly serious on Windows, where
we pay a hefty price for relying so much on POSIX.

Unfortunately, being such a huge shell script also means that we missed
the train when it would have been relatively easy to port it to C, and
instead piled feature upon feature onto that poor script that originally
never intended to be more than a slightly pimped cherry-pick in a loop.

To open the road toward better performance (in addition to all the other
benefits of C over shell scripts), let's just start *somewhere*.

The approach taken here is to add a builtin helper that at first intends
to take care of the parts of the interactive rebase that are most
affected by the performance penalties mentioned above.

In particular, after we spent all those efforts on preparing the sequencer
to process rebase -i's git-rebase-todo scripts, we implement the `git
rebase -i --continue` functionality as a new builtin, git-rebase--helper.

Once that is in place, we can work gradually on tackling the rest of the
technical debt.

Note that the rebase--helper needs to learn about the transient
--ff/--no-ff options of git-rebase, as the corresponding flag is not
persisted to, and re-read from, the state directory.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-09 14:55:26 -08:00
Junio C Hamano
6e3a7b3398 Git 2.12-rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.12.0-rc0
2017-02-03 11:29:52 -08:00
Junio C Hamano
fafca0f72a Merge branch 'cw/log-updates-for-all-refs-really'
The "core.logAllRefUpdates" that used to be boolean has been
enhanced to take 'always' as well, to record ref updates to refs
other than the ones that are expected to be updated (i.e. branches,
remote-tracking branches and notes).

* cw/log-updates-for-all-refs-really:
  doc: add note about ignoring '--no-create-reflog'
  update-ref: add test cases for bare repository
  refs: add option core.logAllRefUpdates = always
  config: add markup to core.logAllRefUpdates doc
2017-02-03 11:25:19 -08:00
Junio C Hamano
74dee5cfae Merge branch 'pl/complete-diff-submodule-diff'
The command line completion (in contrib/) learned that
"git diff --submodule=" can take "diff" as a recently added option.

* pl/complete-diff-submodule-diff:
  Completion: Add support for --submodule=diff
2017-02-03 11:25:19 -08:00
Junio C Hamano
36acf41239 Merge branch 'rs/object-id'
"uchar [40]" to "struct object_id" conversion continues.

* rs/object-id:
  checkout: convert post_checkout_hook() to struct object_id
  use oidcpy() for copying hashes between instances of struct object_id
  use oid_to_hex_r() for converting struct object_id hashes to hex strings
2017-02-03 11:25:19 -08:00
Junio C Hamano
ecc486b1f8 Merge branch 'js/re-running-failed-tests'
"make -C t failed" will now run only the tests that failed in the
previous run.  This is usable only when prove is not use, and gives
a useless error message when run after "make clean", but otherwise
is serviceable.

* js/re-running-failed-tests:
  t/Makefile: add a rule to re-run previously-failed tests
2017-02-03 11:25:19 -08:00
Junio C Hamano
4ba6bb2d17 Merge branch 'sb/submodule-update-initial-runs-custom-script'
The user can specify a custom update method that is run when
"submodule update" updates an already checked out submodule.  This
was ignored when checking the submodule out for the first time and
we instead always just checked out the commit that is bound to the
path in the superproject's index.

* sb/submodule-update-initial-runs-custom-script:
  submodule update: run custom update script for initial populating as well
2017-02-03 11:25:19 -08:00
Junio C Hamano
5348021c67 Merge branch 'sb/submodule-recursive-absorb'
When a submodule "A", which has another submodule "B" nested within
it, is "absorbed" into the top-level superproject, the inner
submodule "B" used to be left in a strange state.  The logic to
adjust the .git pointers in these submodules has been corrected.

* sb/submodule-recursive-absorb:
  submodule absorbing: fix worktree/gitdir pointers recursively for non-moves
  cache.h: expose the dying procedure for reading gitlinks
  setup: add gentle version of resolve_git_dir
2017-02-03 11:25:18 -08:00
Junio C Hamano
2243d229f7 Merge branch 'sb/unpack-trees-super-prefix'
"git read-tree" and its underlying unpack_trees() machinery learned
to report problematic paths prefixed with the --super-prefix option.

* sb/unpack-trees-super-prefix:
  unpack-trees: support super-prefix option
  t1001: modernize style
  t1000: modernize style
  read-tree: use OPT_BOOL instead of OPT_SET_INT
2017-02-03 11:25:18 -08:00
Junio C Hamano
8a8f121049 Sync with v2.11.1
* maint:
  Git 2.11.1
2017-02-02 13:43:19 -08:00
Junio C Hamano
289ec4d9ba Ninth batch for 2.12; almost ready for -rc0
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-02 13:43:10 -08:00
Junio C Hamano
85279e8649 Merge branch 'nd/log-graph-configurable-colors'
Some people feel the default set of colors used by "git log --graph"
rather limiting.  A mechanism to customize the set of colors has
been introduced.

* nd/log-graph-configurable-colors:
  document behavior of empty color name
  color_parse_mem: allow empty color spec
  log --graph: customize the graph lines with config log.graphColors
  color.c: trim leading spaces in color_parse_mem()
  color.c: fix color_parse_mem() with value_len == 0
2017-02-02 13:36:58 -08:00
Junio C Hamano
cc8364c28b Merge branch 'ep/commit-static-buf-cleanup'
Code clean-up.

* ep/commit-static-buf-cleanup:
  builtin/commit.c: switch to strbuf, instead of snprintf()
  builtin/commit.c: remove the PATH_MAX limitation via dynamic allocation
2017-02-02 13:36:57 -08:00
Junio C Hamano
a77fe4a976 Merge branch 'bc/use-asciidoctor-opt'
Asciidoctor, an alternative reimplementation of AsciiDoc, still
needs some changes to work with documents meant to be formatted
with AsciiDoc.  "make USE_ASCIIDOCTOR=YesPlease" to use it out of
the box to document our pages is getting closer to reality.

* bc/use-asciidoctor-opt:
  Documentation: implement linkgit macro for Asciidoctor
  Makefile: add a knob to enable the use of Asciidoctor
  Documentation: move dblatex arguments into variable
  Documentation: add XSLT to fix DocBook for Texinfo
  Documentation: sort sources for gitman.texi
  Documentation: remove unneeded argument in cat-texi.perl
  Documentation: modernize cat-texi.perl
  Documentation: fix warning in cat-texi.perl
2017-02-02 13:36:57 -08:00
Junio C Hamano
be6de6ecf9 Merge branch 'sg/mailmap-self'
* sg/mailmap-self:
  .mailmap: update Gábor Szeder's email address
2017-02-02 13:36:57 -08:00
Junio C Hamano
cddbda4bc8 Merge branch 'js/mingw-hooks-with-exe-suffix'
Names of the various hook scripts must be spelled exactly, but on
Windows, an .exe binary must be named with .exe suffix; notice
$GIT_DIR/hooks/<hookname>.exe as a valid <hookname> hook.

* js/mingw-hooks-with-exe-suffix:
  mingw: allow hooks to be .exe files
2017-02-02 13:36:57 -08:00
Junio C Hamano
140d41ae87 Merge branch 'rs/receive-pack-cleanup'
Code clean-up.

* rs/receive-pack-cleanup:
  receive-pack: call string_list_clear() unconditionally
2017-02-02 13:36:57 -08:00
Junio C Hamano
f1fac407f5 Merge branch 'mm/reset-facl-before-umask-test'
Test tweaks for those who have default ACL in their git source tree
that interfere with the umask test.

* mm/reset-facl-before-umask-test:
  t0001: don't let a default ACL interfere with the umask test
2017-02-02 13:36:56 -08:00
Junio C Hamano
ce050477fb Merge branch 'hv/mingw-help-is-executable'
"git help" enumerates executable files in $PATH; the implementation
of "is this file executable?" on Windows has been optimized.

* hv/mingw-help-is-executable:
  help: improve is_executable() on Windows
2017-02-02 13:36:56 -08:00
Junio C Hamano
a482cf446f Merge branch 'gv/mingw-p4-mapuser'
"git p4" did not work well with multiple git-p4.mapUser entries on
Windows.

* gv/mingw-p4-mapuser:
  git-p4: fix git-p4.mapUser on Windows
2017-02-02 13:36:55 -08:00
Junio C Hamano
6f1c08bdb7 Merge branch 'rs/absolute-pathdup'
Code cleanup.

* rs/absolute-pathdup:
  use absolute_pathdup()
  abspath: add absolute_pathdup()
2017-02-02 13:36:55 -08:00
Junio C Hamano
d008809bb5 Merge branch 'js/unzip-in-usr-bin-workaround'
Test tweak for FreeBSD where /usr/bin/unzip is unsuitable to run
our tests but /usr/local/bin/unzip is usable.

* js/unzip-in-usr-bin-workaround:
  test-lib: on FreeBSD, look for unzip(1) in /usr/local/bin/
2017-02-02 13:36:55 -08:00
Junio C Hamano
d3a0172a82 Merge branch 'cw/doc-sign-off'
Doc update.

* cw/doc-sign-off:
  doc: clarify distinction between sign-off and pgp-signing
2017-02-02 13:36:55 -08:00
Junio C Hamano
93d2387718 Merge branch 'js/status-pre-rebase-i'
After starting "git rebase -i", which first opens the user's editor
to edit the series of patches to apply, but before saving the
contents of that file, "git status" failed to show the current
state (i.e. you are in an interactive rebase session, but you have
applied no steps yet) correctly.

* js/status-pre-rebase-i:
  status: be prepared for not-yet-started interactive rebase
2017-02-02 13:36:54 -08:00
Junio C Hamano
9dec2c652f Merge branch 'js/retire-relink'
Cruft removal.

* js/retire-relink:
  relink: really remove the command
  relink: retire the command
2017-02-02 13:36:54 -08:00
Junio C Hamano
1e6a89323b Merge branch 'sb/submodule-add-force'
"git submodule add" used to be confused and refused to add a
locally created repository; users can now use "--force" option
to add them.

* sb/submodule-add-force:
  submodule add: extend force flag to add existing repos
2017-02-02 13:36:54 -08:00
Junio C Hamano
3b9e3c2ced Git 2.11.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
v2.11.1
2017-02-02 13:21:27 -08:00
Junio C Hamano
45f28edbe9 Merge branch 'ws/request-pull-code-cleanup' into maint
Code clean-up.

* ws/request-pull-code-cleanup:
  request-pull: drop old USAGE stuff
2017-02-02 13:20:30 -08:00
Junio C Hamano
5816d3cdfb Merge branch 'jk/execv-dashed-external' into maint
Typing ^C to pager, which usually does not kill it, killed Git and
took the pager down as a collateral damage in certain process-tree
structure.  This has been fixed.

* jk/execv-dashed-external:
  execv_dashed_external: wait for child on signal death
  execv_dashed_external: stop exiting with negative code
  execv_dashed_external: use child_process struct
2017-02-02 13:20:29 -08:00
Jeff King
512aba261a document behavior of empty color name
Commit 55cccf4bb (color_parse_mem: allow empty color spec,
2017-02-01) clearly defined the behavior of an empty color
config variable. Let's document that, and give a hint about
why it might be useful.

It's important not to say that it makes the item uncolored,
because it doesn't. It just sets no attributes, which means
that any previous attributes continue to take effect.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-02 12:23:16 -08:00
Cornelius Weig
67c70bd930 doc: add note about ignoring '--no-create-reflog'
The commands git-branch and git-tag accept the '--create-reflog'
option, and create reflog even when core.logallrefupdates
configuration is explicitly set not to.

On the other hand, the negated form '--no-create-reflog' is accepted
as a valid option but has no effect (other than overriding an
earlier '--create-reflog' on the command line). This silent noop may
puzzle users.  To communicate that this is a known limitation, add a
short note in the manuals for git-branch and git-tag.

Signed-off-by: Cornelius Weig <cornelius.weig@tngtech.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-02-01 15:53:40 -08:00
Jeff King
55cccf4bb3 color_parse_mem: allow empty color spec
Prior to c2f41bf52 (color.c: fix color_parse_mem() with
value_len == 0, 2017-01-19), the empty string was
interpreted as a color "reset". This was an accidental
outcome, and that commit turned it into an error.

However, scripts may pass the empty string as a default
value to "git config --get-color" to disable color when the
value is not defined. The git-add--interactive script does
this. As a result, the script is unusable since c2f41bf52
unless you have color.diff.plain defined (if it is defined,
then we don't parse the empty default at all).

Our test scripts didn't notice the recent breakage because
they run without a terminal, and thus without color. They
never hit this code path at all. And nobody noticed the
original buggy "reset" behavior, because it was effectively
a noop.

Let's fix the code to have an empty color name produce an
empty sequence of color codes. The tests need a few fixups:

  - we'll add a new test in t4026 to cover this case. But
    note that we need to tweak the color() helper. While
    we're there, let's factor out the literal ANSI ESC
    character. Otherwise it makes the diff quite hard to
    read.

  - we'll add a basic sanity-check in t4026 that "git add
    -p" works at all when color is enabled. That would have
    caught this bug, as well as any others that are specific
    to the color code paths.

  - 73c727d69 (log --graph: customize the graph lines with
    config log.graphColors, 2017-01-19) added a test to
    t4202 that checks some "invalid" graph color config.
    Since ",, blue" before yielded only "blue" as valid, and
    now yields "empty, empty, blue", we don't match the
    expected output.

    One way to fix this would be to change the expectation
    to the empty color strings. But that makes the test much
    less interesting, since we show only two graph lines,
    both of which would be colorless.

    Since the empty-string case is now covered by t4026,
    let's remove them entirely here. They're just in the way
    of the primary thing the test is supposed to be
    checking.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-01-31 21:02:04 -08:00
SZEDER Gábor
540a398e9c .mailmap: update Gábor Szeder's email address
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-01-31 15:18:20 -08:00
Junio C Hamano
8f60064c1f Sync with maint
* maint:
  Ready for 2.11.1
2017-01-31 13:34:59 -08:00
Junio C Hamano
b32fe956d0 Ready for 2.11.1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2017-01-31 13:34:48 -08:00
Junio C Hamano
1ac2ec6dd8 Merge branch 'sb/in-core-index-doc' into maint
Documentation and in-code comments updates.

* sb/in-core-index-doc:
  documentation: retire unfinished documentation
  cache.h: document add_[file_]to_index
  cache.h: document remove_index_entry_at
  cache.h: document index_name_pos
2017-01-31 13:32:11 -08:00
Junio C Hamano
6a7e25d155 Merge branch 'js/mingw-isatty' into maint
An update to a topic that is already in 'master'.

* js/mingw-isatty:
  mingw: follow-up to "replace isatty() hack"
2017-01-31 13:32:11 -08:00
Junio C Hamano
63f1bb8109 Merge branch 'jk/coding-guidelines-update' into maint
Developer doc update.

* jk/coding-guidelines-update:
  CodingGuidelines: clarify multi-line brace style
2017-01-31 13:32:11 -08:00
Junio C Hamano
21a9002fd1 Merge branch 'js/exec-path-coverity-workaround' into maint
Code cleanup.

* js/exec-path-coverity-workaround:
  git_exec_path: do not return the result of getenv()
  git_exec_path: avoid Coverity warning about unfree()d result
2017-01-31 13:32:10 -08:00
Junio C Hamano
2ae2362473 Merge branch 'ad/bisect-terms' into maint
Documentation fix.

* ad/bisect-terms:
  Documentation/bisect: improve on (bad|new) and (good|bad)
2017-01-31 13:32:10 -08:00
Junio C Hamano
14beee0d0d Merge branch 'jk/grep-e-could-be-extended-beyond-posix' into maint
Tighten a test to avoid mistaking an extended ERE regexp engine as
a PRE regexp engine.

* jk/grep-e-could-be-extended-beyond-posix:
  t7810: avoid assumption about invalid regex syntax
2017-01-31 13:32:09 -08:00
Junio C Hamano
f5f55a1046 Merge branch 'km/branch-get-push-while-detached' into maint
"git <cmd> @{push}" on a detached HEAD used to segfault; it has
been corrected to error out with a message.

* km/branch-get-push-while-detached:
  branch_get_push: do not segfault when HEAD is detached
2017-01-31 13:32:08 -08:00
Junio C Hamano
2b3f61dc8b Merge branch 'jk/rebase-i-squash-count-fix' into maint
"git rebase -i" with a recent update started showing an incorrect
count when squashing more than 10 commits.

* jk/rebase-i-squash-count-fix:
  rebase--interactive: count squash commits above 10 correctly
2017-01-31 13:32:07 -08:00
Junio C Hamano
5fbb42a21e Merge branch 'jk/blame-fixes' into maint
"git blame --porcelain" misidentified the "previous" <commit, path>
pair (aka "source") when contents came from two or more files.

* jk/blame-fixes:
  blame: output porcelain "previous" header for each file
  blame: handle --no-abbrev
  blame: fix alignment with --abbrev=40
2017-01-31 13:32:07 -08:00
Junio C Hamano
b1e4e1782f Merge branch 'jk/archive-zip-userdiff-config' into maint
"git archive" did not read the standard configuration files, and
failed to notice a file that is marked as binary via the userdiff
driver configuration.

* jk/archive-zip-userdiff-config:
  archive-zip: load userdiff config
2017-01-31 13:32:07 -08:00
Junio C Hamano
81037171a5 Merge branch 'dt/disable-bitmap-in-auto-gc' into maint
It is natural that "git gc --auto" may not attempt to pack
everything into a single pack, and there is no point in warning
when the user has configured the system to use the pack bitmap,
leading to disabling further "gc".

* dt/disable-bitmap-in-auto-gc:
  repack: die on incremental + write-bitmap-index
  auto gc: don't write bitmaps for incremental repacks
2017-01-31 13:32:06 -08:00