unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: "Gábor Boskovits" <boskovits@gmail.com>
To: Magali <magalilemes00@gmail.com>
Cc: Guix Devel <guix-devel@gnu.org>
Subject: Re: [Outreachy] Strategy to implement guix git log --pretty=<string>
Date: Wed, 6 Jan 2021 09:03:03 +0100	[thread overview]
Message-ID: <CAE4v=phsRCdzAL4UihA9FgKtEmbJA3q0QUdJ=XPxNeztoqC6gg@mail.gmail.com> (raw)
In-Reply-To: <c2de6cf1-b8af-5008-ebbd-d1c587ce1064@gmail.com>

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	other threads:[~2021-01-06  8:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06  4:35 [Outreachy] Strategy to implement guix git log --pretty=<string> Magali
2021-01-06  8:03 ` Gábor Boskovits [this message]
2021-01-14 21:29 ` Ludovic Courtès
2021-01-18 15:02   ` zimoun
  -- strict thread matches above, loose matches on Subject: below --
2021-01-06  8:10 Leo Prikler
2021-01-18 14:45 ` zimoun

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='CAE4v=phsRCdzAL4UihA9FgKtEmbJA3q0QUdJ=XPxNeztoqC6gg@mail.gmail.com' \
    --to=boskovits@gmail.com \
    --cc=guix-devel@gnu.org \
    --cc=magalilemes00@gmail.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.
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).