From: Csepp <raingloom@riseup.net>
To: Andreas Enge <andreas@enge.fr>
Cc: Csepp <raingloom@riseup.net>, guix-devel@gnu.org
Subject: Re: splitting up and sorting commits?
Date: Sun, 06 Nov 2022 13:19:53 +0100 [thread overview]
Message-ID: <87leooi7xb.fsf@riseup.net> (raw)
In-Reply-To: <Y2eFhP/VphuioZID@jurong>
Andreas Enge <andreas@enge.fr> writes:
> Hello,
>
> Am Wed, Nov 02, 2022 at 12:05:54AM +0000 schrieb Csepp:
>> * It is very easy for package to get added before their dependencies, so
>> even though by the end of the commit chain everything builds perfectly
>> fine, there are intermediate commits that can't be tested on their own.
>
> maybe it can be handled by a different workflow? I usually use the git stash
> to perform a depth first traversal of the dependency graph like so:
> - Add package A. Try to build it and see that it needs dependency B.
> "git stash".
> - Add package B *instead*. Try to build it...
> (da capo ad libitum)
> - "git commit" with package B.
> - "git stash pop". Try to build package A etc.
> - "git commit" with package A.
>
> The only drawback is that B and A are often defined next to each other,
> which creates a spurious merge conflict during "git stash pop", but that
> is easy to solve and requires an additional "git stash drop" in the end.
>
> Sometimes I even give up on package A in the end, but then at least B
> has been added to Guix :)
>
> Andreas
I tried that, the merge conflicts drove me nuts. And juggling the stash
stack was a nightmare.
Instead I ended up committing each package individually without caring
about dependencies, then doing an interactive rebase where every command
was edit. If I saw warnings about undefined variables I ran git rebase
--edit-todo **without** magit, because it made simple textual edits
needlessly hard (this is why I use Kakoune and Emacs side by side),
opened .git/rebase-merge/done, cut the last line, pasted it in todo
after its dependency, ran git reset --hard "HEAD^" **ONLY** if HEAD was
actually that commit, if it was not yet committed because there was a
merge conflict, I ran git rebase --skip. Yep, figuring out when to
reset and when to skip took a few tries. :)
prev parent reply other threads:[~2022-11-06 12:29 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-02 0:05 splitting up and sorting commits? Csepp
2022-11-02 14:43 ` zimoun
2022-11-03 20:59 ` Liliana Marie Prikler
2022-11-04 9:20 ` zimoun
2022-11-04 17:53 ` Liliana Marie Prikler
2022-11-06 9:59 ` Andreas Enge
2022-11-06 12:19 ` Csepp [this message]
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
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87leooi7xb.fsf@riseup.net \
--to=raingloom@riseup.net \
--cc=andreas@enge.fr \
--cc=guix-devel@gnu.org \
/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.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).