1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-30 16:06:13 +02:00
Commit Graph

53668 Commits

Author SHA1 Message Date
Junio C Hamano 4b3517ee9d Merge branch 'js/rebase-in-c-5.5-work-with-rebase-i-in-c'
"rebase" that has been rewritten learns the new calling convention
used by "rebase -i" that was rewritten in C, tying the loose end
between two GSoC topics that stomped on each other's toes.

* js/rebase-in-c-5.5-work-with-rebase-i-in-c:
  builtin rebase: prepare for builtin rebase -i
2018-11-02 11:04:56 +09:00
Junio C Hamano fd1a9e903f Merge branch 'pk/rebase-in-c-5-test'
Rewrite "git rebase" in C.

* pk/rebase-in-c-5-test:
  builtin rebase: error out on incompatible option/mode combinations
  builtin rebase: use no-op editor when interactive is "implied"
  builtin rebase: show progress when connected to a terminal
  builtin rebase: fast-forward to onto if it is a proper descendant
  builtin rebase: optionally pass custom reflogs to reset_head()
  builtin rebase: optionally auto-detect the upstream
2018-11-02 11:04:55 +09:00
Junio C Hamano 0293121717 Merge branch 'pk/rebase-in-c-4-opts'
Rewrite "git rebase" in C.

* pk/rebase-in-c-4-opts:
  builtin rebase: support --root
  builtin rebase: add support for custom merge strategies
  builtin rebase: support `fork-point` option
  merge-base --fork-point: extract libified function
  builtin rebase: support --rebase-merges[=[no-]rebase-cousins]
  builtin rebase: support `--allow-empty-message` option
  builtin rebase: support `--exec`
  builtin rebase: support `--autostash` option
  builtin rebase: support `-C` and `--whitespace=<type>`
  builtin rebase: support `--gpg-sign` option
  builtin rebase: support `--autosquash`
  builtin rebase: support `keep-empty` option
  builtin rebase: support `ignore-date` option
  builtin rebase: support `ignore-whitespace` option
  builtin rebase: support --committer-date-is-author-date
  builtin rebase: support --rerere-autoupdate
  builtin rebase: support --signoff
  builtin rebase: allow selecting the rebase "backend"
2018-11-02 11:04:55 +09:00
Junio C Hamano 39f7331545 Merge branch 'pk/rebase-in-c-3-acts'
Rewrite "git rebase" in C.

* pk/rebase-in-c-3-acts:
  builtin rebase: stop if `git am` is in progress
  builtin rebase: actions require a rebase in progress
  builtin rebase: support --edit-todo and --show-current-patch
  builtin rebase: support --quit
  builtin rebase: support --abort
  builtin rebase: support --skip
  builtin rebase: support --continue
2018-11-02 11:04:54 +09:00
Junio C Hamano e0720a3867 Merge branch 'pk/rebase-in-c-2-basic'
Rewrite "git rebase" in C.

* pk/rebase-in-c-2-basic:
  builtin rebase: support `git rebase <upstream> <switch-to>`
  builtin rebase: only store fully-qualified refs in `options.head_name`
  builtin rebase: start a new rebase only if none is in progress
  builtin rebase: support --force-rebase
  builtin rebase: try to fast forward when possible
  builtin rebase: require a clean worktree
  builtin rebase: support the `verbose` and `diffstat` options
  builtin rebase: support --quiet
  builtin rebase: handle the pre-rebase hook and --no-verify
  builtin rebase: support `git rebase --onto A...B`
  builtin rebase: support --onto
2018-11-02 11:04:53 +09:00
Junio C Hamano b49ef560ed Merge branch 'ag/rebase-i-in-c'
Rewrite of the remaining "rebase -i" machinery in C.

* ag/rebase-i-in-c:
  rebase -i: move rebase--helper modes to rebase--interactive
  rebase -i: remove git-rebase--interactive.sh
  rebase--interactive2: rewrite the submodes of interactive rebase in C
  rebase -i: implement the main part of interactive rebase as a builtin
  rebase -i: rewrite init_basic_state() in C
  rebase -i: rewrite write_basic_state() in C
  rebase -i: rewrite the rest of init_revisions_and_shortrevisions() in C
  rebase -i: implement the logic to initialize $revisions in C
  rebase -i: remove unused modes and functions
  rebase -i: rewrite complete_action() in C
  t3404: todo list with commented-out commands only aborts
  sequencer: change the way skip_unnecessary_picks() returns its result
  sequencer: refactor append_todo_help() to write its message to a buffer
  rebase -i: rewrite checkout_onto() in C
  rebase -i: rewrite setup_reflog_action() in C
  sequencer: add a new function to silence a command, except if it fails
  rebase -i: rewrite the edit-todo functionality in C
  editor: add a function to launch the sequence editor
  rebase -i: rewrite append_todo_help() in C
  sequencer: make three functions and an enum from sequencer.c public
