Skip to content

Subtree checkout 1/2: introduce index prefix

Nguyễn Thái Ngọc Duy git 1 version In review

Get series with b4
b4 am 20080604162748.GA23975@laptop

Versions newest first

  1. v1 Latest2 patches 25 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2This patch was inspired by ClearCase command 'ct man', whichDocumentation/config.txt Documentation/git.txt Makefile +6 more+212 -61 reply
1/2Move all dashed-form commands to libexecdirMakefile check_bindir config.mak.in +1 more+23 -80 replies
1/2Introduce GIT_INDEX_PREFIXbuiltin-merge-recursive.c builtin-read-tree.c builtin-rev-parse.c +6 more+117 -44 replies
1/2init: support --import to add all files and commit right after initDocumentation/git-init.txt builtin-init-db.c t/t0001-init.sh+105 -513 replies
1/2init: support --import to add all files and commit right after initDocumentation/git-init.txt builtin-init-db.c t/t0001-init.sh+101 -51 reply
1/2setup.c: add enter_work_tree()cache.h setup.c+8 -00 replies
2/2Add rule install-html to install html files to $(html_dir)Documentation/Makefile+3 -00 replies
2/2Link porcelain commands from gitexecdir to bindirMakefile git.spec.in+21 -01 reply
2/2Add tests for index prefixt/t2300-index-prefix.sh t/t2301-index-prefix-merge-recursive.sh+428 -00 replies
2/2init: support --fast-import using "git fast-import" as backendbuiltin-init-db.c+105 -30 replies
2/2worktree: provide better prefix to go back to original cwdbuiltin/rev-parse.c cache.h setup.c +1 more+179 -45 replies
2/2Kill off get_relative_cwd()dir.c dir.h+6 -500 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [WIP/RFC PATCH 0/2] Subtree checkout 1/2: introduce index prefix

This is the first part for subtree checkout: restrict write access to index. The second part would be restrict/adjust access to working directory so that it only needs part of full working directory to work on. I would like to hear comments from people before heading to part 2.

As I understand, the hardest part is probably merging. My strategy is quite simple: allow merge as long as no conflicts are outside index prefix.

While it is done as part of subtree checkout. I think it can be also used as a separate feature: working on a worktree where only a subtree is to be worked on. One example is gentoo-x86 repository (~80k files). I only work on a tree of dozen of files, but every time I do "git status", ~100k stats will be issued. With this, it can be reduced to about 20 stats.

So back to the topic. Is the approach broken? Do I miss anything that can write outside index prefix? What else needs more test case?

Thanks

Nguyễn Thái Ngọc Duy (2):
Introduce GIT_INDEX_PREFIX
Add tests for index prefix

 builtin-merge-recursive.c               |    4 +-
 builtin-read-tree.c                     |    5 +
 builtin-rev-parse.c                     |    5 +
 builtin-update-index.c                  |    3 +
 cache.h                                 |    2 +
 environment.c                           |   12 ++
 read-cache.c                            |   84 ++++++++++++-
 t/t2300-index-prefix.sh                 |  207 +++++++++++++++++++++++++++++
 t/t2301-index-prefix-merge-recursive.sh |  221 +++++++++++++++++++++++++++++++
 unpack-trees.c                          |    3 +
 unpack-trees.h                          |    3 +-
 11 files changed, 545 insertions(+), 4 deletions(-)
 create mode 100755 t/t2300-index-prefix.sh
 create mode 100755 t/t2301-index-prefix-merge-recursive.sh