rev-parse: strengthen validation of ref@{n} references
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v3 Latest3 patches 0 repliesNew
- v22 patches 1 replySuperseded
- v14 patches 3 repliesSuperseded
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | rev-parse: exit with non-zero status if ref@{n} is not valid.sha1_name.c | +7 | 0 replies | |
| 2/3 | sha1_name.c: use warning in preference to fprintf(stderrsha1_name.c | +4 | 0 replies | |
| 3/3 | rev-parse: tests git rev-parse --verify master@{n}, for various nt/ t/ | +20 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v3 yet.
Cover letter [PATCH v3 0/3] rev-parse: strengthen validation of ref@{n} references
This series changes git rev-parse so that references of the form:
ref@{n}cause rev-parse to fail with a non-zero status code if n >= size of the reference log for ref.
The first commit implements the changed behaviour; the second commit replaces uses of fprintf (within sha1_name.c) with warning;
the third commit updates the tests to include tests for the changed behaviour.
This is the third revision of this series. It differs from the first in that it uses die rather than error to report the condition and thus exits early, without generating any output on stdout for the failing argument. It also reports just a single fatal message instead of both an error message and a fatal message.
The original patch and this revision are both based on suggestions from Junio. Corrections to diagnostic output inspired by Jonathan Nieder's review.
Jon Seymour (3):
rev-parse: exit with non-zero status if ref@{n} is not valid. sha1_name.c: use warning in preference to fprintf(stderr
rev-parse: tests git rev-parse --verify master@{n}, for various n
sha1_name.c | 20 +++++++++++--------- t/t1503-rev-parse-verify.sh | 11 +++++++++++ t/t1506-rev-parse-diagnosis.sh | 9 +++++++++ 3 files changed, 31 insertions(+), 9 deletions(-)
Signature · 1 line
1.7.2.1.100.gceecd