summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 68595cd)
raw | patch | inline | side by side (parent: 68595cd)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Wed, 9 Feb 2011 22:43:57 +0000 (16:43 -0600) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 10 Feb 2011 00:06:51 +0000 (16:06 -0800) |
Here is a 'feature' command for streams to use to require support for
the notemodify (N) command.
When the 'feature' facility was introduced (v1.7.0-rc0~95^2~4,
2009-12-04), the notes import feature was old news (v1.6.6-rc0~21^2~8,
2009-10-09) and it was not obvious it deserved to be a named feature.
But now that is clear, since all major non-git fast-import backends
lack support for it.
Details: on git version with this patch applied, any "feature notes"
command in the features/options section at the beginning of a stream
will be treated as a no-op. On fast-import implementations without
the feature (and older git versions), the command instead errors out
with a message like
This version of fast-import does not support feature notes.
So by declaring use of notes at the beginning of a stream, frontends
can avoid wasting time and other resources when the backend does not
support notes. (This would be especially important for backends that
do not support rewinding history after a botched import.)
Improved-by: Thomas Rast <trast@student.ethz.ch>
Improved-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
the notemodify (N) command.
When the 'feature' facility was introduced (v1.7.0-rc0~95^2~4,
2009-12-04), the notes import feature was old news (v1.6.6-rc0~21^2~8,
2009-10-09) and it was not obvious it deserved to be a named feature.
But now that is clear, since all major non-git fast-import backends
lack support for it.
Details: on git version with this patch applied, any "feature notes"
command in the features/options section at the beginning of a stream
will be treated as a no-op. On fast-import implementations without
the feature (and older git versions), the command instead errors out
with a message like
This version of fast-import does not support feature notes.
So by declaring use of notes at the beginning of a stream, frontends
can avoid wasting time and other resources when the backend does not
support notes. (This would be especially important for backends that
do not support rewinding history after a botched import.)
Improved-by: Thomas Rast <trast@student.ethz.ch>
Improved-by: Sverre Rabbelier <srabbelier@gmail.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-fast-import.txt | patch | blob | history | |
fast-import.c | patch | blob | history | |
t/t9301-fast-import-notes.sh | patch | blob | history |
index 3bf04e3293d67ae769d0ef46ade106bcc1519784..becee8b4e71859674495cff398a4de976f3f6a3b 100644 (file)
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`
~~~~~~~~
Processes the specified option so that git fast-import behaves in a
diff --git a/fast-import.c b/fast-import.c
index 74f08bd554ae4cab1dc9ee38272376e5cbec1200..ff56ea28918dd706f57617632c82336654db3543 100644 (file)
--- a/fast-import.c
+++ b/fast-import.c
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;
}
index a5c99d85074a3e04d699afd9b0990a89afe33f54..164edf0c3da8d89513782b842ebdfb4dc3d84c7e 100755 (executable)
test_tick
cat >input <<INPUT_END
+feature notes
commit refs/notes/test
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT