From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6BOGBdFu9V8XUAAA0tVLHw (envelope-from ) for ; Wed, 06 Jan 2021 08:03:29 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id +EszAdFu9V8hcgAAbx9fmQ (envelope-from ) for ; Wed, 06 Jan 2021 08:03:29 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id CB7B3940416 for ; Wed, 6 Jan 2021 08:03:28 +0000 (UTC) Received: from localhost ([::1]:57592 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kx3mx-0004o0-LP for larch@yhetil.org; Wed, 06 Jan 2021 03:03:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:56100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kx3mn-0004nq-Pr for guix-devel@gnu.org; Wed, 06 Jan 2021 03:03:17 -0500 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]:42924) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kx3mm-00053T-2z for guix-devel@gnu.org; Wed, 06 Jan 2021 03:03:17 -0500 Received: by mail-ej1-x630.google.com with SMTP id d17so3857372ejy.9 for ; Wed, 06 Jan 2021 00:03:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=LBRO2zQK+JTpXHxJ+vUPsT8HwtY60HAhlYMzHCPQpgw=; b=Fn3thm+55x22bnnjxTQl7PdHlXQ82J+AOPkRW6p3QrzBTmstDB6ga8R3N2g7yyEVG5 gZLFcYuCHoXLgtI05rMW8rKIEhYg9n9/2fG0ES8V/Dd2YiqATfTBfv87enNw113o1HBt kq4EJtPiBWdl0ETqv8MFV5HXsqXPf0FHM4CMlExpnHxHC/Iic2ElTe8016dR8/KMSqLK T6AqfKIMBytuHmR+Qfqj1K7rxFG4PelRsXtn5i8chV4NDXDB5abwUM52zShZPei9IJPX JxHV3dKh5wmlNHotvkqAuRWUAj8FdXR8McvTs8j7bfXFQh6ccV99kV4ak/n98Pu9f1tn rwng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=LBRO2zQK+JTpXHxJ+vUPsT8HwtY60HAhlYMzHCPQpgw=; b=a6oljA+4rm2M9TFOMyaQsPmkX+yoa7vF854gbtPtqzYEf/ghGJzktSFx3wslp3vTuR kSXkj40/BVID59iUFUqt3itT9pOWRu6ectEqM6eGUy6uDu4dtx7EmhtCTpJChV16KXLz AeNoHe+VR9g87V2xF8FNP4Qyj0NJHcIRyvMywVwqwITjyft4B8y6ADeY/7CImfaiF88A WtDYUJoXrdPz49QzCz2oo2xN8Njx4EliJg0AZ8acNe57ul1FXEOtbSLpbLkOgRYNG2+F XamtB3bHYlUy3hEcDRxPTJkk7enCIFwcfZg7vXDK5N1e4bDVpO6yz3Ugx/D7pW3Z1HHa bkUg== X-Gm-Message-State: AOAM530klp4hO77SMlEC68BeTwuyBjy1oMMMI9VUqaVC4w2i3YreiiMu 9jbOmzxmG2KML1/pED6gdmKkOvBANUuyrNMOVg== X-Google-Smtp-Source: ABdhPJzOvq12ZSYTB0OoX7/G6UofDBrpyutaOqOTdW/io4g52AYopGsj5bNZssH6PYdALg5gjyBakVdxE4WzIZmj/Ho= X-Received: by 2002:a17:906:d0c1:: with SMTP id bq1mr2050093ejb.202.1609920194085; Wed, 06 Jan 2021 00:03:14 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: =?UTF-8?Q?G=C3=A1bor_Boskovits?= Date: Wed, 6 Jan 2021 09:03:03 +0100 Message-ID: Subject: Re: [Outreachy] Strategy to implement guix git log --pretty= To: Magali Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=2a00:1450:4864:20::630; envelope-from=boskovits@gmail.com; helo=mail-ej1-x630.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guix-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Guix Devel Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.24 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=Fn3thm+5; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of guix-devel-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-devel-bounces@gnu.org X-Migadu-Queue-Id: CB7B3940416 X-Spam-Score: -1.24 X-Migadu-Scanner: scn0.migadu.com X-TUID: taPWfg7hcpaP Hello, Magali ezt =C3=ADrta (id=C5=91pont: 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=3D', and FORMAT can be 'oneline', 'medium' or 'full'. I= f > 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=3D' arose as an idea. With git log, you can do somethin= g > like > git log pretty=3D > 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=3D"%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=3D', 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.htm= l > Cheers, > > Magali > > Regards, g_bor --=20 OpenPGP Key Fingerprint: 7988:3B9F:7D6A:4DBF:3719:0367:2506:A96C:CF63:0B21