Skip to content

format-patch --no-clobber

Junio C Hamano git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3builtin/log: downcase the beginning of error messagesbuiltin/log.c+19 -192 replies
2/3format-patch: notice failure to open cover letter for writingbuiltin/log.c t/t4014-format-patch.sh+7 -10 replies
3/3format-patch: --no-clobber refrains from overwriting output filesDocumentation/git-format-patch.txt builtin/log.c t/t4014-format-patch.sh+49 -73 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] format-patch --no-clobber

If you keep an output for an older iteration of the same topic in the same directory around and use "git format-patch" to prepare a newer iteration of the topic, those commits that happen to be at the same position in the series that have not been retitled will get the same filename---and the command opens them for writing without any check.

Existing "-o outdir" and "-v number" options are both good ways to avoid such name collisions, and in general helps to give good ways to compare the latest iteration with older iteration(s), but let's see if "--no-clobber" option that forbids overwrting existing files would also help people.

I meant to have just a single patch for this, but it ended up to be a three-patch series.

- Preliminary clean-up of builtin/log.c updates messages in the file given to die()s and error()s that begin with capital by downcasing them to match majority of the messages in the system.

- When we fail to open a patchfile for writing, we immediately stop and report failure, but we weren't careful about the cover letter output, which is fixed by the second patch.

- The last one adds an experimental "--no-clobber" option to forbid the command from overwriting existing output files. This is not enabled by default, as suggeted by Brian Carlson in [1], at least for now.

Junio C Hamano (3):
builtin/log: downcase the beginning of error messages
format-patch: notice failure to open cover letter for writing
format-patch: --no-clobber refrains from overwriting output files

 Documentation/git-format-patch.txt |  8 +++-
 builtin/log.c                      | 72 +++++++++++++++++++-----------
 t/t4014-format-patch.sh            | 22 +++++++++
 3 files changed, 75 insertions(+), 27 deletions(-)

*1* <[email protected]>

Signature · 1 line
2.21.0-rc2