Skip to content

commit-graph: error out on invalid commit oids in 'write --stdin-commits'

SZEDER Gábor git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3t5318-commit-graph: use 'test_expect_code't/t5318-commit-graph.sh+1 -20 replies
2/3commit-graph: turn a group of write-related macro flags into an enumbuiltin/commit-graph.c builtin/gc.c commit-graph.c +1 more+18 -140 replies
3/3commit-graph: error out on invalid commit oids in 'write --stdin-commits'builtin/commit-graph.c commit-graph.c commit-graph.h +1 more+33 -1514 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/3] commit-graph: error out on invalid commit oids in 'write --stdin-commits'

While 'git commit-graph write --stdin-commits' expects commit object ids as input, it accepts and silently skips over any invalid commit object ids, and still exits with success:

  $ echo not-a-commit-oid | git commit-graph write --stdin-commits
  $ echo $?
  $ ls -l .git/objects/info/commit-graph
  ls: cannot access '.git/objects/info/commit-graph': No such file or directory

The last patch in this series fixes this issue, with a bit of preparatory refactoring in the second and a while-at-it cleanup in the first patches.

SZEDER Gábor (3):
t5318-commit-graph: use 'test_expect_code'
commit-graph: turn a group of write-related macro flags into an enum
commit-graph: error out on invalid commit oids in 'write
--stdin-commits'

 builtin/commit-graph.c  | 10 ++++++----
 builtin/gc.c            |  2 +-
 commit-graph.c          | 40 +++++++++++++++++++++++-----------------
 commit-graph.h          | 15 ++++++++++-----
 t/t5318-commit-graph.sh | 14 +++++++++++---
 5 files changed, 51 insertions(+), 30 deletions(-)
Signature · 1 line
2.23.0.rc1.309.g896d8c5f5f