diff options
author | Shawn O. Pearce <spearce@spearce.org> | 2007-02-07 10:03:03 +0300 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2007-02-07 10:03:03 +0300 |
commit | 825769a8fe4d0529268fee7e763bc8f24ed4218e (patch) | |
tree | 8c8c4db7fbec5d41065d8ecaece4b6dd8d97347a /Documentation | |
parent | 9b92c82fde2dc42e5ec3240e673549418b88163e (diff) |
Teach fast-import how to clear the internal branch content.
Some frontends may not be able to (easily) keep track of which files
are included in the branch, and which aren't. Performing this
tracking can be tedious and error prone for the frontend to do,
especially if its foreign data source cannot supply the changed
path list on a per-commit basis.
fast-import now allows a frontend to request that a branch's tree
be wiped clean (reset to the empty tree) at the start of a commit,
allowing the frontend to feed in all paths which belong on the branch.
This is ideal for a tar-file importer frontend, for example, as
the frontend just needs to reformat the tar data stream into a gfi
data stream, which may be something a few Perl regexps can take
care of. :)
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/git-fast-import.txt | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/Documentation/git-fast-import.txt b/Documentation/git-fast-import.txt index aeddd5e284..8bb5a0b36b 100644 --- a/Documentation/git-fast-import.txt +++ b/Documentation/git-fast-import.txt @@ -269,7 +269,7 @@ change to the project. data ('from' SP <committish> LF)? ('merge' SP <committish> LF)? - (filemodify | filedelete)* + (filemodify | filedelete | filedeleteall)* LF .... @@ -292,10 +292,12 @@ commit message use a 0 length data. Commit messages are free-form and are not interpreted by Git. Currently they must be encoded in UTF-8, as gfi does not permit other encodings to be specified. -Zero or more `filemodify` and `filedelete` commands may be -included to update the contents of the branch prior to the commit. -These commands can be supplied in any order, gfi is not sensitive -to pathname or operation ordering. +Zero or more `filemodify`, `filedelete` and `filedeleteall` commands +may be included to update the contents of the branch prior to +creating the commit. These commands may be supplied in any order. +However it is recommended that a `filedeleteall` command preceed +all `filemodify` commands in the same commit, as `filedeleteall` +wipes the branch clean (see below). `author` ^^^^^^^^ @@ -459,6 +461,30 @@ first non-empty directory or the root is reached. here `<path>` is the complete path of the file to be removed. See `filemodify` above for a detailed description of `<path>`. +`filedeleteall` +^^^^^^^^^^^^^^^ +Included in a `commit` command to remove all files (and also all +directories) from the branch. This command resets the internal +branch structure to have no files in it, allowing the frontend +to subsequently add all interesting files from scratch. + +.... + 'deleteall' LF +.... + +This command is extremely useful if the frontend does not know +(or does not care to know) what files are currently on the branch, +and therefore cannot generate the proper `filedelete` commands to +update the content. + +Issuing a `filedeleteall` followed by the needed `filemodify` +commands to set the correct content will produce the same results +as sending only the needed `filemodify` and `filedelete` commands. +The `filedeleteall` approach may however require gfi to use slightly +more memory per active branch (less than 1 MiB for even most large +projects); so frontends that can easily obtain only the affected +paths for a commit are encouraged to do so. + `mark` ~~~~~~ Arranges for gfi to save a reference to the current object, allowing |