git/builtin
Taylor Blau 2f00c355cb commit-graph: drop COMMIT_GRAPH_WRITE_CHECK_OIDS flag
Since 7c5c9b9c57 (commit-graph: error out on invalid commit oids in
'write --stdin-commits', 2019-08-05), the commit-graph builtin dies on
receiving non-commit OIDs as input to '--stdin-commits'.

This behavior can be cumbersome to work around in, say, the case of
piping 'git for-each-ref' to 'git commit-graph write --stdin-commits' if
the caller does not want to cull out non-commits themselves. In this
situation, it would be ideal if 'git commit-graph write' wrote the graph
containing the inputs that did pertain to commits, and silently ignored
the remainder of the input.

Some options have been proposed to the effect of '--[no-]check-oids'
which would allow callers to have the commit-graph builtin do just that.
After some discussion, it is difficult to imagine a caller who wouldn't
want to pass '--no-check-oids', suggesting that we should get rid of the
behavior of complaining about non-commit inputs altogether.

If callers do wish to retain this behavior, they can easily work around
this change by doing the following:

     git for-each-ref --format='%(objectname) %(objecttype) %(*objecttype)' |
     awk '
       !/commit/ { print "not-a-commit:"$1 }
        /commit/ { print $1 }
     ' |
     git commit-graph write --stdin-commits

