Skip to content

Commit

Permalink
Merge branch 'maint-1.7.2' into maint-1.7.3
Browse files Browse the repository at this point in the history
* maint-1.7.2:
  fast-import: introduce "feature notes" command
  fast-import: clarify documentation of "feature" command
  • Loading branch information
Junio C Hamano committed Feb 16, 2011
2 parents 960ac5f + 6a7f71d commit da656f1
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 20 deletions.
43 changes: 23 additions & 20 deletions Documentation/git-fast-import.txt
Original file line number Diff line number Diff line change
Expand Up @@ -882,28 +882,31 @@ Require that fast-import supports the specified feature, or abort if
it does not.

....
'feature' SP <feature> LF
'feature' SP <feature> ('=' <argument>)? LF
....

The <feature> part of the command may be any string matching
^[a-zA-Z][a-zA-Z-]*$ and should be understood by fast-import.

Feature work identical as their option counterparts with the
exception of the import-marks feature, see below.

The following features are currently supported:

* date-format
* import-marks
* export-marks
* relative-marks
* no-relative-marks
* force

The import-marks behaves differently from when it is specified as
commandline option in that only one "feature import-marks" is allowed
per stream. Also, any --import-marks= specified on the commandline
will override those from the stream (if any).
The <feature> part of the command may be any one of the following:

date-format::
export-marks::
relative-marks::
no-relative-marks::
force::
Act as though the corresponding command-line option with
a leading '--' was passed on the command line
(see OPTIONS, above).

import-marks::
Like --import-marks except in two respects: first, only one
"feature import-marks" command is allowed per stream;
second, an --import-marks= command-line option overrides
any "feature import-marks" command in the stream.

notes::
Require that the backend support the 'notemodify' (N)
subcommand to the 'commit' command.
Versions of fast-import not supporting notes will exit
with a message indicating so.

`option`
~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions fast-import.c
Original file line number Diff line number Diff line change
Expand Up @@ -2815,6 +2815,8 @@ static int parse_one_feature(const char *feature, int from_stream)
relative_marks_paths = 0;
} else if (!prefixcmp(feature, "force")) {
force_update = 1;
} else if (!strcmp(feature, "notes")) {
; /* do nothing; we have the feature */
} else {
return 0;
}
Expand Down
1 change: 1 addition & 0 deletions t/t9301-fast-import-notes.sh
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ test_expect_success 'add notes with simple M command' '

test_tick
cat >input <<INPUT_END
feature notes
commit refs/notes/test
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
Expand Down

0 comments on commit da656f1

Please sign in to comment.