2018-11-02 11:04:53 +09:00
Junio C Hamano 5ae50845d8 Merge branch 'pk/rebase-in-c'
Rewrite of the "rebase" machinery in C.

* pk/rebase-in-c:
  builtin/rebase: support running "git rebase <upstream>"
  rebase: refactor common shell functions into their own file
  rebase: start implementing it as a builtin
2018-11-02 11:04:52 +09:00
Junio C Hamano 4ede3d42df Seventh batch for 2.20
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-30 15:44:45 +09:00
Junio C Hamano 32d5d732dd Merge branch 'jk/uploadpack-packobjectshook-fix'
Code clean-up that results in a small bugfix.

* jk/uploadpack-packobjectshook-fix:
  upload-pack: fix broken if/else chain in config callback
2018-10-30 15:43:50 +09:00
Junio C Hamano 5d8b3e5d8b Merge branch 'uk/merge-subtree-doc-update'
Belated documentation update to adjust to a new world order that
happened a yew years ago.

* uk/merge-subtree-doc-update:
  howto/using-merge-subtree: mention --allow-unrelated-histories
2018-10-30 15:43:49 +09:00
Junio C Hamano a70d7827ac Merge branch 'cb/compat-mmap-is-private-read-only'
Code tightening.

* cb/compat-mmap-is-private-read-only:
  compat: make sure git_mmap is not expected to write
2018-10-30 15:43:49 +09:00
Junio C Hamano 87c15d1ca9 Merge branch 'dl/mergetool-gui-option'
"git mergetool" learned to take the "--[no-]gui" option, just like
"git difftool" does.

* dl/mergetool-gui-option:
  doc: document diff/merge.guitool config keys
  completion: support `git mergetool --[no-]gui`
  mergetool: accept -g/--[no-]gui as arguments
2018-10-30 15:43:49 +09:00
Junio C Hamano 97ffca6cc7 Merge branch 'js/mingw-load-sys-dll'
The way DLLs are loaded on the Windows port has been improved.

* js/mingw-load-sys-dll:
  mingw: load system libraries the recommended way
2018-10-30 15:43:48 +09:00
Junio C Hamano cc6748720f Merge branch 'js/mingw-getcwd'
The way the Windows port figures out the current directory has been
improved.

* js/mingw-getcwd:
  mingw: fix getcwd when the parent directory cannot be queried
  mingw: ensure `getcwd()` reports the correct case
2018-10-30 15:43:48 +09:00
Junio C Hamano d1622fdbdd Merge branch 'cb/khash-maybe-unused-function'
Build fix.

* cb/khash-maybe-unused-function:
  khash: silence -Wunused-function for delta-islands
  commit-slabs: move MAYBE_UNUSED out
2018-10-30 15:43:48 +09:00
Junio C Hamano da3e0752cd Merge branch 'jc/cocci-preincr'
Code cleanup.

* jc/cocci-preincr:
  fsck: s/++i > 1/i++/
  cocci: simplify "if (++u > 1)" to "if (u++)"
2018-10-30 15:43:48 +09:00
Junio C Hamano 67224b7b5a Merge branch 'ss/rename-tests'
Reorganize some tests and rename them; "ls t/" now gives a better
overview of what is tested for these scripts than before.

* ss/rename-tests:
  t7501: rename commit test to comply with naming convention
  t7500: rename commit tests script to comply with naming convention
  t7502: rename commit test script to comply with naming convention
  t7509: cleanup description and filename
  t2000: rename and combine checkout clash tests
2018-10-30 15:43:48 +09:00
Junio C Hamano 90d228b0d7 Merge branch 'ah/doc-updates'
Doc updates.

* ah/doc-updates:
  doc: fix formatting in git-update-ref
  doc: fix indentation of listing blocks in gitweb.conf.txt
  doc: fix descripion for 'git tag --format'
  doc: fix inappropriate monospace formatting
  doc: fix ASCII art tab spacing
  doc: clarify boundaries of 'git worktree list --porcelain'
2018-10-30 15:43:47 +09:00
Junio C Hamano f2d1c83df0 Merge branch 'ds/reachable'
Trivial bugfix.

