git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: skillzero@gmail.com
To: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Cc: Jakub Narebski <jnareb@gmail.com>,
	Junio C Hamano <gitster@pobox.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: What's cooking in git.git (Oct 2009, #04; Wed, 21)
Date: Thu, 22 Oct 2009 08:31:17 -0700	[thread overview]
Message-ID: <2729632a0910220831x4b67021eg772abc8b751ef7e5@mail.gmail.com> (raw)
In-Reply-To: <fcaeb9bf0910220415v69c22ed9o4ab85b8858fbf187@mail.gmail.com>

On Thu, Oct 22, 2009 at 4:15 AM, Nguyen Thai Ngoc Duy <pclouds@gmail.com> wrote:
> On Thu, Oct 22, 2009 at 3:46 PM, Jakub Narebski <jnareb@gmail.com> wrote:
>> Junio C Hamano <gitster@pobox.com> writes:
>>> * nd/sparse (2009-08-20) 19 commits.
>>>  - sparse checkout: inhibit empty worktree
>>>  - Add tests for sparse checkout
>>>  - read-tree: add --no-sparse-checkout to disable sparse checkout support
>>>  - unpack-trees(): ignore worktree check outside checkout area
>>>  - unpack_trees(): apply $GIT_DIR/info/sparse-checkout to the final index
>>>  - unpack-trees(): "enable" sparse checkout and load $GIT_DIR/info/sparse-checkout
>>>  - unpack-trees.c: generalize verify_* functions
>>>  - unpack-trees(): add CE_WT_REMOVE to remove on worktree alone
>>>  - Introduce "sparse checkout"
>>>  - dir.c: export excluded_1() and add_excludes_from_file_1()
>>>  - excluded_1(): support exclude files in index
>>>  - unpack-trees(): carry skip-worktree bit over in merged_entry()
>>>  - Read .gitignore from index if it is skip-worktree
>>>  - Avoid writing to buffer in add_excludes_from_file_1()
>>>  - Teach Git to respect skip-worktree bit (writing part)
>>>  - Teach Git to respect skip-worktree bit (reading part)
>>>  - Introduce "skip-worktree" bit in index, teach Git to get/set this bit
>>>  - Add test-index-version
>>>  - update-index: refactor mark_valid() in preparation for new options
>>
>> Hmmm... what is happening with that series?
>
> Junio concerned about CE_MATCH_IGNORE_VALID being used by both
> assume-unchanged and skip-worktree bits, which I did not resolve yet.
> I should really get back to the series when I have time.

Just an FYI, but I've been using this series for a while. I'm actually
relying on sparse support in our internal build system (via my private
build with this series) so I hope it doesn't go away :) I haven't
really noticed any problems (I thought the index state got out of sync
once, but I couldn't reproduce the problem later). Here's some
feedback though:

1. I found it confusing to have to append '/' to directories in the
sparse pattern list for directories. I always forget it requires them.
It would be nice to support the same rules as .gitignore in terms of
'/'.

2. It would be nice to have built-in support for a sparse modules file
and switching between them. Maybe .gitmodules could support "module"
or "sparsemodule" sections to list the patterns for that sparse
module. I've written a simple script to do this and it's what I use.
It just parses the INI-style file:

[module "MyProject"]
	App1
	Shared1
	!FolderIDontWant

Then I have a "module" script to read that file for a specified module
and switch to it:

git module switch MyProject

The script just parses `git show HEAD:.gitmodules` (so it works
without a working directory) and switches sparse modules by enabling
sparse, writing info/sparse-checkout, and doing a checkout:

sub cmd_switch
{
	# Enable sparse.
	my $currentCmd = "git config core.sparsecheckout true";
	system( $currentCmd ) == 0 or die( "error: $currentCmd\n" );
	
	# Write sparse patterns.
	my $gitDir = `git rev-parse --git-dir`;
	chop( $gitDir );
	my $sparsePath = $gitDir . "/info/sparse-checkout";
	if( $? != 0 ) { die( "error: read git directory failed $?\n" ); }
	open( FILE, ">", $sparsePath ) or die( "error: can't open '$sparsePath'\n" );
	foreach( @{$gModules->{$gModuleName}} )
	{
		print( FILE "$_\n" );
	}
	close( FILE );
	
	# Checkout using new sparse patterns.
	system( "git checkout" ) == 0 or die( "error: switch module failed\n" );
}

That said, the current level of sparse support provided by this series
is good enough for me because I can build my own scripts like this on
top of it to automate things.

  reply	other threads:[~2009-10-22 15:31 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-10-22  6:52 What's cooking in git.git (Oct 2009, #04; Wed, 21) Junio C Hamano
2009-10-22  8:34 ` ks/precompute-completion (was Re: What's cooking in git.git (Oct 2009, #04; Wed, 21)) Stephen Boyd
2009-10-22 17:11   ` Sverre Rabbelier
2009-10-22 18:56     ` Stephen Boyd
2009-10-22 22:20     ` A Large Angry SCM
     [not found]       ` <fabb9a1e0910221555k287b45ebwb15ac97851b845f9@mail.gmail.com>
     [not found]         ` <fabb9a1e0910221556s694a344ag8e5ae07c35351ee4@mail.gmail.com>
2009-10-22 23:05           ` A Large Angry SCM
2009-10-23 18:27             ` Sverre Rabbelier
2009-10-23 18:59               ` ks/precompute-completion Junio C Hamano
2009-10-23 19:16                 ` ks/precompute-completion Sverre Rabbelier
2009-10-23 20:05                   ` ks/precompute-completion Junio C Hamano
2009-10-23 20:09                     ` ks/precompute-completion Sverre Rabbelier
2009-10-23 20:20                     ` ks/precompute-completion Jakub Narebski
2009-10-23 20:22                       ` ks/precompute-completion Sverre Rabbelier
2009-10-23 22:29                         ` ks/precompute-completion A Large Angry SCM
2009-10-23 22:39                           ` ks/precompute-completion Sverre Rabbelier
2009-10-22 23:07       ` ks/precompute-completion (was Re: What's cooking in git.git (Oct 2009, #04; Wed, 21)) Johannes Schindelin
2009-10-22  8:46 ` What's cooking in git.git (Oct 2009, #04; Wed, 21) Jakub Narebski
2009-10-22 11:15   ` Nguyen Thai Ngoc Duy
2009-10-22 15:31     ` skillzero [this message]
2009-10-22 21:42       ` Junio C Hamano
2009-10-22 19:01   ` Stephen Boyd
2009-10-24  6:45   ` Junio C Hamano
2009-10-23 11:25 ` [PATCH] add tests for git diff --submodule Jens Lehmann
2009-10-24 19:25   ` Junio C Hamano
2009-10-25 16:02 ` What's cooking in git.git (Oct 2009, #04; Wed, 21) Clemens Buchacher
2009-10-26  7:14   ` Junio C Hamano
2009-10-26  8:29     ` Clemens Buchacher
2009-10-26  9:01       ` Stephen Boyd
2009-10-26 10:07         ` Clemens Buchacher
2009-10-27 18:27 ` vl/git-gui topic Shawn O. Pearce
2009-10-28  7:17   ` Junio C Hamano
2009-10-27 18:37 ` jp/dirty-describe topic Shawn O. Pearce
2009-10-28 14:47 ` sp/smart-http topic Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2729632a0910220831x4b67021eg772abc8b751ef7e5@mail.gmail.com \
    --to=skillzero@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=jnareb@gmail.com \
    --cc=pclouds@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).