From: Junio C Hamano Date: Wed, 16 Feb 2011 22:32:54 +0000 (-0800) Subject: Merge branch 'maint-1.7.1' into maint-1.7.2 X-Git-Tag: v1.7.7-rc1~22^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6a7f71d376becc1a5b0357b682dd0c20842104b0?ds=inline;hp=-c 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 --- 6a7f71d376becc1a5b0357b682dd0c20842104b0 diff --combined Documentation/git-fast-import.txt index 77a0a2481a,becee8b4e7..072d4f9af2 --- a/Documentation/git-fast-import.txt +++ b/Documentation/git-fast-import.txt @@@ -439,7 -439,7 +439,7 @@@ Marks must be declared (via `mark`) bef * A complete 40 byte or abbreviated commit SHA-1 in hex. * Any valid Git SHA-1 expression that resolves to a commit. See - ``SPECIFYING REVISIONS'' in linkgit:git-rev-parse[1] for details. + ``SPECIFYING REVISIONS'' in linkgit:gitrevisions[1] for details. The special case of restarting an incremental import from the current branch value should be written as: @@@ -878,28 -878,31 +878,31 @@@ Require that fast-import supports the s it does not. .... - 'feature' SP LF - .... - - The 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). + 'feature' SP ('=' )? LF + .... + + The 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` ~~~~~~~~ diff --combined fast-import.c index ddad289dae,bce460e2ed..86687f3910 --- a/fast-import.c +++ b/fast-import.c @@@ -267,7 -267,7 +267,7 @@@ struct hash_lis typedef enum { WHENSPEC_RAW = 1, WHENSPEC_RFC2822, - WHENSPEC_NOW, + WHENSPEC_NOW } whenspec_type; struct recent_command @@@ -1666,7 -1666,7 +1666,7 @@@ static void dump_marks_helper(FILE *f if (m->shift) { for (k = 0; k < 1024; k++) { if (m->data.sets[k]) - dump_marks_helper(f, (base + k) << m->shift, + dump_marks_helper(f, base + (k << m->shift), m->data.sets[k]); } } else { @@@ -2707,7 -2707,6 +2707,7 @@@ static void option_import_marks(const c } import_marks_file = make_fast_import_path(marks); + safe_create_leading_directories_const(import_marks_file); import_marks_file_from_stream = from_stream; } @@@ -2738,7 -2737,6 +2738,7 @@@ static void option_active_branches(cons static void option_export_marks(const char *marks) { export_marks_file = make_fast_import_path(marks); + safe_create_leading_directories_const(export_marks_file); } static void option_export_pack_edges(const char *edges) @@@ -2800,6 -2798,8 +2800,8 @@@ static int parse_one_feature(const cha 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; }