* ds/reachable:
  commit-reach: fix cast in compare_commits_by_gen()
2018-10-30 15:43:47 +09:00
Junio C Hamano 4c7f544022 Merge branch 'jc/receive-deny-current-branch-fix'
The receive.denyCurrentBranch=updateInstead codepath kicked in even
when the push should have been rejected due to other reasons, such
as it does not fast-forward or the update-hook rejects it, which
has been corrected.

* jc/receive-deny-current-branch-fix:
  receive: denyCurrentBranch=updateinstead should not blindly update
2018-10-30 15:43:46 +09:00
Junio C Hamano 5742ba504c Merge branch 'ds/ci-commit-graph-and-midx'
One of our CI tests to run with "unusual/experimental/random"
settings now also uses commit-graph and midx.

* ds/ci-commit-graph-and-midx:
  ci: add optional test variables
2018-10-30 15:43:46 +09:00
Junio C Hamano c5cde07a71 Merge branch 'jk/unused-function'
Developer support.

* jk/unused-function:
  config.mak.dev: enable -Wunused-function
2018-10-30 15:43:46 +09:00
Junio C Hamano 48542e3252 Merge branch 'cb/remove-dead-init'
Code clean-up.

* cb/remove-dead-init:
  multi-pack-index: avoid dead store for struct progress
  unpack-trees: avoid dead store for struct progress
2018-10-30 15:43:45 +09:00
Junio C Hamano 99499e222e Merge branch 'js/diff-notice-has-drive-prefix'
Under certain circumstances, "git diff D:/a/b/c D:/a/b/d" on
Windows would strip initial parts from the paths because they
were not recognized as absolute, which has been corrected.

* js/diff-notice-has-drive-prefix:
  diff: don't attempt to strip prefix from absolute Windows paths
2018-10-30 15:43:45 +09:00
Junio C Hamano 9d00100c38 Merge branch 'ot/ref-filter-plug-leaks'
Plugging a handful of memory leaks in the ref-filter codepath.

* ot/ref-filter-plug-leaks:
  ref-filter: free item->value and item->value->s
  ls-remote: release memory instead of UNLEAK
  ref-filter: free memory from used_atom
2018-10-30 15:43:45 +09:00
Junio C Hamano 68fa2ebd65 Merge branch 'ds/reachable-first-parent-fix'
Correct performance regression in commit ancestry computation when
generation numbers are involved.

* ds/reachable-first-parent-fix:
  commit-reach: fix first-parent heuristic
2018-10-30 15:43:44 +09:00
Junio C Hamano 0a1006c571 Merge branch 'rj/header-guards'
Code clean-up.

* rj/header-guards:
  headers: normalize the spelling of some header guards
2018-10-30 15:43:44 +09:00
Junio C Hamano 11914675aa Merge branch 'jk/test-tool-help'
Developer support.

* jk/test-tool-help:
  test-tool: show tool list on error
2018-10-30 15:43:44 +09:00
Junio C Hamano 4b73fdae97 Merge branch 'sg/doc-show-branch-typofix'
Docfix.

* sg/doc-show-branch-typofix:
  doc: fix small typo in git show-branch
2018-10-30 15:43:44 +09:00
Junio C Hamano 7002cb9752 Merge branch 'sb/submodule-helper-remove-cruft'
Code clean-up.

* sb/submodule-helper-remove-cruft:
  builtin/submodule--helper: remove debugging leftover tracing
2018-10-30 15:43:43 +09:00
Junio C Hamano 620b00e167 Merge branch 'js/pack-objects-mutex-init-fix'
A mutex used in "git pack-objects" were not correctly initialized
and this caused "git repack" to dump core on Windows.

* js/pack-objects-mutex-init-fix:
  pack-objects (mingw): initialize `packing_data` mutex in the correct spot
  pack-objects (mingw): demonstrate a segmentation fault with large deltas
  pack-objects: fix typo 'detla' -> 'delta'
2018-10-30 15:43:43 +09:00
Junio C Hamano 6119b8de0e Merge branch 'tq/branch-style-fix'
Code clean-up.

* tq/branch-style-fix:
  branch: trivial style fix
2018-10-30 15:43:43 +09:00
Junio C Hamano d4591b97bd Merge branch 'tq/branch-create-wo-branch-get'
Code clean-up.

* tq/branch-create-wo-branch-get:
  builtin/branch.c: remove useless branch_get
2018-10-30 15:43:42 +09:00
Junio C Hamano d829d491ee Merge branch 'bc/hash-transition-part-15'
More codepaths are moving away from hardcoded hash sizes.

