unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Efraim Flashner <efraim@flashner.co.il>
To: jgart <jgart@dismail.de>
Cc: 52346-done@debbugs.gnu.org
Subject: [bug#52346] Using git worktrees
Date: Wed, 8 Dec 2021 11:30:50 +0200	[thread overview]
Message-ID: <YbB7SkqV62xDSRWp@3900XT> (raw)
In-Reply-To: <20211207162830.GB1527@gac.attlocal.net>

[-- Attachment #1: Type: text/plain, Size: 2937 bytes --]

On Tue, Dec 07, 2021 at 04:28:30PM -0500, jgart wrote:
> On Tue, 07 Dec 2021 13:50:52 +0200 Efraim Flashner <efraim@flashner.co.il> wrote:
> > On Tue, Dec 07, 2021 at 05:02:58AM -0500, jgart via Guix-patches via wrote:
> > > On Tue, 07 Dec 2021 09:26:51 +0100 Liliana Marie Prikler <liliana.prikler@ist.tugraz.at> wrote:
> > > > This has already been taken care of on core-updates-frozen [1], have
> > > > some patience ;)
> > > 
> > > hahah
> > > 
> > > How do you usually keep up to date with core-updates-frozen, etc...?
> > > 
> > > rss feeds, email list for cuf?
> > > 
> > 
> > git worktrees :)
> 
> Efraim,
> 
> What's your workflow for using git worktrees when doing Guix development?
> 
> I remember Raghav using them and he showed me briefly but it felt a bit
> like a branches, maybe cleaner for bootstrapping and switching to a new
> tree. I didn't get around to incorporating it into my own workflow.
> 
> Any advice is much appreciated,
> 
> jgart

It's quite expensive with Guix to switch between different branches due
to the compiled guile code. By keeping different branches in different
directories I can work on them concurrently without needing to recompile
when switching between branches. It's basically like checking out the
repository multiple times in different directories, but they all use the
.git folder from the original checkout.

(ins)efraim@3900XT ~/workspace/guix$ git worktree list
/home/efraim/workspace/guix                   ddcec589bc [master]
/home/efraim/workspace/guix-core-updates      ee03b51f6e [core-updates-frozen]
/home/efraim/workspace/guix-riscv             34758aca7c [wip-riscv]
/home/efraim/workspace/guix-staging           eec94982b1 [staging]
/home/efraim/workspace/guix-upstream-keyring  702f4c7942 [keyring]
/home/efraim/workspace/guix-wip-rust          ed496cb639 [wip-rust]

The basic command I follow is 'git worktree add <path> <branch>', so
'git worktree add ../guix-core-updates origin/core-updates-frozen'. Then
I change it to what I actually wanted, a local branch named
core-updates, tracking origin/core-updates-frozen (I can never get some
of those commands correct). Then I run bootstrap, configure and make in
that directory and I can work on both branches at the same time.

I'm not sure about the syntax since I often seem to get the worktree and
branching syntax wrong (and end up creating a local branch named
origin/core-updates, tracking my local core-updates branch), but it's
great for keeping track of everything at once.

Once most of my wip-riscv branch is merged back in I'll remove the
actual worktree with 'git worktree remove <something>' and then just
keep the wip-riscv branch.

-- 
Efraim Flashner   <efraim@flashner.co.il>   רנשלפ םירפא
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2021-12-08  9:35 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-07  7:30 [bug#52346] [PATCH] gnu: ninja: Update to 1.10.2 jgart via Guix-patches via
2021-12-07  8:26 ` bug#52346: " Liliana Marie Prikler
2021-12-07 10:02   ` [bug#52346] " jgart via Guix-patches via
2021-12-07 10:17     ` Liliana Marie Prikler
2021-12-07 11:50     ` Efraim Flashner
2021-12-07 21:28       ` jgart via Guix-patches via
2021-12-08  9:30         ` Efraim Flashner [this message]
2021-12-16  6:29           ` [bug#52346] Using git worktrees jgart via Guix-patches via

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=YbB7SkqV62xDSRWp@3900XT \
    --to=efraim@flashner.co.il \
    --cc=52346-done@debbugs.gnu.org \
    --cc=jgart@dismail.de \
    /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).