summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-08-10sequencer: change the way skip_unnecessary_picks() returns its resultLibravatar Alban Gruin3-10/+15
Instead of skip_unnecessary_picks() printing its result to stdout, it returns it into a struct object_id, as the rewrite of complete_action() (to come in the next commit) will need it. rebase--helper then is modified to fit this change. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-10sequencer: refactor append_todo_help() to write its message to a bufferLibravatar Alban Gruin3-15/+34
This refactors append_todo_help() to write its message to a buffer instead of the todo-list. This is needed for the rewrite of complete_action(), which will come after the next commit. As rebase--helper still needs the file manipulation part of append_todo_help(), it is extracted to a temporary function, append_todo_help_to_file(). This function will go away after the rewrite of complete_action(). Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-10rebase -i: rewrite checkout_onto() in CLibravatar Alban Gruin4-22/+32
This rewrites checkout_onto() from shell to C. A new command (“checkout-onto”) is added to rebase--helper.c. The shell version is then stripped. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-10rebase -i: rewrite setup_reflog_action() in CLibravatar Alban Gruin4-15/+40
This rewrites (the misnamed) setup_reflog_action() from shell to C. The new version is called prepare_branch_to_be_rebased(). A new command is added to rebase--helper.c, “checkout-base”, as well as a new flag, “verbose”, to avoid silencing the output of the checkout operation called by checkout_base_commit(). The function `run_git_checkout()` will also be used in the next commit, therefore its code is not part of `checkout_base_commit()`. The shell version is then stripped in favour of a call to the helper. As $GIT_REFLOG_ACTION is no longer set at the first call of checkout_onto(), a call to comment_for_reflog() is added at the beginning of this function. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-10sequencer: add a new function to silence a command, except if it failsLibravatar Alban Gruin1-26/+25
This adds a new function, run_command_silent_on_success(), to redirect the stdout and stderr of a command to a strbuf, and then to run that command. This strbuf is printed only if the command fails. It is functionnaly similar to output() from git-rebase.sh. run_git_commit() is then refactored to use of run_command_silent_on_success(). Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-10rebase -i: rewrite the edit-todo functionality in CLibravatar Alban Gruin4-15/+37
This rewrites the edit-todo functionality from shell to C. To achieve that, a new command mode, `edit-todo`, is added, and the `write-edit-todo` flag is removed, as the shell script does not need to write the edit todo help message to the todo list anymore. The shell version is then stripped in favour of a call to the helper. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-10editor: add a function to launch the sequence editorLibravatar Alban Gruin3-2/+28
As part of the rewrite of interactive rebase, the sequencer will need to open the sequence editor to allow the user to edit the todo list. Instead of duplicating the existing launch_editor() function, this refactors it to a new function, launch_specified_editor(), which takes the editor as a parameter, in addition to the path, the buffer and the environment variables. launch_sequence_editor() is then added to launch the sequence editor. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-10rebase -i: rewrite append_todo_help() in CLibravatar Alban Gruin5-52/+86
This rewrites append_todo_help() from shell to C. It also incorporates some parts of initiate_action() and complete_action() that also write help texts to the todo file. This also introduces the source file rebase-interactive.c. This file will contain functions necessary for interactive rebase that are too specific for the sequencer, and is part of libgit.a. Two flags are added to rebase--helper.c: one to call append_todo_help() (`--append-todo-help`), and another one to tell append_todo_help() to write the help text suited for the edit-todo mode (`--write-edit-todo`). Finally, append_todo_help() is removed from git-rebase--interactive.sh to use `rebase--helper --append-todo-help` instead. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-10sequencer: make three functions and an enum from sequencer.c publicLibravatar Alban Gruin2-15/+22
This makes rebase_path_todo(), get_missing_commit_check_level(), write_message() and the enum check_level accessible outside sequencer.c, renames check_level to missing_commit_check_level, and prefixes its value names by MISSING_COMMIT_ to avoid namespace pollution. This function and this enum will eventually be moved to rebase-interactive.c and become static again, so no special attention was given to the naming. This will be needed for the rewrite of append_todo_help() from shell to C, as it will be in a new library source file, rebase-interactive.c. Signed-off-by: Alban Gruin <alban.gruin@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-18Third batch for 2.19 cycleLibravatar Junio C Hamano1-1/+59
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-07-18Merge branch 'js/enhanced-version-info'Libravatar Junio C Hamano1-2/+3
Build fix. * js/enhanced-version-info: Makefile: fix the "built from commit" code
2018-07-18Merge branch 'sb/mailmap'Libravatar Junio C Hamano1-1/+10
* sb/mailmap: .mailmap: merge different spellings of names
2018-07-18Merge branch 'ms/core-icase-doc'Libravatar Junio C Hamano1-3/+6
Clarify that setting core.ignoreCase to deviate from reality would not turn a case-incapable filesystem into a case-capable one. * ms/core-icase-doc: Documentation: declare "core.ignoreCase" as internal variable
2018-07-18Merge branch 'ds/commit-graph'Libravatar Junio C Hamano1-5/+5
Docfix. * ds/commit-graph: commit-graph: fix documentation inconsistencies
2018-07-18Merge branch 'tz/exclude-doc-smallfixes'Libravatar Junio C Hamano2-2/+2
Doc updates. * tz/exclude-doc-smallfixes: dir.c: fix typos in core.excludesfile comment gitignore.txt: clarify default core.excludesfile path
2018-07-18Merge branch 'js/rebase-recreate-merge'Libravatar Junio C Hamano1-1/+1
Docfix. * js/rebase-recreate-merge: rebase: fix documentation formatting
2018-07-18Merge branch 'en/rebase-i-microfixes'Libravatar Junio C Hamano4-4/+41
* en/rebase-i-microfixes: git-rebase--merge: modernize "git-$cmd" to "git $cmd" Fix use of strategy options with interactive rebases t3418: add testcase showing problems with rebase -i and strategy options
2018-07-18Merge branch 'mb/filter-branch-optim'Libravatar Junio C Hamano2-0/+16
"git filter-branch" when used with the "--state-branch" option still attempted to rewrite the commits whose filtered result is known from the previous attempt (which is recorded on the state branch); the command has been corrected not to waste cycles doing so. * mb/filter-branch-optim: filter-branch: skip commits present on --state-branch
2018-07-18Merge branch 'dj/runtime-prefix'Libravatar Junio C Hamano1-1/+1
POSIX portability fix in Makefile to fix a glitch introduced a few releases ago. * dj/runtime-prefix: Makefile: tweak sed invocation
2018-07-18Merge branch 'ao/config-from-gitmodules'Libravatar Junio C Hamano6-57/+80
Tighten the API to make it harder to misuse in-tree .gitmodules file, even though it shares the same syntax with configuration files, to read random configuration items from it. * ao/config-from-gitmodules: submodule-config: reuse config_from_gitmodules in repo_read_gitmodules submodule-config: pass repository as argument to config_from_gitmodules submodule-config: make 'config_from_gitmodules' private submodule-config: add helper to get 'update-clone' config from .gitmodules submodule-config: add helper function to get 'fetch' config from .gitmodules config: move config_from_gitmodules to submodule-config.c
2018-07-18Merge branch 'jk/branch-l-0-deprecation'Libravatar Junio C Hamano4-21/+42
The "-l" option in "git branch -l" is an unfortunate short-hand for "--create-reflog", but many users, both old and new, somehow expect it to be something else, perhaps "--list". This step warns when "-l" is used as a short-hand for "--create-reflog" and warns about the future repurposing of the it when it is used. * jk/branch-l-0-deprecation: branch: deprecate "-l" option t: switch "branch -l" to "branch --create-reflog" t3200: unset core.logallrefupdates when testing reflog creation
2018-07-18Merge branch 'tb/grep-column'Libravatar Junio C Hamano8-34/+226
"git grep" learned the "--column" option that gives not just the line number but the column number of the hit. * tb/grep-column: contrib/git-jump/git-jump: jump to exact location grep.c: add configuration variables to show matched option builtin/grep.c: add '--column' option to 'git-grep(1)' grep.c: display column number of first match grep.[ch]: extend grep_opt to allow showing matched column grep.c: expose {,inverted} match column in match_line() Documentation/config.txt: camel-case lineNumber for consistency
2018-07-18Merge branch 'vs/typofixes'Libravatar Junio C Hamano13-15/+15
Doc fix. * vs/typofixes: Documentation: spelling and grammar fixes
2018-07-18Merge branch 'bw/protocol-v2'Libravatar Junio C Hamano1-2/+1
Doc fix. * bw/protocol-v2: protocol-v2 doc: put HTTP headers after request
2018-07-18Merge branch 'jt/remove-pack-bitmap-global'Libravatar Junio C Hamano5-160/+234
The effort to move globals to per-repository in-core structure continues. * jt/remove-pack-bitmap-global: pack-bitmap: add free function pack-bitmap: remove bitmap_git global variable
2018-07-18Merge branch 'bw/config-refer-to-gitsubmodules-doc'Libravatar Junio C Hamano1-2/+3
Docfix. * bw/config-refer-to-gitsubmodules-doc: docs: link to gitsubmodules
2018-07-18Merge branch 'xy/format-patch-prereq-patch-id-fix'Libravatar Junio C Hamano2-2/+5
Recently added "--base" option to "git format-patch" command did not correctly generate prereq patch ids. * xy/format-patch-prereq-patch-id-fix: format-patch: clear UNINTERESTING flag before prepare_bases
2018-07-18Merge branch 'pw/rebase-i-keep-reword-after-conflict'Libravatar Junio C Hamano3-3/+96
Bugfix for "rebase -i" corner case regression. * pw/rebase-i-keep-reword-after-conflict: sequencer: do not squash 'reword' commits when we hit conflicts
2018-07-18Merge branch 'ld/p423'Libravatar Junio C Hamano1-166/+182
Code preparation to make "git p4" closer to be usable with Python 3. * ld/p423: git-p4: python3: fix octal constants git-p4: python3: use print() function git-p4: python3: basestring workaround git-p4: python3: remove backticks git-p4: python3: replace dict.has_key(k) with "k in dict" git-p4: python3: replace <> with !=
2018-07-18Merge branch 'ds/ewah-cleanup'Libravatar Junio C Hamano6-402/+12
Remove unused function definitions and declarations from ewah bitmap subsystem. * ds/ewah-cleanup: ewah: delete unused 'rlwit_discharge_empty()' ewah: drop ewah_serialize_native function ewah: drop ewah_deserialize function ewah_io: delete unused 'ewah_serialize()' ewah_bitmap: delete unused 'ewah_or()' ewah_bitmap: delete unused 'ewah_not()' ewah_bitmap: delete unused 'ewah_and_not()' ewah_bitmap: delete unused 'ewah_and()' ewah/bitmap.c: delete unused 'bitmap_each_bit()' ewah/bitmap.c: delete unused 'bitmap_clear()'
2018-07-18Merge branch 'sb/submodule-core-worktree'Libravatar Junio C Hamano6-2/+55
"git submodule" did not correctly adjust core.worktree setting that indicates whether/where a submodule repository has its associated working tree across various state transitions, which has been corrected. * sb/submodule-core-worktree: submodule deinit: unset core.worktree submodule: ensure core.worktree is set after update submodule: unset core.worktree if no working tree is present
2018-07-18Merge branch 'sb/object-store-grafts'Libravatar Junio C Hamano95-328/+463
The conversion to pass "the_repository" and then "a_repository" throughout the object access API continues. * sb/object-store-grafts: commit: allow lookup_commit_graft to handle arbitrary repositories commit: allow prepare_commit_graft to handle arbitrary repositories shallow: migrate shallow information into the object parser path.c: migrate global git_path_* to take a repository argument cache: convert get_graft_file to handle arbitrary repositories commit: convert read_graft_file to handle arbitrary repositories commit: convert register_commit_graft to handle arbitrary repositories commit: convert commit_graft_pos() to handle arbitrary repositories shallow: add repository argument to is_repository_shallow shallow: add repository argument to check_shallow_file_for_update shallow: add repository argument to register_shallow shallow: add repository argument to set_alternate_shallow_file commit: add repository argument to lookup_commit_graft commit: add repository argument to prepare_commit_graft commit: add repository argument to read_graft_file commit: add repository argument to register_commit_graft commit: add repository argument to commit_graft_pos object: move grafts to object parser object-store: move object access functions to object-store.h
2018-07-18Merge branch 'en/merge-recursive-cleanup'Libravatar Junio C Hamano1-82/+104
Code cleanup. * en/merge-recursive-cleanup: merge-recursive: add pointer about unduly complex looking code merge-recursive: rename conflict_rename_*() family of functions merge-recursive: clarify the rename_dir/RENAME_DIR meaning merge-recursive: align labels with their respective code blocks merge-recursive: fix numerous argument alignment issues merge-recursive: fix miscellaneous grammar error in comment
2018-06-29.mailmap: merge different spellings of namesLibravatar Stefan Beller1-1/+10
This is a continuation of 94b410bba86 (.mailmap: Map email addresses to names, 2013-07-12), merging names that are spelled differently but have the same author email to the same person. Most spellings differed in accents or the order of names. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-29Makefile: fix the "built from commit" codeLibravatar Johannes Schindelin1-2/+3
In ed32b788c06 (version --build-options: report commit, too, if possible, 2017-12-15), we introduced code to let `git version --build-options` report the current commit from which the binaries were built, if any. To prevent erroneous commits from being reported (e.g. when unpacking Git's source code from a .tar.gz file into a subdirectory of a different Git project, as e.g. git_osx_installer does), we painstakingly set GIT_CEILING_DIRECTORIES when trying to determine the current commit. Except that we got the quoting wrong, and that variable therefore does not have the desired effect. The issue is that the $(shell) is resolved before the output is stuffed into the command-line with -DGIT_BUILT_FROM_COMMIT, and therefore is *not* inside quotes. And thus backslashing the quotes is wrong, as the quote gets literally inserted into the CEILING_DIRECTORIES variable. Let's fix that quoting, and while at it, also suppress the unhelpful message fatal: not a git repository (or any of the parent directories): .git that gets printed to stderr if no current commit could be determined, and might scare the occasional developer who simply tries to build Git from scratch. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-28Second batch for 2.19 cycleLibravatar Junio C Hamano1-0/+44
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-28Merge branch 'sb/fix-fetching-moved-submodules'Libravatar Junio C Hamano2-7/+5
The code to try seeing if a fetch is necessary in a submodule during a fetch with --recurse-submodules got confused when the path to the submodule was changed in the range of commits in the superproject, sometimes showing "(null)". This has been corrected. * sb/fix-fetching-moved-submodules: t5526: test recursive submodules when fetching moved submodules submodule: fix NULL correctness in renamed broken submodules
2018-06-28Merge branch 'tz/cred-netrc-cleanup'Libravatar Junio C Hamano3-6/+11
Build and test procedure for netrc credential helper (in contrib/) has been updated. * tz/cred-netrc-cleanup: git-credential-netrc: make "all" default target of Makefile git-credential-netrc: fix exit status when tests fail git-credential-netrc: use in-tree Git.pm for tests git-credential-netrc: minor whitespace cleanup in test script
2018-06-28Merge branch 'jc/clean-after-sanity-tests'Libravatar Junio C Hamano5-9/+6
test cleanup. * jc/clean-after-sanity-tests: tests: clean after SANITY tests
2018-06-28Merge branch 'nd/completion-negation'Libravatar Junio C Hamano4-34/+136
Continuing with the idea to programmatically enumerate various pieces of data required for command line completion, the codebase has been taught to enumerate options prefixed with "--no-" to negate them. * nd/completion-negation: completion: collapse extra --no-.. options completion: suppress some -no- options parse-options: option to let --git-completion-helper show negative form
2018-06-28Merge branch 'pw/add-p-recount'Libravatar Junio C Hamano2-1/+44
When user edits the patch in "git add -p" and the user's editor is set to strip trailing whitespaces indiscriminately, an empty line that is unchanged in the patch would become completely empty (instead of a line with a sole SP on it). The code introduced in Git 2.17 timeframe failed to parse such a patch, but now it learned to notice the situation and cope with it. * pw/add-p-recount: add -p: fix counting empty context lines in edited patches
2018-06-28Merge branch 'jk/fetch-all-peeled-fix'Libravatar Junio C Hamano2-4/+45
"git fetch-pack --all" used to unnecessarily fail upon seeing an annotated tag that points at an object other than a commit. * jk/fetch-all-peeled-fix: fetch-pack: test explicitly that --all can fetch tag references pointing to non-commits fetch-pack: don't try to fetch peel values with --all
2018-06-28Merge branch 'ms/send-pack-honor-config'Libravatar Junio C Hamano1-1/+1
"git send-pack --signed" (hence "git push --signed" over the http transport) did not read user ident from the config mechanism to determine whom to sign the push certificate as, which has been corrected. * ms/send-pack-honor-config: builtin/send-pack: populate the default configs
2018-06-28Merge branch 'jh/partial-clone'Libravatar Junio C Hamano2-0/+10
The recent addition of "partial clone" experimental feature kicked in when it shouldn't, namely, when there is no partial-clone filter defined even if extensions.partialclone is set. * jh/partial-clone: list-objects: check if filter is NULL before using
2018-06-28Merge branch 'sg/gpg-tests-fix'Libravatar Junio C Hamano4-7/+6
Some flaky tests have been fixed. * sg/gpg-tests-fix: tests: make forging GPG signed commits and tags more robust t7510-signed-commit: use 'test_must_fail'
2018-06-28Merge branch 'as/safecrlf-quiet-fix'Libravatar Junio C Hamano2-1/+11
Fix for 2.17-era regression around `core.safecrlf`. * as/safecrlf-quiet-fix: config.c: fix regression for core.safecrlf false
2018-06-28Merge branch 'ab/refspec-init-fix'Libravatar Junio C Hamano4-7/+15
Make refspec parsing codepath more robust. * ab/refspec-init-fix: refspec: initalize `refspec_item` in `valid_fetch_refspec()` refspec: add back a refspec_item_init() function refspec: s/refspec_item_init/&_or_die/g
2018-06-28Documentation: declare "core.ignoreCase" as internal variableLibravatar Marc Strapetz1-3/+6
The current description of "core.ignoreCase" reads like an option which is intended to be changed by the user while it's actually expected to be set by Git on initialization only. Subsequently, Git relies on the proper configuration of this variable, as noted by Bryan Turner [1]: Git on a case-insensitive filesystem (APFS, HFS+, FAT32, exFAT, vFAT, NTFS, etc.) is not designed to be run with anything other than core.ignoreCase=true. [1] https://marc.info/?l=git&m=152998665813997&w=2 mid:CAGyf7-GeE8jRGPkME9rHKPtHEQ6P1+ebpMMWAtMh01uO3bfy8w@mail.gmail.com Signed-off-by: Marc Strapetz <marc.strapetz@syntevo.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-28commit-graph: fix documentation inconsistenciesLibravatar Derrick Stolee1-5/+5
The commit-graph feature shipped in Git 2.18 has some inconsistencies in the constants used by the implementation and specified by the format document. The commit data chunk uses the key "CDAT" in the file format, but was previously documented to say "CGET". The commit data chunk stores commit parents using two 32-bit fields that typically store the integer position of the parent in the list of commit ids within the commit-graph file. When a parent does not exist, we had documented the value 0xffffffff, but implemented the value 0x70000000. This swap is easy to correct in the documentation, but unfortunately reduces the number of commits that we can store in the commit-graph. Update that estimate, too. Reported-by: Grant Welch <gwelch925@gmail.com> Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-06-27git-rebase--merge: modernize "git-$cmd" to "git $cmd"Libravatar Elijah Newren1-2/+2
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>