Skip to content

gc: fix handling of crontab magic markers

Martin Ågren git 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3git-maintenance.txt: add missing wordDocumentation/git-maintenance.txt+1 -10 replies
2/3gc: fix handling of crontab magic markersbuiltin/gc.c t/t7900-maintenance.sh+10 -45 replies
3/3t7900-maintenance: test for magic markerst/t7900-maintenance.sh+9 -00 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] gc: fix handling of crontab magic markers

This is a fix for a new bug in the v2.30 cycle:

git maintenance [start|stop] add and/or remove entries to/from the user's cron table. When inserting entries, we add magic "BEGIN" and "END" markers. When we later removes these entries, we remove everything from "BEGIN" to ... the end of file. A realistic scenario for hitting this bug is

  $ git maintenance start
  $ crontab -e # add stuff at the end of the file
  $ git maintenance stop
  $ crontab -l # stuff from above is gone

The second patch is the actual fix. The first patch is just a very minor fix to the documentation. The third patch future-proofs the magic markers, so that we can be reasonably sure that all future versions of Git stick to these strings.

Martin Ågren (3):
git-maintenance.txt: add missing word
gc: fix handling of crontab magic markers
t7900-maintenance: test for magic markers

 Documentation/git-maintenance.txt |  2 +-
 t/t7900-maintenance.sh            | 16 ++++++++++++++++
 builtin/gc.c                      |  7 +++----
 3 files changed, 20 insertions(+), 5 deletions(-)
Signature · 1 line
2.30.0.rc1