git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-subtree: Add prune mode

From
SBSanti Béjar <santi@agolina.net>
Date
Aug 2, 2010, 16:02 UTC
Message-ID
<AANLkTinR1OSt-3O4FQ8QBMm60LFZ_jU8u6mzenZdCDTd@mail.gmail.com>
In-Reply-To
<AANLkTi=U2=ZYXnxW3GVteB9GtxFP41GRzcTejzLE2S8w@mail.gmail.com>
On Mon, Aug 2, 2010 at 12:41 PM, Santi Béjar <santi@agolina.net> wrote:
Show 32 quoted lines
> On Mon, Aug 2, 2010 at 4:54 AM, Avery Pennarun <apenwarr@gmail.com> wrote:
>> On Sun, Aug 1, 2010 at 5:25 AM, Santi Béjar <santi@agolina.net> wrote:
>>> Add prune mode (flag --prune) with the following properties:
>>>
>>> * The history must be as clean as possible
>>> * The directory content must be equal to the external module,
>>>  at least when you add/update it[b]
>>> * The subproject should be able to switch back and forth between
>>>  different versions.
>>>
>>> [b] A consequence of this is that it loses all changes
>>>    made in the subtree. If they are important you have to extract
>>>    them, apply them and add the subproject back.
>>
>> I think I started to reply to this before but I can't quite remember
>> what happened.  Anyway, I have several concerns with this patch:
>>
>> - calling it "prune" is pretty incorrect.  It doesn't remove anything
>> from your history.
>
> It removes the history of the subproject.
> And --squash does not squash your history. We are talking about the
> subproject, not the superproject.
>
>>  It silently loses patches from your tree, but
>> that's not "pruning" really.  I suggest "--squash
>> --discard-local-changes" or something.  ie. it's a variant of squash,
>> and it throws things away.  We want both of those to be clear.
>
> It's not a variant of squash, it is completely different, but it
> shares some properties. One tries to keep your local changes, the
> other no.

I just wanted to add one thing. For me "--squash --discard-local-changes" would be something like --squash but with "git merge -s theirs", so totally different from the --prune mode. I cannot be a flag to --squash.

I'm open to discuss the name of the flag, but for now I found --prune the best one. And as it is only used with "git subtree add" I don't think it should be about "discard local changes".

Have fun, Santi

Previous: Santi Béjar
Message 4 of 4 in “git-subtree: Add prune mode”
  1. git-subtree: Add prune modeSanti Béjar, Aug 1, 2010
  2. Avery PennarunAug 2, 2010
  3. Santi BéjarAug 2, 2010
  4. Santi BéjarAug 2, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.