Skip to content

Commit 6a7f71d

Browse files
committed
Merge branch 'maint-1.7.1' into maint-1.7.2
* maint-1.7.1: fast-import: introduce "feature notes" command fast-import: clarify documentation of "feature" command
2 parents 7a876ed + 206af7c commit 6a7f71d

File tree

3 files changed

+26
-20
lines changed

3 files changed

+26
-20
lines changed

Documentation/git-fast-import.txt

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -878,28 +878,31 @@ Require that fast-import supports the specified feature, or abort if
878878
it does not.
879879

880880
....
881-
'feature' SP <feature> LF
881+
'feature' SP <feature> ('=' <argument>)? LF
882882
....
883883

884-
The <feature> part of the command may be any string matching
885-
^[a-zA-Z][a-zA-Z-]*$ and should be understood by fast-import.
886-
887-
Feature work identical as their option counterparts with the
888-
exception of the import-marks feature, see below.
889-
890-
The following features are currently supported:
891-
892-
* date-format
893-
* import-marks
894-
* export-marks
895-
* relative-marks
896-
* no-relative-marks
897-
* force
898-
899-
The import-marks behaves differently from when it is specified as
900-
commandline option in that only one "feature import-marks" is allowed
901-
per stream. Also, any --import-marks= specified on the commandline
902-
will override those from the stream (if any).
884+
The <feature> part of the command may be any one of the following:
885+
886+
date-format::
887+
export-marks::
888+
relative-marks::
889+
no-relative-marks::
890+
force::
891+
Act as though the corresponding command-line option with
892+
a leading '--' was passed on the command line
893+
(see OPTIONS, above).
894+
895+
import-marks::
896+
Like --import-marks except in two respects: first, only one
897+
"feature import-marks" command is allowed per stream;
898+
second, an --import-marks= command-line option overrides
899+
any "feature import-marks" command in the stream.
900+
901+
notes::
902+
Require that the backend support the 'notemodify' (N)
903+
subcommand to the 'commit' command.
904+
Versions of fast-import not supporting notes will exit
905+
with a message indicating so.
903906

904907
`option`
905908
~~~~~~~~

fast-import.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2800,6 +2800,8 @@ static int parse_one_feature(const char *feature, int from_stream)
28002800
relative_marks_paths = 0;
28012801
} else if (!prefixcmp(feature, "force")) {
28022802
force_update = 1;
2803+
} else if (!strcmp(feature, "notes")) {
2804+
; /* do nothing; we have the feature */
28032805
} else {
28042806
return 0;
28052807
}

t/t9301-fast-import-notes.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ test_expect_success 'add notes with simple M command' '
120120

121121
test_tick
122122
cat >input <<INPUT_END
123+
feature notes
123124
commit refs/notes/test
124125
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
125126
data <<COMMIT

0 commit comments

Comments
 (0)