add more ref consistency checks
Get series with b4
b4 am Z8CMx7O19PMs9sVY@ArchLinuxVersions newest first · linked by author and title
- v8 Latest9 patches 0 repliesNew
- v79 patches 5 repliesSuperseded
- v69 patches 4 repliesSuperseded
Earlier versions · 5
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v5 | 8 patches | 5 replies | Superseded | |
| v4 | 8 patches | 9 replies | Superseded | |
| v3 | 8 patches | 12 replies | Superseded | |
| v2 | 8 patches | 27 replies | Applied | |
| v1 | 10 patches | 29 replies | Superseded |
Patches in v8 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/9 | t0602: use subshell to ensure working directory unchangedt/ | +494 | 0 replies | |
| 2/9 | builtin/refs: get worktrees without reading head informationbuiltin/ worktree.c worktree.h | +14 | 0 replies | |
| 3/9 | packed-backend: check whether the "packed-refs" is regular filerefs/ t/ | +78 | 0 replies | |
| 4/9 | packed-backend: check if header starts with "# pack-refs with: "refs/ | +1 | 0 replies | |
| 5/9 | packed-backend: add "packed-refs" header consistency checkDocumentation/ fsck.h refs/ +1 more | +135 | 0 replies | |
| 6/9 | packed-backend: check whether the refname contains NUL charactersrefs/ | +18 | 0 replies | |
| 7/9 | packed-backend: add "packed-refs" entry consistency checkDocumentation/ fsck.h refs/ +1 more | +169 | 0 replies | |
| 8/9 | packed-backend: check whether the "packed-refs" is sortedDocumentation/ fsck.h refs/ +1 more | +191 | 0 replies | |
| 9/9 | builtin/fsck: add `git refs verify` child processDocumentation/ builtin/ t/ | +77 | 0 replies |
Reviews trailers per patch
None of the 9 patches has a Reviewed-by or Acked-by.
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v8 0/9] add more ref consistency checks
Hi All:
This changes enhances the following things:
1. [PATCH v8 3/9]: initialize fd = -1 for two purposes:
1. We could use unified goto cleanup where we have one only control.
2. We should not close the fd when we cannot open the file.
Hope that this version would be final. Thank for the effort of every reviewer.
Thanks,
Jialuo
---
This series mainly does the following things:
1. Fix subshell issues
2. Add ref checks for packed-backend.
1. Check whether the filetype of "packed-refs" is correct.
2. Check whether the syntax of "packed-refs" is correct by using the rules from "packed-backend.c::create_snapshot" and "packed-backend.c::next_record".
3. Check whether the pointed object exists and whether the "packed-refs" file is sorted.
3. Call "git refs verify" for "git-fsck(1)".
shejialuo (9):
t0602: use subshell to ensure working directory unchanged builtin/refs: get worktrees without reading head information
packed-backend: check whether the "packed-refs" is regular file
packed-backend: check if header starts with "# pack-refs with: "
packed-backend: add "packed-refs" header consistency check
packed-backend: check whether the refname contains NUL characters
packed-backend: add "packed-refs" entry consistency check
packed-backend: check whether the "packed-refs" is sorted builtin/fsck: add git refs verify child process
Documentation/fsck-msgids.adoc | 14 + Documentation/git-fsck.adoc | 7 +- builtin/fsck.c | 33 +- builtin/refs.c | 2 +- fsck.h | 4 + refs/packed-backend.c | 363 +++++++++- t/t0602-reffiles-fsck.sh | 1209 +++++++++++++++++++------------- worktree.c | 5 + worktree.h | 8 + 9 files changed, 1162 insertions(+), 483 deletions(-)
Range-diff against v7:
1: b3952d80a2 = 1: b3952d80a2 t0602: use subshell to ensure working directory unchanged
2: fa5ce20bb7 = 2: fa5ce20bb7 builtin/refs: get worktrees without reading head information
3: 861583f417 ! 3: b3686a9695 packed-backend: check whether the "packed-refs" is regular file
@@ refs/packed-backend.c: static struct ref_iterator *packed_reflog_iterator_begin(
+ REF_STORE_READ, "fsck");
+ struct stat st;
+ int ret = 0;
-+ int fd;
++ int fd = -1;
if (!is_main_worktree(wt))
- return 0;
+- return 0;
++ goto cleanup;
- return 0;
+ if (o->verbose)
4: 5f54cb05c3 = 4: 2638d5043f packed-backend: check if header starts with "# pack-refs with: "
5: 7d7dc899ad ! 5: 13e34de350 packed-backend: add "packed-refs" header consistency check
@@ refs/packed-backend.c: static struct ref_iterator *packed_reflog_iterator_begin(
+ struct strbuf packed_ref_content = STRBUF_INIT;
struct stat st;
int ret = 0;
- int fd;
+ int fd = -1;
@@ refs/packed-backend.c: static int packed_fsck(struct ref_store *ref_store,
goto cleanup;
}
6: 571479d3e7 = 6: 0632a1d5e2 packed-backend: check whether the refname contains NUL characters
7: e498a57286 = 7: 4618da3199 packed-backend: add "packed-refs" entry consistency check
8: 3638cb118d ! 8: 355e43d251 packed-backend: check whether the "packed-refs" is sorted
@@ refs/packed-backend.c: static int packed_fsck(struct ref_store *ref_store,
+ unsigned int sorted = 0;
struct stat st;
int ret = 0;
- int fd;
+ int fd = -1;
@@ refs/packed-backend.c: static int packed_fsck(struct ref_store *ref_store,
goto cleanup;
} 9: 5d87e76d28 = 9: 57dac06151 builtin/fsck: add git refs verify child process
Signature · 1 line
2.48.1