git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Catalin Marinas" <catalin.marinas@gmail.com>
To: "Karl Hasselström" <kha@treskal.com>
Cc: git@vger.kernel.org
Subject: Re: [StGit PATCH 03/14] Write to a stack log when stack is modified
Date: Fri, 20 Jun 2008 10:14:29 +0100	[thread overview]
Message-ID: <b0943d9e0806200214j77aef272sc5cfb98b002cae22@mail.gmail.com> (raw)
In-Reply-To: <20080619100722.GB14415@diana.vm.bytemark.co.uk>

2008/6/19 Karl Hasselström <kha@treskal.com>:
> On 2008-06-19 10:24:28 +0100, Catalin Marinas wrote:
>
>> 2008/6/18 Karl Hasselström <kha@treskal.com>:
>>
>> > On 2008-06-18 17:16:10 +0100, Catalin Marinas wrote:
>> > > Making the first log entry special gets difficult with log
>> > > pruning (unless you prune the whole log rather than entries
>> > > older than a chosen time or number) since you might have to
>> > > re-create all the chained log entries as the first log's sha1
>> > > will probably change.
>> >
>> > You have to re-create all the commits anyway, since they all are
>> > immutable, and all have a back pointer.
>>
>> Ah, OK. So, at least initially, we should only support the full log
>> pruning.
>
> How do you imagine we'd do anything except a "full" pruning? There are
> grafts and shallow clones, I guess, but both of them have drawbacks.

Recreate the log but we I wouldn't spend time on this.

>> > > The applied patches are chained automatically via HEAD. For
>> > > unapplied patches, we could add the correponding commits as
>> > > parents of the logging commit (starting with the third parent as
>> > > the first two are used for log chaining and applied patches). Do
>> > > we hit any OS limit with the number of arguments?
>> >
>> > Not until long after we hit git limits to the number of parents of
>> > a commit. I believe the octopus merge refuses to create merges
>> > with more than about 25 parents, and we probably shouldn't do more
>> > than that either. We'll have to do a tree of octopuses.
>>
>> For the first log only, we could chain the unapplied patches using
>> commits with 2 parents. We just need to warn people not to stare at
>> the <branch>.stgit directly :-)
>
> We could make chains (or trees) of 16-parent commits -- that'd speed
> it up by a factor of 15. :-)

Yes, good idea.

>> >  * Parents: the previous log entry; branch head; something that
>> >    (recusively) points to all unapplied commits, if necessary.
>>
>> As you pointed below, "branch head" should probably be the "stack
>> top". We don't need to track the "branch head" if different, just
>> need to fix up the error and add the patches to the stack. And,
>> anyway, if one modifies the HEAD using git directly, the log will
>> still point to the top of the stack.
>
> If we ever want to be able to undo "stg repair", we have to be able to
> represent an inconsistent state where head != top.

I wouldn't bother with this feature. Why would one want to break the
stack again after repairing? If they merge patches and git commits,
they either repair the stack or commit all the patches and continue
with using Git only.

>> The third head would only be needed for the first log entry or when
>> we use pick --unapplied (in the latter, it only points to the
>> unapplied commit).
>
> Actually, except for the previous log entry, all the parents are just
> there for gc's benefit. So we could just put all of them in the same
> bucket -- branch head, stack top, and unapplied patches.
>
> ( By "bucket" I mean something like: if there are just a few of them,
>  have them as direct parents of the log commit; otherwise, refer to
>  them using a tree of octopuses. But in any case, just treat them as
>  a set of sha1s that we need to have as ancestors but don't otherwise
>  care about. )

Yes.

>> >  * I'm pretty sure we want the kind of "simplified" log I have in
>> >    my proposal. The full log in your proposal is going to look
>> >    every bit as ugly as the one in mine.
>>
>> I agree it will look ugly but the simplified log adds an extra
>> overhead on any stgit action. If we don't use stg log -g, a text
>> only log command could show the diff. We can add it afterwards
>> though if it is fast enough.
>
> I'd actually say the opposite: until we have a good visualizer that
> doesn't need the simplified log, we need to have the simplified log.
> If I actually have to look at the diffs in the log, I find gitk
> indispensible.

And what would the simplified log contain if we decide to go with a
new scheme? In your proposal, it points to the tree of main log and
you get the diff of diffs (which also means that the diffs must be
generated for every modification of a patch). Would this be the same?
Again, I worry a bit about the overhead to generate the patch diff for
every push (with refresh I'm OK). It can be optimised as in the stable
branch where we try git-apply followed by a three-way merge (which,
BTW, I'd like added before 0.15). If git-apply succeeds, there is no
need to re-generate the diff.

-- 
Catalin

  reply	other threads:[~2008-06-20  9:15 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12  5:34 [StGit PATCH 00/14] Undo series Karl Hasselström
2008-06-12  5:34 ` [StGit PATCH 01/14] Fix typo Karl Hasselström
2008-06-12  5:34 ` [StGit PATCH 02/14] Library functions for tree and blob manipulation Karl Hasselström
2008-06-12  5:34 ` [StGit PATCH 03/14] Write to a stack log when stack is modified Karl Hasselström
2008-06-17 10:24   ` Catalin Marinas
2008-06-17 12:31     ` Karl Hasselström
2008-06-17 12:55       ` Karl Hasselström
2008-06-17 14:11       ` Catalin Marinas
2008-06-17 15:32         ` Karl Hasselström
2008-06-18 13:03           ` Catalin Marinas
2008-06-18 14:36             ` Karl Hasselström
2008-06-18 16:16               ` Catalin Marinas
2008-06-18 17:32                 ` Karl Hasselström
2008-06-19  9:24                   ` Catalin Marinas
2008-06-19 10:07                     ` Karl Hasselström
2008-06-20  9:14                       ` Catalin Marinas [this message]
2008-06-23 12:36                         ` Karl Hasselström
2008-07-12 10:09                           ` Catalin Marinas
2008-07-14  6:32                             ` Karl Hasselström
2008-07-01 20:13           ` Karl Hasselström
2008-07-03 22:05             ` Catalin Marinas
2008-06-12  5:34 ` [StGit PATCH 04/14] Add utility function for reordering patches Karl Hasselström
2008-06-12  5:34 ` [StGit PATCH 05/14] New command: stg reset Karl Hasselström
2008-06-12  5:34 ` [StGit PATCH 06/14] Log conflicts separately Karl Hasselström
2008-06-12  5:34 ` [StGit PATCH 07/14] Log conflicts separately for all commands Karl Hasselström
2008-06-12  5:34 ` [StGit PATCH 08/14] Add a --hard flag to stg reset Karl Hasselström
2008-06-12  5:35 ` [StGit PATCH 09/14] Don't write a log entry if there were no changes Karl Hasselström
2008-06-12  5:35 ` [StGit PATCH 10/14] Move stack reset function to a shared location Karl Hasselström
2008-06-12  5:35 ` [StGit PATCH 11/14] New command: stg undo Karl Hasselström
2008-06-12  5:35 ` [StGit PATCH 12/14] New command: stg redo Karl Hasselström
2008-06-12  5:35 ` [StGit PATCH 13/14] Log and undo external modifications Karl Hasselström
2008-06-12  5:35 ` [StGit PATCH 14/14] Make "stg log" show stack log instead of patch log Karl Hasselström

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=b0943d9e0806200214j77aef272sc5cfb98b002cae22@mail.gmail.com \
    --to=catalin.marinas@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=kha@treskal.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).