1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-11-19 23:44:50 +01:00
git/Documentation
David Barr 8dc6a373d2 fast-import: add 'ls' command
Lazy fast-import frontend authors that want to rely on the backend to
keep track of the content of the imported trees _almost_ have what
they need in the 'cat-blob' command (v1.7.4-rc0~30^2~3, 2010-11-28).
But it is not quite enough, since

 (1) cat-blob can be used to retrieve the content of files, but
     not their mode, and

 (2) using cat-blob requires the frontend to keep track of a name
     (mark number or object id) for each blob to be retrieved

Introduce an 'ls' command to complement cat-blob and take care of the
remaining needs.  The 'ls' command finds what is at a given path
within a given tree-ish (tag, commit, or tree):

	'ls' SP <dataref> SP <path> LF

or in fast-import's active commit:

	'ls' SP <path> LF

The response is a single line sent through the cat-blob channel,
imitating ls-tree output.  So for example:

	FE> ls :1 Documentation
	gfi> 040000 tree 9e6c2b599341d28a2a375f8207507e0a2a627fe9	Documentation
	FE> ls 9e6c2b599341d28a2a375f8207507e0a2a627fe9 git-fast-import.txt
	gfi> 100644 blob 4f92954396e3f0f97e75b6838a5635b583708870	git-fast-import.txt
	FE> ls :1 RelNotes
	gfi> 120000 blob b942e49944	RelNotes
	FE> cat-blob b942e49944
	gfi> b942e49944 blob 32
	gfi> Documentation/RelNotes/1.7.4.txt

The most interesting parts of the reply are the first word, which is
a 6-digit octal mode (regular file, executable, symlink, directory,
or submodule), and the part from the second space to the tab, which is
a <dataref> that can be used in later cat-blob, ls, and filemodify (M)
commands to refer to the content (blob, tree, or commit) at that path.

If there is nothing there, the response is "missing some/path".

The intent is for this command to be used to read files from the
active commit, so a frontend can apply patches to them, and to copy
files and directories from previous revisions.

For example, proposed updates to svn-fe use this command in place of
its internal representation of the repository directory structure.
This simplifies the frontend a great deal and means support for
resuming an import in a separate fast-import run (i.e., incremental
import) is basically free.