* bc/hash-transition-part-15:
  rerere: convert to use the_hash_algo
  submodule: make zero-oid comparison hash function agnostic
  apply: rename new_sha1_prefix and old_sha1_prefix
  apply: replace hard-coded constants
  tag: express constant in terms of the_hash_algo
  transport: use parse_oid_hex instead of a constant
  upload-pack: express constants in terms of the_hash_algo
  refs/packed-backend: express constants using the_hash_algo
  packfile: express constants in terms of the_hash_algo
  pack-revindex: express constants in terms of the_hash_algo
  builtin/fetch-pack: remove constants with parse_oid_hex
  builtin/mktree: remove hard-coded constant
  builtin/repack: replace hard-coded constants
  pack-bitmap-write: use GIT_MAX_RAWSZ for allocation
  object_id.cocci: match only expressions of type 'struct object_id'
2018-10-30 15:43:42 +09:00
Junio C Hamano 7dc3e5a3be Merge branch 'sb/strbuf-h-update'
Code clean-up to serve as a BCP example.

* sb/strbuf-h-update:
  strbuf.h: format according to coding guidelines
2018-10-30 15:43:42 +09:00
Junio C Hamano 17809a98f9 Merge branch 'jk/run-command-notdot'
The implementation of run_command() API on the UNIX platforms had a
bug that caused a command not on $PATH to be found in the current
directory.

* jk/run-command-notdot:
  run-command: mark path lookup errors with ENOENT
2018-10-30 15:43:41 +09:00
Junio C Hamano 107b9bad95 Merge branch 'tb/filter-alternate-refs'
Test fix.

* tb/filter-alternate-refs:
  t5410: use longer path for sample script
  Documentation/config.txt: fix typo in core.alternateRefsCommand
2018-10-30 15:43:41 +09:00
Junio C Hamano 8a0d060fb1 Merge branch 'rv/send-email-cc-misc-by'
"git send-email" learned to grab address-looking string on any
trailer whose name ends with "-by"; --suppress-cc=misc-by on the
command line, or setting sendemail.suppresscc configuration
variable to "misc-by", can be used to disable this behaviour.

This is a backward-incompatible change that may surprise existing
users.

* rv/send-email-cc-misc-by:
  send-email: also pick up cc addresses from -by trailers
  send-email: only consider lines containing @ or <> for automatic Cc'ing
  Documentation/git-send-email.txt: style fixes
2018-10-30 15:43:40 +09:00
Junio C Hamano d450e56423 Merge branch 'lm/range-diff-submodule-fix'
"git range-diff" did not work well when the compared ranges had
changes in submodules and the "--submodule=log" was used.

* lm/range-diff-submodule-fix:
  range-diff: allow to diff files regardless of submodule config
2018-10-30 15:43:40 +09:00
Junio C Hamano 42a165c90f Merge branch 'ch/subtree-build'
Build update for "git subtree" (in contrib/) documentation pages.

* ch/subtree-build:
  Revert "subtree: make install targets depend on build targets"
  subtree: make install targets depend on build targets
  subtree: add build targets 'man' and 'html'
2018-10-30 15:43:40 +09:00
Junio C Hamano 77d503757d Merge branch 'md/filter-trees'
The "rev-list --filter" feature learned to exclude all trees via
"tree:0" filter.

* md/filter-trees:
  list-objects: support for skipping tree traversal
  filter-trees: code clean-up of tests
  list-objects-filter: implement filter tree:0
  list-objects-filter-options: do not over-strbuf_init
  list-objects-filter: use BUG rather than die
  revision: mark non-user-given objects instead
  rev-list: handle missing tree objects properly
  list-objects: always parse trees gently
  list-objects: refactor to process_tree_contents
  list-objects: store common func args in struct
2018-10-30 15:43:39 +09:00
SZEDER Gábor a5f52c6dab test-lib: introduce the '-V' short option for '--verbose-log'
'--verbose-log' is one of the most useful and thus most frequently
used test options, but due to its length it's a pain to type on the
command line.

Let's introduce the corresponding short option '-V' to save some
keystrokes.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-30 11:06:54 +09:00
Ramsay Jones 1406725b88 commit-reach.h: add missing declarations (hdr-check)
Add the necessary #includes and forward declarations to allow the header
file to pass the 'hdr-check' target.

Note that, since this header includes the commit-slab implementation
header file (indirectly via commit-slab.h), some of the commit-slab
inline functions (e.g contains_cache_at_peek()) will not compile without
the complete type of 'struct commit'. Hence, we replace the forward
declaration of 'struct commit' with the an #include of the 'commit.h'
header file.

