guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Outreachy] Strategy to implement guix git log --pretty=<string>


From: Gábor Boskovits
Subject: Re: [Outreachy] Strategy to implement guix git log --pretty=<string>
Date: Wed, 6 Jan 2021 09:03:03 +0100

Hello,

Magali <magalilemes00@gmail.com> ezt írta (időpont: 2021. jan. 6., Sze, 5:35):
>
> Hello Guix,
>
> As you might know, as part of my Outreachy internship I'm currently
> working on implementing the subcommand 'guix git log', for browsing the
> history of all packages. So far, it works with '--oneline' and
> '--format=<FORMAT>', and FORMAT can be 'oneline', 'medium' or 'full'. If
> you want to see it, the code can be found at
> https://gitlab.com/magalilemes/guix
>
> On the road to adding another option to the subcommand,
> '--pretty=<string>' arose as an idea. With git log, you can do something
> like
> git log pretty=<string>
> And this string can have placeholders, such as %h for showing the short
> hash of a commit, and %s for showing the commit subject. For instance,
> you could have git log --pretty="%h %s" and this would display the
> commit history log with the short hash and subject of commits.
>
> So, in order to implement 'guix git log --pretty=<string>', I'd like
> help with a strategy to parse the string. Any examples, ideas and tips
> would be really appreciated.
>

>From the top of my head two things come to mind, you could either
tokenize the string and handle it as a list,
or you could do a regex matching. I don't think anything more
complicated is needed to handle this.

You can find the relevant docs here:
https://www.gnu.org/software/guile/manual/html_node/Strings.html
https://www.gnu.org/software/guile/manual/html_node/Regular-Expressions.html




> Cheers,
>
> Magali
>
>

Regards,
g_bor
-- 
OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21



reply via email to

[Prev in Thread] Current Thread [Next in Thread]