Signed-off-by: David Barr <david.barr@cordelta.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Improved-by: Junio C Hamano <gitster@pobox.com>
Improved-by: Sverre Rabbelier <srabbelier@gmail.com>
2011-02-26 04:57:58 -06:00
..
howto Documentation/merge subtree How-To: fix typo 2011-02-09 14:03:51 -08:00
pt_BR
RelNotes Git 1.7.4.1 2011-02-11 14:39:55 -08:00
technical Fix typos in the documentation 2011-01-04 11:23:42 -08:00
.gitattributes
.gitignore
asciidoc.conf
blame-options.txt
build-docdep.perl
cat-texi.perl
cmd-list.perl
CodingGuidelines Fix typos in the documentation 2011-01-04 11:23:42 -08:00
config.txt Documentation updates for 'GIT_WORK_TREE without GIT_DIR' historical usecase 2011-01-24 10:13:59 -08:00
date-formats.txt
diff-format.txt
diff-generate-patch.txt
diff-options.txt diff: use "find" instead of "detect" as prefix for long forms of -M and -C 2010-12-10 13:52:05 -08:00
docbook-xsl.css
docbook.xsl
everyday.txt
fetch-options.txt pull: Document the "--[no-]recurse-submodules" options 2011-02-07 15:19:09 -08:00
fix-texi.perl
git-add.txt Fix typos in the documentation 2011-01-04 11:23:42 -08:00
git-am.txt
git-annotate.txt
git-apply.txt
git-archimport.txt
git-archive.txt Merge branch 'maint-1.7.2' into maint 2011-01-10 10:39:28 -08:00
git-bisect-lk2009.txt
git-bisect.txt
git-blame.txt
git-branch.txt
git-bundle.txt Fix typos in the documentation 2011-01-04 11:23:42 -08:00
git-cat-file.txt
git-check-attr.txt
git-check-ref-format.txt
git-checkout-index.txt
git-checkout.txt
git-cherry-pick.txt cherry-pick/revert: add support for -X/--strategy-option 2010-12-28 11:27:56 -08:00
git-cherry.txt
git-citool.txt
git-clean.txt
git-clone.txt Merge branch 'jl/clone-recurse-sm-synonym' 2010-11-29 17:52:34 -08:00
git-commit-tree.txt
git-commit.txt Documentation: clarify -u<mode> option defaults 2011-02-21 21:48:55 -08:00
git-config.txt
git-count-objects.txt
git-cvsexportcommit.txt
git-cvsimport.txt
git-cvsserver.txt
git-daemon.txt
git-describe.txt
git-diff-files.txt
git-diff-index.txt
git-diff-tree.txt
git-diff.txt diff: support --cached on unborn branches 2011-02-07 15:04:30 -08:00
git-difftool.txt Merge branch 'maint' 2010-12-16 16:36:03 -08:00
git-fast-export.txt
git-fast-import.txt fast-import: add 'ls' command 2011-02-26 04:57:58 -06:00
git-fetch-pack.txt
git-fetch.txt
git-filter-branch.txt
git-fmt-merge-msg.txt Fix typos in the documentation 2011-01-04 11:23:42 -08:00
git-for-each-ref.txt
git-format-patch.txt
git-fsck-objects.txt
git-fsck.txt fsck docs: remove outdated and useless diagnostic 2010-12-18 22:58:40 -08:00
git-gc.txt Merge branch 'maint' 2010-12-19 17:49:42 -08:00
git-get-tar-commit-id.txt
git-grep.txt
git-gui.txt
git-hash-object.txt
git-help.txt
git-http-backend.txt
git-http-fetch.txt
git-http-push.txt
git-imap-send.txt
git-index-pack.txt
git-init-db.txt
git-init.txt
git-instaweb.txt
git-log.txt
git-lost-found.txt
git-ls-files.txt
git-ls-remote.txt
git-ls-tree.txt
git-mailinfo.txt
git-mailsplit.txt
git-merge-base.txt
git-merge-file.txt
git-merge-index.txt
git-merge-one-file.txt
git-merge-tree.txt
git-merge.txt Merge branch 'jh/notes-merge' 2010-12-08 11:24:12 -08:00
git-mergetool--lib.txt
git-mergetool.txt
git-mktag.txt
git-mktree.txt
git-mv.txt
git-name-rev.txt
git-notes.txt Provide 'git notes get-ref' to easily retrieve current notes ref 2010-11-17 13:23:55 -08:00
git-pack-objects.txt
git-pack-redundant.txt
git-pack-refs.txt
git-parse-remote.txt
git-patch-id.txt
git-peek-remote.txt
git-prune-packed.txt
git-prune.txt
git-pull.txt pull: Document the "--[no-]recurse-submodules" options 2011-02-07 15:19:09 -08:00
git-push.txt
git-quiltimport.txt
git-read-tree.txt Merge branch 'nd/maint-fix-add-typo-detection' 2010-12-22 14:40:26 -08:00
git-rebase.txt rebase: support --verify 2010-11-23 12:15:43 -08:00
git-receive-pack.txt
git-reflog.txt
git-relink.txt
git-remote-ext.txt Fix typos in the documentation 2011-01-04 11:23:42 -08:00
git-remote-fd.txt Fix typos in the documentation 2011-01-04 11:23:42 -08:00
git-remote-helpers.txt
git-remote.txt
git-repack.txt Merge branch 'jk/repack-reuse-object' into maint 2010-11-24 12:45:07 -08:00
git-replace.txt
git-repo-config.txt
git-request-pull.txt
git-rerere.txt
git-reset.txt Documentation: do not treat reset --keep as a special case 2011-01-21 12:41:14 -08:00
git-rev-list.txt
git-rev-parse.txt git-rev-parse.txt: clarify --git-dir 2010-11-29 13:26:00 -08:00
git-revert.txt cherry-pick/revert: add support for -X/--strategy-option 2010-12-28 11:27:56 -08:00
git-rm.txt git-rm.txt: Fix quoting 2010-12-07 13:13:21 -08:00
git-send-email.txt Merge branch 'maint' 2010-12-10 16:36:53 -08:00
git-send-pack.txt
git-sh-setup.txt
git-shell.txt
git-shortlog.txt
git-show-branch.txt
git-show-index.txt
git-show-ref.txt
git-show.txt
git-stage.txt
git-stash.txt
git-status.txt Documentation: clarify -u<mode> option defaults 2011-02-21 21:48:55 -08:00
git-stripspace.txt
git-submodule.txt
git-svn.txt git svn: fix the final example in man page 2011-01-07 21:50:11 +00:00
git-symbolic-ref.txt
git-tag.txt git-tag.txt: list all modes in the description 2011-02-15 10:51:08 -08:00
git-tar-tree.txt
git-tools.txt
git-unpack-file.txt
git-unpack-objects.txt
git-update-index.txt
git-update-ref.txt
git-update-server-info.txt
git-upload-archive.txt
git-upload-pack.txt
git-var.txt
git-verify-pack.txt
git-verify-tag.txt verify-tag: document --verbose 2010-11-15 10:05:54 -08:00
git-web--browse.txt web--browse: better support for chromium 2010-12-03 14:05:32 -08:00
git-whatchanged.txt
git-write-tree.txt
git.txt Git 1.7.4.1 2011-02-11 14:39:55 -08:00
gitattributes.txt Merge branch 'jn/perl-funcname' 2011-01-13 11:38:05 -08:00
gitcli.txt
gitcore-tutorial.txt
gitcvs-migration.txt
gitdiffcore.txt
gitglossary.txt
githooks.txt Documentation/githooks: post-rewrite-copy-notes never existed 2011-01-10 09:09:02 -08:00
gitignore.txt Documentation: point to related commands from gitignore 2010-11-11 10:57:16 -08:00
gitk.txt
gitmodules.txt Fix typos in the documentation 2011-01-04 11:23:42 -08:00
gitrepository-layout.txt
gitrevisions.txt
gittutorial-2.txt
gittutorial.txt
gitworkflows.txt
glossary-content.txt
howto-index.sh
i18n.txt
install-doc-quick.sh
install-webdoc.sh
mailmap.txt
Makefile docs: default to more modern toolset 2010-11-24 15:13:58 -08:00
manpage-1.72.xsl
manpage-base-url.xsl.in
manpage-base.xsl
manpage-bold-literal.xsl
manpage-normal.xsl
manpage-quote-apos.xsl
manpage-suppress-sp.xsl
merge-config.txt Fix typos in the documentation 2011-01-04 11:23:42 -08:00
merge-options.txt
merge-strategies.txt
pretty-formats.txt
pretty-options.txt
pull-fetch-param.txt
rev-list-options.txt Merge branch 'mm/phrase-remote-tracking' 2010-11-24 15:55:05 -08:00
revisions.txt Merge branch 'nd/oneline-sha1-name-from-specific-ref' 2010-12-21 14:30:19 -08:00
SubmittingPatches
urls-remotes.txt
urls.txt
user-manual.conf
user-manual.txt