git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Junio C Hamano <gitster@pobox.com>,
	Nguyen Thai Ngoc Duy <pclouds@gmail.com>,
	git@vger.kernel.org
Subject: Re: [RFC PATCH v3 8/8] --sparse for porcelains
Date: Mon, 17 Aug 2009 18:01:58 +0200	[thread overview]
Message-ID: <200908171802.00588.jnareb@gmail.com> (raw)
In-Reply-To: <alpine.DEB.1.00.0908161002460.8306@pacific.mpi-cbg.de>

On Sun, 16 Aug 2009, Johannes Schindelin wrote:
> On Sun, 16 Aug 2009, Jakub Narebski wrote:
>> On Sat, 15 Aug 2009, Junio C Hamano wrote:
>>> Jakub Narebski <jnareb@gmail.com> writes:
>>> 
>>>>>> Hmmm... this looks like either argument for introducing --full 
>>>>>> option to git-checkout (ignore CE_VALID bit, checkout everything, 
>>>>>> and clean CE_VALID (?))...
>>>>>>
>>>>>>  ...or for going with _separate_ bit for partial checkout, like in 
>>>>>>  the very first version of this series, which otherwise functions 
>>>>>>  like CE_VALID, or is just used to mark that CE_VALID was set using 
>>>>>>  sparse.
>>> 
>>> How would a separate bit help?  Just like you need to clear CE_VALID 
>>> bit to revert the index into a normal (or "non sparse") state somehow, 
>>> you would need to have a way to clear that separate bit anyway.
>>> 
>>> A separate bit would help only if you want to handle assume-unchanged 
>>> and sparse checkout independently. But my impression was that the 
>>> recent lstat reduction effort addressed the issue assume-unchanged 
>>> were invented to work around in the first place.
>> 
>> Well, if we assume that we don't need (don't want) to handle 
>> assume-unchanged and sparse checkout independently, then of course the 
>> idea of having separate or additional bit for sparse doesn't make sense.
> 
> For the shallow/graft issue, we had a similar discussion.  Back then, I 
> was convinced that shallow commits and grafted commits were something 
> fundamentally different, and my recent patch to pack-objects shows that: 
> shallow commits do not have the real parents in the current repository, 
> and that makes them different from other grafted commits.
> 
> Now, if you want to say that assume-unchanged and sparse are two 
> fundamentally different things, I would be interested in some equally 
> convincing argument as for the shallow/graft issue.
> 
> There is a fundamental difference, I grant you that: the working directory 
> does not contain the "sparse'd away" files while the same is not true for 
> assume-unchanged files.
> 
> But does that matter?  The corresponding files are still in the index and 
> the repository.
> 
> IOW under what circumstances would you want to be able to discern between 
> assume-unchanged and "sparse'd away" files in the working directory?

>From what I understand it, assume-unchanged is performance optimization.
Sparse checkout is about files which are (assumed to) not be in working
directory, which means that they have to be assume-unchanged for git to
not try to access working area version of files which aren't there.

$GIT_DIR/info/sparse (or how it would be named; the name 'sparse' 
doesn't tell us whether patterns are about the files that are checked
out, or are about files which are not present in working directory)
is about specifying which files to checkout with "git checkout --sparse"
(or core.sparse / checkout.sparse = true).

> I could _imagine_ that you'd want a tool that allows you to change the 
> focus of the sparse checkout together with the working directory.  
> Example: you have a sparse checkout of Documentation/ and now you want to 
> have t/, too.  Just changing .git/info/sparse will not be enough.
> 
> The question is if the tool to change the "sparseness" [*1*] should not 
> change .git/info/sparse itself; if it does not, it would be good to be 
> able to discern between the "assume-unchanged" and "sparse'd away" files.
> 
> Although it might be enough to traverse the index and check the presence 
> of the assume-unchanged files in the working directory to determine which 
> files are sparse, and which ones are merely assume-unchanged.