To make it so that valid OIDs that refer to non-existent objects are
indeed an error after loosening the error handling, perform an extra
lookup to make sure that object indeed exists before sending it to the
commit-graph internals.

Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-05-18 12:51:11 -07:00
..
add.c Merge branch 'hw/advice-add-nothing' 2020-02-14 12:54:19 -08:00
am.c am: support --show-current-patch=diff to retrieve .git/rebase-apply/patch 2020-02-20 13:20:41 -08:00
annotate.c
apply.c
archive.c
bisect--helper.c bisect: libify check_good_are_ancestors_of_bad and its dependents 2020-02-19 09:37:14 -08:00
blame.c blame: use changed-path Bloom filters 2020-04-16 15:38:06 -07:00
branch.c l10n: minor case fix in 'git branch' '--unset-upstream' description 2019-12-09 12:30:55 -08:00
bundle.c bundle-verify: add --quiet 2019-11-11 11:46:29 +09:00
cat-file.c Merge branch 'jk/oid-array-cleanups' 2020-04-22 13:42:49 -07:00
check-attr.c
check-ignore.c check-ignore: fix documentation and implementation to match 2020-02-18 15:28:58 -08:00
check-mailmap.c
check-ref-format.c
checkout-index.c
checkout.c builtin/checkout: compute checkout metadata for checkouts 2020-03-16 11:37:02 -07:00
clean.c Merge branch 'en/fill-directory-exponential' 2020-04-29 16:15:31 -07:00
clone.c Merge branch 'jc/log-no-mailmap' 2020-04-28 15:50:00 -07:00
column.c
commit-graph.c commit-graph: drop COMMIT_GRAPH_WRITE_CHECK_OIDS flag 2020-05-18 12:51:11 -07:00
commit-tree.c
commit.c Merge branch 'ds/blame-on-bloom' 2020-05-01 13:39:54 -07:00
config.c config: add '--show-scope' to print the scope of a config value 2020-02-10 10:49:12 -08:00
count-objects.c
credential.c
describe.c Merge branch 'jc/describe-misnamed-annotated-tag' 2020-03-26 17:11:21 -07:00
diff-files.c
diff-index.c
diff-tree.c diff-tree.c: load notes machinery when required 2020-04-20 18:22:54 -07:00
diff.c oid_array: rename source file from sha1-array 2020-03-30 10:59:08 -07:00
difftool.c hashmap: remove type arg from hashmap_{get,put,remove}_entry 2019-10-07 10:20:12 +09:00
env--helper.c env--helper: mark a file-local symbol as static 2019-07-11 14:31:04 -07:00
fast-export.c Merge branch 'mt/use-passed-repo-more-in-funcs' 2020-02-14 12:54:22 -08:00
fetch-pack.c oid_array: rename source file from sha1-array 2020-03-30 10:59:08 -07:00
fetch.c Merge branch 'jt/connectivity-check-optim-in-partial-clone' 2020-04-22 13:42:43 -07:00
fmt-merge-msg.c Lib-ify fmt-merge-msg 2020-03-24 15:04:43 -07:00
for-each-ref.c
fsck.c fsck: only provide oid/type in fsck_error callback 2019-10-28 14:05:18 +09:00
gc.c commit-graph.h: store an odb in 'struct write_commit_graph_context' 2020-02-04 11:36:37 -08:00
get-tar-commit-id.c
grep.c Merge branch 'en/fill-directory-exponential' 2020-04-29 16:15:31 -07:00
hash-object.c
help.c Merge branch 'es/bugreport' 2020-05-01 13:39:59 -07:00
index-pack.c promisor-remote: accept 0 as oid_nr in function 2020-04-02 12:42:32 -07:00
init-db.c Merge branch 'bc/sha-256-part-1-of-4' 2020-03-26 17:11:20 -07:00
interpret-trailers.c
log.c Merge branch 'ds/log-exclude-decoration-config' 2020-04-28 15:50:08 -07:00
ls-files.c Fix error-prone fill_directory() API; make it only return matches 2020-04-01 11:11:31 -07:00
ls-remote.c
ls-tree.c
mailinfo.c
mailsplit.c
merge-base.c rebase: --fork-point regression fix 2020-02-11 09:59:39 -08:00
merge-file.c
merge-index.c
merge-ours.c
merge-recursive.c Ensure index matches head before invoking merge machinery, round N 2019-08-19 10:08:03 -07:00
merge-tree.c Merge branch 'jk/tree-walk-overflow' 2019-08-22 12:34:10 -07:00
merge.c Merge branch 'ds/blame-on-bloom' 2020-05-01 13:39:54 -07:00
mktag.c sha1-file: allow check_object_signature() to handle any repo 2020-01-31 10:45:39 -08:00
mktree.c
multi-pack-index.c multi-pack-index: add [--[no-]progress] option. 2019-10-23 12:05:06 +09:00
mv.c
name-rev.c name-rev: sort tip names before applying 2020-02-05 10:36:33 -08:00
notes.c strbuf: add and use strbuf_insertstr() 2020-02-10 09:04:45 -08:00
pack-objects.c Merge branch 'jk/oid-array-cleanups' 2020-04-22 13:42:49 -07:00
pack-redundant.c
pack-refs.c
patch-id.c patch-id: use oid_to_hex() to print multiple object IDs 2019-12-09 12:26:40 -08:00
prune-packed.c Lib-ify prune-packed 2020-03-24 15:04:44 -07:00
prune.c Lib-ify prune-packed 2020-03-24 15:04:44 -07:00
pull.c Merge branch 'dl/merge-autostash' 2020-04-29 16:15:27 -07:00
push.c push: anonymize URLs in error messages and warnings 2020-04-28 15:17:45 -07:00
range-diff.c range-diff: clear other_arg at end of function 2019-12-06 12:36:53 -08:00
read-tree.c sparse-checkout: update working directory in-process 2019-11-22 16:11:44 +09:00
rebase.c Merge branch 'en/rebase-root-and-fork-point-are-incompatible' 2020-05-01 13:39:58 -07:00
receive-pack.c Merge branch 'tb/reset-shallow' 2020-05-01 13:39:51 -07:00
reflog.c parse_config_key(): return subsection len as size_t 2020-04-10 14:44:29 -07:00
remote-ext.c
remote-fd.c
remote.c remote rename/remove: gently handle remote.pushDefault config 2020-02-10 10:52:10 -08:00
repack.c Lib-ify prune-packed 2020-03-24 15:04:44 -07:00
replace.c sha1-file: pass git_hash_algo to hash_object_file() 2020-01-31 10:45:39 -08:00
rerere.c
reset.c builtin/reset: compute checkout metadata for reset 2020-03-16 11:37:02 -07:00
rev-list.c rev-list --count: comment on the use of count_right++ 2020-02-18 13:21:46 -08:00
rev-parse.c get_superproject_working_tree(): return strbuf 2020-03-10 11:41:40 -07:00
revert.c Merge branch 'ra/cherry-pick-revert-skip' 2019-07-19 11:30:21 -07:00
rm.c rm: support the --pathspec-from-file option 2020-02-19 10:56:49 -08:00
send-pack.c oid_array: rename source file from sha1-array 2020-03-30 10:59:08 -07:00
shortlog.c
show-branch.c use strpbrk(3) to search for characters from a given set 2020-02-24 09:30:31 -08:00
show-index.c builtin/show-index: replace sha1_to_hex 2019-08-19 15:04:59 -07:00
show-ref.c
sparse-checkout.c sparse-checkout: provide a new reapply subcommand 2020-03-27 11:33:31 -07:00
stash.c Merge branch 'en/fill-directory-exponential' 2020-04-29 16:15:31 -07:00
stripspace.c
submodule--helper.c submodule--helper.c: Rename 'cb_foreach' to 'foreach_cb' 2020-03-18 12:43:25 -07:00
symbolic-ref.c
tag.c Merge branch 'jk/oid-array-cleanups' 2020-04-22 13:42:49 -07:00
unpack-file.c
unpack-objects.c sha1-file: pass git_hash_algo to hash_object_file() 2020-01-31 10:45:39 -08:00
update-index.c Merge branch 'js/update-index-ignore-removal-for-skip-worktree' 2019-11-10 18:02:16 +09:00
update-ref.c update-ref: implement interactive transaction handling 2020-04-02 11:09:49 -07:00
update-server-info.c
upload-archive.c
upload-pack.c
var.c
verify-commit.c Merge branch 'jk/no-system-includes-in-dot-c' 2019-07-31 14:38:56 -07:00
verify-pack.c
verify-tag.c
worktree.c real_path: remove unsafe API 2020-03-10 11:41:40 -07:00
write-tree.c