Subject: [bug#42225] [PATCH 0/5] Add 'guix git-authenticate' command

From: zimoun <[email-masked]>
Date: Mon, 6 Jul 2020 15:27:26 +0200

On Mon, 6 Jul 2020 at 14:46, Ludovic Courtès <[email-masked]> wrote:

> >    git -C $SRC log | grep Update
> >
> > And I would like to be able to simply run;
> >
> >    guix git log | grep Update
>
> Good point.  Though hopefully this particular use case (finding new
> package updates) is well served by ‘guix pull --news’, no?

It is not for new package updates, but the contrary. :-)
I use it for searching versions back in time.  Which commit introduces
which version.

To be honest, I am almost never use "guix pull --news" because I am
pulling once every full moon, and even when I do, I run an ugly script
like:

--8<---------------cut here---------------start------------->8---
#!/bin/bash

# url-cache-directory from guix/git.scm
# pjmkgl... = hash("https://git.savannah.gnu.org/git/guix.git")
CACHE=~/.cache/guix/checkouts
CHECKOUT=${CACHE}/pjmkglp4t7znuugeurpurzikxq3tnlaywmisyr27shj7apsnalwq

printf "Updating local checkout:\n'$CHECKOUT'..."
git -C $CHECKOUT pull -q
echo " done."

guix pull --commit=$(git -C $CHECKOUT                                    \
                         log                                             \
                         --before=$(date --date='2 weeks ago' +%Y-%m-%d) \
                         --format="%h" | head -n1)                       \
     $@
--8<---------------cut here---------------end--------------->8---

because I do want the substitutes available.  Well, for example, I
run: "guix pull --news" and I get 15 new packages and 367 packages
upgraded.

> It’s not entirely clear to me what a ‘guix git log’ command would do in
> fact: show the log for the ‘guix’ channel?  For all channels (how?)?
> For the specified channel?  For what commit range?

This is maybe out of the current bug report.  I do not know if it is
good to discuss here.  Well, quickly we could imagine:

  guix git log # for guix channel
  guix git log --channel=name

Then for the commit range, it could be the same UI as "git log".
Since the commit messages are well-formatted, it is pretty easy to grep in.

Moreover, "git worktree" could be added too.  Well, the idea behind is
to avoid clone+guix-environment+./pre-env-inst.

> > And the same for tagging commits.  Which implies also improve what "guix
> > pull" and "guix time-machine" accept.
>
> Tagging commits is tricky because users only have a *cached* checkout.
> So if we want persistent tags, we’ll have to develop a separate
> mechanism.  Could be useful, though perhaps redundant with the
> (unimplemented) idea of tagging generation?

Well, I do not want persistent tags.  I am fine with local tags.  I
mean it is easy to tag my local repo with something meaningful for me
and then lookup couple of weeks later.  I do with "git -C $SRC" but I
would like nicer to be able to run:

   guix git log | grep bazinga
   guix git tag foo
   guix time-machine --commit=foo --

> In the short term, we don’t need to solve all these problems: we can
> also go for ‘git-authenticate’ and rename it once we have these other
> commands.

I have learnt that renaming will not work. :-)
Because backward compatibilities and break the workflow of someone.
So I would take the other route, go for "guix git authenticate" and
hoping that other commands would come soon.
Well, I do not know. It is just a suggestion reading your message. :-)

Cheers,
simon