Skip to content

Commit 4d59753

Browse files
committed
Merge branch 'en/fast-export-import'
Small fixes and features for fast-export and fast-import, mostly on the fast-export side. * en/fast-export-import: fast-export: add a --show-original-ids option to show original names fast-import: remove unmaintained duplicate documentation fast-export: add --reference-excluded-parents option fast-export: ensure we export requested refs fast-export: when using paths, avoid corrupt stream with non-existent mark fast-export: move commit rewriting logic into a function for reuse fast-export: avoid dying when filtering by paths and old tags exist fast-export: use value from correct enum git-fast-export.txt: clarify misleading documentation about rev-list args git-fast-import.txt: fix documentation for --quiet option fast-export: convert sha1 to oid
2 parents cde5554 + a965bb3 commit 4d59753

File tree

5 files changed

+268
-214
lines changed

5 files changed

+268
-214
lines changed

Documentation/git-fast-export.txt

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,25 @@ marks the same across runs.
110110
the shape of the history and stored tree. See the section on
111111
`ANONYMIZING` below.
112112

113+
--reference-excluded-parents::
114+
By default, running a command such as `git fast-export
115+
master~5..master` will not include the commit master{tilde}5
116+
and will make master{tilde}4 no longer have master{tilde}5 as
117+
a parent (though both the old master{tilde}4 and new
118+
master{tilde}4 will have all the same files). Use
119+
--reference-excluded-parents to instead have the the stream
120+
refer to commits in the excluded range of history by their
121+
sha1sum. Note that the resulting stream can only be used by a
122+
repository which already contains the necessary parent
123+
commits.
124+
125+
--show-original-ids::
126+
Add an extra directive to the output for commits and blobs,
127+
`original-oid <SHA1SUM>`. While such directives will likely be
128+
ignored by importers such as git-fast-import, it may be useful
129+
for intermediary filters (e.g. for rewriting commit messages
130+
which refer to older commits, or for stripping blobs by id).
131+
113132
--refspec::
114133
Apply the specified refspec to each ref exported. Multiple of them can
115134
be specified.
@@ -119,7 +138,9 @@ marks the same across runs.
119138
'git rev-list', that specifies the specific objects and references
120139
to export. For example, `master~10..master` causes the
121140
current master reference to be exported along with all objects
122-
added since its 10th ancestor commit.
141+
added since its 10th ancestor commit and (unless the
142+
--reference-excluded-parents option is specified) all files
143+
common to master{tilde}9 and master{tilde}10.
123144

124145
EXAMPLES
125146
--------

Documentation/git-fast-import.txt

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,10 @@ OPTIONS
4040
not contain the old commit).
4141

4242
--quiet::
43-
Disable all non-fatal output, making fast-import silent when it
44-
is successful. This option disables the output shown by
45-
--stats.
43+
Disable the output shown by --stats, making fast-import usually
44+
be silent when it is successful. However, if the import stream
45+
has directives intended to show user output (e.g. `progress`
46+
directives), the corresponding messages will still be shown.
4647

4748
--stats::
4849
Display some basic statistics about the objects fast-import has
@@ -384,6 +385,7 @@ change to the project.
384385
....
385386
'commit' SP <ref> LF
386387
mark?
388+
original-oid?
387389
('author' (SP <name>)? SP LT <email> GT SP <when> LF)?
388390
'committer' (SP <name>)? SP LT <email> GT SP <when> LF
389391
data
@@ -740,6 +742,19 @@ New marks are created automatically. Existing marks can be moved
740742
to another object simply by reusing the same `<idnum>` in another
741743
`mark` command.
742744

745+
`original-oid`
746+
~~~~~~~~~~~~~~
747+
Provides the name of the object in the original source control system.
748+
fast-import will simply ignore this directive, but filter processes
749+
which operate on and modify the stream before feeding to fast-import
750+
may have uses for this information
751+
752+
....
753+
'original-oid' SP <object-identifier> LF
754+
....
755+
756+
where `<object-identifer>` is any string not containing LF.
757+
743758
`tag`
744759
~~~~~
745760
Creates an annotated tag referring to a specific commit. To create
@@ -748,6 +763,7 @@ lightweight (non-annotated) tags see the `reset` command below.
748763
....
749764
'tag' SP <name> LF
750765
'from' SP <commit-ish> LF
766+
original-oid?
751767
'tagger' (SP <name>)? SP LT <email> GT SP <when> LF
752768
data
753769
....
@@ -822,6 +838,7 @@ assigned mark.
822838
....
823839
'blob' LF
824840
mark?
841+
original-oid?
825842
data
826843
....
827844

0 commit comments

Comments
 (0)