It is fragile, as there is no way for the revision machinery to say "but now I want to traverse the graph ignoring the graft file" e.g. when pushing commits to a remote repository (which, as a consequence, can miss commits). And we already have a better solution with `git replace --graft <comit> [<parent>...]`. Changes since v5: - Disentangled the lumped-together conditional blocks in edit_and_replace() again. - Moved fixup (a superfluous argv_array_clear()) from the patch that adds a test for --convert-graft-file back to the patch that actually introduces that option. Johannes Schindelin (11): argv_array: offer to split a string by whitespace commit: Let the callback of for_each_mergetag return on error replace: avoid using die() to indicate a bug replace: "libify" create_graft() and callees replace: introduce --convert-graft-file Add a test for `git replace --convert-graft-file` Deprecate support for .git/info/grafts filter-branch: stop suggesting to use grafts technical/shallow: stop referring to grafts technical/shallow: describe why shallow cannot use replace refs Remove obsolete script to convert grafts to replace refs Documentation/git-filter-branch.txt | 2 +- Documentation/git-replace.txt | 11 +- Documentation/technical/shallow.txt | 20 +- advice.c | 2 + advice.h | 1 + argv-array.c | 20 ++ argv-array.h | 2 + builtin/replace.c | 223 ++++++++++++++++------ commit.c | 18 +- commit.h | 4 +- contrib/convert-grafts-to-replace-refs.sh | 28 --- log-tree.c | 13 +- t/t6001-rev-list-graft.sh | 9 + t/t6050-replace.sh | 20 ++ 14 files changed, 258 insertions(+), 115 deletions(-) delete mode 100755 contrib/convert-grafts-to-replace-refs.sh base-commit: 1f1cddd558b54bb0ce19c8ace353fd07b758510d Published-As: https://github.com/dscho/git/releases/tag/deprecate-grafts-v6 Fetch-It-Via: git fetch https://github.com/dscho/git deprecate-grafts-v6 Interdiff vs v5: diff --git a/builtin/replace.c b/builtin/replace.c index acd30e3d824..35394ec1874 100644 --- a/builtin/replace.c +++ b/builtin/replace.c @@ -326,10 +326,15 @@ static int edit_and_replace(const char *object_ref, int force, int raw) strbuf_release(&ref); tmpfile = git_pathdup("REPLACE_EDITOBJ"); - if (export_object(&old_oid, type, raw, tmpfile) || - (launch_editor(tmpfile, NULL, NULL) < 0 && - error("editing object file failed")) || - import_object(&new_oid, type, raw, tmpfile)) { + if (export_object(&old_oid, type, raw, tmpfile)) { + free(tmpfile); + return -1; + } + if (launch_editor(tmpfile, NULL, NULL) < 0) { + free(tmpfile); + return error("editing object file failed"); + } + if (import_object(&new_oid, type, raw, tmpfile)) { free(tmpfile); return -1; } -- 2.17.0.windows.1.33.gfcbb1fa0445