There are quite a few possibilities: file can be marked "sparse" in
index (which also implies also marking it "assume-unchanged", if 
"assume-unchanged" doesn't work alone as "sparse" index bit) or not,
file can match 'no-checkout' pattern in $GIT_DIR/info/sparse or not,
file can be present in working directory or not:

 * match no-checkout
   - assume-unchanged
     + present in working directory
     + absent from working directory
   - no assume-unchanged
     + present
     + absent
 * doesn't match no-checkout
   - assume-unchanged
     + present
     + absent
   - no assume-unchanged
     + present
     + absent

> Footnote [*1*]: I think we need some nice and clear nomenclature here.  
> Any English wizards with a good taste of naming things?
 
English is not my native language, but what about:

 $GIT_DIR/info/
    no-checkout
    exclude-checkout
    workdir-exclude
    ignore-change
    assume-unchanged
    ghosts
  
-- 
Jakub Narebski
Poland

  parent reply	other threads:[~2009-08-17 15:55 UTC|newest]

Thread overview: 53+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-11 15:43 [RFC PATCH v3 0/8] Sparse checkout Nguyễn Thái Ngọc Duy
2009-08-11 15:43 ` [RFC PATCH v3 1/8] Prevent diff machinery from examining assume-unchanged entries on worktree Nguyễn Thái Ngọc Duy
2009-08-11 15:44   ` [RFC PATCH v3 2/8] Avoid writing to buffer in add_excludes_from_file_1() Nguyễn Thái Ngọc Duy
2009-08-11 15:44     ` [RFC PATCH v3 3/8] Read .gitignore from index if it is assume-unchanged Nguyễn Thái Ngọc Duy
2009-08-11 15:44       ` [RFC PATCH v3 4/8] excluded_1(): support exclude "directories" in index Nguyễn Thái Ngọc Duy
2009-08-11 15:44         ` [RFC PATCH v3 5/8] dir.c: export excluded_1() and add_excludes_from_file_1() Nguyễn Thái Ngọc Duy
2009-08-11 15:44           ` [RFC PATCH v3 6/8] unpack-trees.c: generalize verify_* functions Nguyễn Thái Ngọc Duy
2009-08-11 15:44             ` [RFC PATCH v3 7/8] Support sparse checkout in unpack_trees() and read-tree Nguyễn Thái Ngọc Duy
2009-08-11 15:44               ` [RFC PATCH v3 8/8] --sparse for porcelains Nguyễn Thái Ngọc Duy
2009-08-12  6:33                 ` Junio C Hamano
2009-08-12 10:01                   ` Nguyen Thai Ngoc Duy
2009-08-13  7:20                   ` Nguyen Thai Ngoc Duy
2009-08-13  9:58                     ` Jakub Narebski
2009-08-13 12:38                       ` Nguyen Thai Ngoc Duy
2009-08-14 20:23                         ` Jakub Narebski
2009-08-15  2:01                           ` Junio C Hamano
2009-08-15 23:37                             ` Jakub Narebski
2009-08-16  8:14                               ` Johannes Schindelin
2009-08-17  9:08                                 ` Johannes Schindelin
2009-08-17 12:49                                   ` Nguyen Thai Ngoc Duy
2009-08-17 13:35                                     ` Johannes Schindelin
2009-08-17 14:41                                       ` Nguyen Thai Ngoc Duy
2009-08-17 15:19                                         ` Johannes Schindelin
2009-08-17 16:13                                           ` Nguyen Thai Ngoc Duy
2009-08-17 15:41                                   ` Junio C Hamano
2009-08-17 16:06                                     ` Nguyen Thai Ngoc Duy
2009-08-17 16:19                                     ` Johannes Schindelin
2009-08-17 18:39                                       ` Junio C Hamano
2009-08-17 22:02                                         ` Johannes Schindelin
2009-08-17 23:02                                           ` skillzero
2009-08-17 23:16                                             ` Johannes Schindelin
2009-08-18  0:17                                               ` Jakub Narebski
2009-08-18  0:34                                                 ` skillzero
2009-08-18  1:43                                                   ` Nguyen Thai Ngoc Duy
2009-08-18  6:25                                                     ` git find (was: [RFC PATCH v3 8/8] --sparse for porcelains) Jakub Narebski
2009-08-18 14:35                                                       ` Nguyen Thai Ngoc Duy
2009-08-18 16:00                                                         ` Jakub Narebski
2009-08-18  0:49                                                 ` [RFC PATCH v3 8/8] --sparse for porcelains Jakub Narebski
2009-08-18  0:23                                               ` skillzero
2009-08-17 16:46                                     ` Junio C Hamano
2009-08-17 21:45                                       ` Johannes Schindelin
2009-08-17 16:01                                 ` Jakub Narebski [this message]
2009-08-12  7:31                 ` Johannes Sixt
2009-08-12  9:53                   ` Nguyen Thai Ngoc Duy
2009-08-12 15:40                     ` Raja R Harinath
2009-08-13  7:37                       ` Johannes Sixt
2009-08-11 21:18               ` [RFC PATCH v3 7/8] Support sparse checkout in unpack_trees() and read-tree skillzero
2009-08-11 21:38                 ` Jakub Narebski
2009-08-11 22:03                   ` skillzero
2009-08-12  1:30                     ` Nguyen Thai Ngoc Duy
2009-08-12  4:59                       ` skillzero
2009-08-12  2:51       ` [RFC PATCH v3 3/8] Read .gitignore from index if it is assume-unchanged Junio C Hamano
2009-08-13  6:37         ` Nguyen Thai Ngoc Duy

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=200908171802.00588.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).