It is possible, using the 'commit-slab-{decl,impl}.h' files, to avoid
this inclusion of the 'commit.h' header. Commit a9f1f1f9f8 ("commit-slab.h:
code split", 2018-05-19) separated the commit-slab interface from its
implementation, to allow for the definition of a public commit-slab data
structure. This enabled us to avoid including the commit-slab implementation
in a header file, which could result in the replication of the commit-slab
functions in each compilation unit in which it was included.

Indeed, if you compile with optimizations disabled, then run this script:

  $ cat -n dup-static.sh
       1 #!/bin/sh
       2
       3 nm $1 | grep ' t ' | cut -d' ' -f3 | sort | uniq -c |
       4 	sort -rn | grep -v '      1'
  $

  $ ./dup-static.sh git | grep contains
       24 init_contains_cache_with_stride
       24 init_contains_cache
       24 contains_cache_peek
       24 contains_cache_at_peek
       24 contains_cache_at
       24 clear_contains_cache
  $

you will find 24 copies of the commit-slab routines for the contains_cache.
Of course, when you enable optimizations again, these duplicate static
functions (mostly) disappear. Compiling with gcc at -O2, leaves two static
functions, thus:

  $ nm commit-reach.o | grep contains_cache
  0000000000000870 t contains_cache_at_peek.isra.1.constprop.6
  $ nm ref-filter.o | grep contains_cache
  00000000000002b0 t clear_contains_cache.isra.14
  $

However, using a shared 'contains_cache' would result in all six of the
above functions as external public functions in the git binary. At present,
only three of these functions are actually called, so the trade-off
seems to favour letting the compiler inline the commit-slab functions.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-29 10:14:21 +09:00
Ramsay Jones 3a457a08f2 ewok_rlw.h: add missing 'inline' to function definition
The 'ewok_rlw.h' header file contains the rlw_get_run_bit() function
definition, which is marked as 'static' but not 'inline'. At least when
compiled by gcc, with the default -O2 optimization level, the function
is actually inlined and leaves no static version in the ewah_bitmap.o
and ewah_rlw.o object files. Despite this, add the missing 'inline'
keyword to better describe the intended behaviour.

Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-29 10:14:19 +09:00
Ramsay Jones 813fc4410c fetch-object.h: add missing declaration (hdr-check)
Signed-off-by: Ramsay Jones <ramsay@ramsayjones.plus.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-29 10:14:17 +09:00
Johannes Sixt 8c64bc9420 t3404-rebase-interactive: test abbreviated commands
Make sure that each short command is tested at least once. To
not exacerbate the runtime of the test script, do not add new
tests, but modify existing ones according to these criteria:

- The test does not have a prerequisite.
- The 'git rebase' command is not guarded by test_must_fail.

The pick commands are optional in the FAKE_LINES variable, but
when used, they do end up in the insn sheet. Test them, too.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-29 09:50:20 +09:00
Carlo Marcelo Arenas Belón 4af5174168 sequencer: cleanup for gcc warning in non developer mode
as shown by:

  sequencer.c: In function ‘write_basic_state’:
  sequencer.c:2392:37: warning: zero-length gnu_printf format string [-Wformat-zero-length]
     write_file(rebase_path_verbose(), "");

where write_file will create an empty file if told to write an empty string
as can be inferred by the previous call

the somehow more convoluted syntax works around the issue by providing a non
empty format string and is already being used for the abort safety file since
1e41229d96 ("sequencer: make sequencer abort safer", 2016-12-07)

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-27 15:00:31 +09:00
Junio C Hamano c670b1f876 Sixth batch for 2.20
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-10-26 14:53:16 +09:00
Junio C Hamano 16ce0b92bd Merge branch 'js/mingw-default-ident'
The logic to select the default user name and e-mail on Windows has
been improved.

* js/mingw-default-ident:
  mingw: use domain information for default email
  getpwuid(mingw): provide a better default for the user name
  getpwuid(mingw): initialize the structure only once
2018-10-26 14:22:15 +09:00
Junio C Hamano 1e5d454856 Merge branch 'ld/p4-unshelve'
"git p4 unshelve" improvements.

* ld/p4-unshelve:
  git-p4: fully support unshelving changelists
  git-p4: unshelve into refs/remotes/p4-unshelved, not refs/remotes/p4/unshelved
  git-p4: do not fail in verbose mode for missing 'fileSize' key
2018-10-26 14:22:15 +09:00