fast-import: Introduce --import-marks-if-exists
commitdded4f12a46274753439e3a8fa4eb756c5d14ae1
authorRamkumar Ramachandra <artagnon@gmail.com>
Sat, 15 Jan 2011 06:31:46 +0000 (15 12:01 +0530)
committerJunio C Hamano <gitster@pobox.com>
Tue, 18 Jan 2011 15:07:01 +0000 (18 07:07 -0800)
tree5ff634e2e7d773422f56524a9f31c75c4d302fbd
parentadf872e7837cc92e390f00ee32f32c5639d3a444
fast-import: Introduce --import-marks-if-exists

When a frontend uses a marks file to ensure its state persists between
runs, it may represent "clean slate" when bootstrapping with "no marks
yet". In such a case, feeding the last state with --import-marks and
saving the state after the current run with --export-marks would be a
natural thing to do.

The --import-marks option however errors out when the specified marks file
doesn't exist; this makes bootstrapping a bit difficult.  The location of
the marks file becomes backend-dependent when --relative-marks is in
effect, and the frontend cannot check for the existence of the file in
such a case.

The --import-marks-if-exists option does the same thing as --import-marks
but does not flag an error if the named file does not exist yet to help
these frontends.

Helped-by: Junio C Hamano <gitster@pobox.com>
Helped-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-fast-import.txt
fast-import.c
t/t9300-fast-import.sh