All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Nieder <jrnieder@gmail.com>
To: Duy Nguyen <pclouds@gmail.com>
Cc: git@vger.kernel.org, kirill.mueller@ivt.baug.ethz.ch
Subject: Re: [PATCH] checkout: add --sparse for restoring files in sparse checkout mode
Date: Sun, 24 Mar 2013 18:57:17 -0700	[thread overview]
Message-ID: <20130325015717.GA3542@elie.Belkin> (raw)
In-Reply-To: <CACsJy8ByH8U0wYuaKaMKd3bauLBbS52peMs1eiGz++2vj2JKTA@mail.gmail.com>

Duy Nguyen wrote:
> On Mon, Mar 25, 2013 at 1:17 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:

>> Hm, should this be the default?
>>
>> In principle, I would expect
>>
>>         git checkout -- .
>>
>> to make the worktree match the index, respecting the sparse checkout.
>> And something like
>>
>>         git checkout --widen -- .
>>
>> to change the sparse checkout pattern.
[...]
> Changing the default may involve a painful transition phase (e.g. "add
> -u").

I don't think it needs to.  There aren't many people using sparse
checkout even these days, and I think they'd generally be happy about
the change.

But if we want to be conservative until some later point (like 2.1),
perhaps --sparse should be named something like --no-widen?  That
way, I can do

	git checkout --no-widen -- .

to make the worktree match the index, respecting the sparse checkout.
And I can do

	git checkout --widen -- .

to change the sparse checkout pattern.  Meanwhile the confusing
command

	git checkout -- .

would be ill-defined for sparse checkouts --- in past git versions,
if I understand you correctly it acted like --widen, while in some
unspecified future version it may change to mean --no-widen.  No
need for warnings because I doubt anyone is relying on either
behavior.

Would that work?
Jonathan

  reply	other threads:[~2013-03-25  1:58 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-22 10:28 Hard reset of a subdirectory in a sparse checkout setting Kirill Müller
2013-03-23  9:59 ` Duy Nguyen
2013-03-23 13:02   ` Kirill Müller
2013-03-24  5:06 ` [PATCH] checkout: add --sparse for restoring files in sparse checkout mode Nguyễn Thái Ngọc Duy
2013-03-24  6:12   ` Eric Sunshine
2013-03-24 18:17   ` Jonathan Nieder
2013-03-24 19:50     ` Kirill Müller
2013-03-25  1:34     ` Duy Nguyen
2013-03-25  1:57       ` Jonathan Nieder [this message]
2013-03-30 10:02   ` [PATCH v2] checkout: add --no-widen " Nguyễn Thái Ngọc Duy
2013-04-01  4:48     ` Jonathan Nieder
2013-04-01  5:12       ` Junio C Hamano
2013-04-01  5:13       ` Duy Nguyen
2013-04-01  6:18         ` Jonathan Nieder
2013-04-12 23:12     ` [PATCH v3] checkout: add --ignore-skip-worktree-bits " Nguyễn Thái Ngọc Duy
2013-05-14  9:27       ` Müller  Kirill
2013-05-14 10:21         ` Duy Nguyen

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=20130325015717.GA3542@elie.Belkin \
    --to=jrnieder@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kirill.mueller@ivt.baug.ethz.ch \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.