From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id YNpzEAtFE2BHTgAA0tVLHw (envelope-from ) for ; Thu, 28 Jan 2021 23:13:15 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id KDUyDAtFE2DMDwAAB5/wlQ (envelope-from ) for ; Thu, 28 Jan 2021 23:13:15 +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 DF7BC940430 for ; Thu, 28 Jan 2021 23:13:14 +0000 (UTC) Received: from localhost ([::1]:59300 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5GTR-0002tA-NF for larch@yhetil.org; Thu, 28 Jan 2021 18:13:13 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:38658) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1l5GTI-0002se-GG for guix-devel@gnu.org; Thu, 28 Jan 2021 18:13:04 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:46392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1l5GTG-0001PG-2n for guix-devel@gnu.org; Thu, 28 Jan 2021 18:13:04 -0500 Received: by mail-wr1-x436.google.com with SMTP id q7so7028574wre.13 for ; Thu, 28 Jan 2021 15:13:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=xUDQSwwg/3sVe+sBB80GVCgwn/npUqIfd5VCIs2FazM=; b=X09jazgHd7+sqafNRx0nVchPuUbJO3Fo3eI6mox8leamFzuh6qkhvMRSOBc7KVZVdn Fb+3pmFTu6pPx0hdswm2FU+vUiX99cDdvr4iuCwyJupUp3P3ltgStqob/A68Z99k6S+Y ko7bjPnbk+FtDZpGGbuZcx9qp8PPLzZcPsXf3pXVlQN40PSf9pbZzK9NuCq8XfFfwryK JUzA1fTnvBKZW0GEIly3EUlEanjazj9wqWvtDcDUCvoua4zdBH+UJPfFFKepQ1NqBF+h uE79oPmvgA9aG1EdTn6SNWGsnnfkAHbCYeyt8xKl809Bx4JNHlqfgH+IsbOE0rxv7M0r puxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=xUDQSwwg/3sVe+sBB80GVCgwn/npUqIfd5VCIs2FazM=; b=TCRsrzu4NtBXhPAZFh6fxRTn5MUpPayYUe0N5gnf7Am67HLUUrJ/ZK5IzAaGcouC9V 9dFOv0nX9hCG6O7zL4qEK5Uw1ySy+HIj3QnugPVhCp9v6CyuukxKTEOfC9KFtT+7sgov tz5X36i3QYiDEkFc7fzLQ4Jbe46BsGWuiO6fbSPZW5Womep5qmDubfK13jpmPJ7lTRbL bwK70LvJOXXL5DqnyS7P4sM4n5OOlWgGqb8dF+j7xXVScnsBMvQV7aJftZ41kyXkCrTQ xoowqhOn2oiYA1hLJHXKIbgM3+c1175bxrZpfGzXzHvFGmQKbHS5mJ2B1JewsImjaj6Q 39Ng== X-Gm-Message-State: AOAM532bdLq4aMMffxptKKJGvYxDo4JfR116cV0ybL+nV0RJSuSW5Yh/ y3WVVjv1KBuxXOJ/7VrPy2E3DxMrKt0= X-Google-Smtp-Source: ABdhPJzfaXcVu7qZRqN70jznRMiQKn2cDiVzo92h7GwwZAW7L01enDHIIn/S2CxDO61dJW5QokM5KA== X-Received: by 2002:a05:6000:1372:: with SMTP id q18mr1397713wrz.280.1611875580486; Thu, 28 Jan 2021 15:13:00 -0800 (PST) Received: from lili ([88.126.110.68]) by smtp.gmail.com with ESMTPSA id g9sm13760518wmh.3.2021.01.28.15.12.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Jan 2021 15:12:59 -0800 (PST) From: zimoun To: Magali , =?utf-8?Q?G=C3=A1bor?= Boskovits , Guix Devel Subject: Re: [Outreachy] Feedback on 'guix git log' subcommand In-Reply-To: References: Date: Fri, 29 Jan 2021 00:07:11 +0100 Message-ID: <86im7ghd9c.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=zimon.toutoune@gmail.com; helo=mail-wr1-x436.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: , Errors-To: guix-devel-bounces+larch=yhetil.org@gnu.org Sender: "Guix-devel" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -3.05 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=X09jazgH; dmarc=pass (policy=none) header.from=gmail.com; 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: DF7BC940430 X-Spam-Score: -3.05 X-Migadu-Scanner: scn1.migadu.com X-TUID: u0C9ZjkDb8/P --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Magali, On Thu, 28 Jan 2021 at 00:53, Magali wrote: > On a side note, I've been blogging about it at > . Nice readings! :-) > Below are a few examples of the options currently available: > > ./pre-inst-env guix git log --format=3Dmedium > ./pre-inst-env guix git log --oneline > ./pre-inst-env guix git log --channel-cache-path > ./pre-inst-env guix git log --channel-cache-path=3Dguix Cool! An example, the recent update of setuptools breaks python2-setuptools. --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix git log --oneline \ > | grep 'python-setuptools:' | grep Update b3ca2b4 gnu: python-setuptools: Update to 40.8.0. d0205df gnu: python-setuptools: Update to 40.0.0. 62a9a23 gnu: python-setuptools: Update to 18.3.1. d3d656c gnu: python-setuptools: Update to 12.1. d660f7b gnu: python-setuptools: Update to 31.0.0. e39d493 gnu: python-setuptools: Update to 41.0.1. 3142dac gnu: python-setuptools: Update to 52.0.0. --8<---------------cut here---------------end--------------->8--- Ah, the order seems weird, =E2=80=9Cgit log=E2=80=9D says: --8<---------------cut here---------------start------------->8--- 3142daccbe gnu: python-setuptools: Update to 52.0.0. e39d4933d1 gnu: python-setuptools: Update to 41.0.1. b3ca2b45d1 gnu: python-setuptools: Update to 40.8.0. d0205dfd92 gnu: python-setuptools: Update to 40.0.0. d660f7be6d gnu: python-setuptools: Update to 31.0.0. 62a9a23bf9 gnu: python-setuptools: Update to 18.3.1. d3d656c5fb gnu: python-setuptools: Update to 12.1. --8<---------------cut here---------------end--------------->8--- Well, somehow it is your question about which order. :-) Doing that, I am thinking of two nice features: 1. get the parent commits 2. show a specific commit For example, guix git log --parents=3D3142daccbe # =3D> 631e1f33 guix git log --show=3D3142daccbe so then I can feed =E2=80=9Cguix time-machine=E2=80=9D with 631e1f33 to have =E2=80=99python2-setuptools=E2=80=99 before it breaks. I am not sure to wh= at =E2=80=9C--show=E2=80=9D would do. WDYT? Hum, =E2=80=99--grep=E2=80=99 seems missing. I do not remember, is it not = working? Even slowly? As discussed, =E2=80=9Cguix-git-log=E2=80=9D is not defined as =E2=80=99def= ine-command=E2=80=99 because it should not appear on =E2=80=9Cguix help=E2=80=9D. However, it should ap= pear with =E2=80=9Cguix git --help=E2=80=9D. Well, my idea was something along this attached patch, --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=guix-git-display-log.patch Content-Description: small.patch diff --git a/guix/scripts/git.scm b/guix/scripts/git.scm index 8fcd0ccca8..3b141a622d 100644 --- a/guix/scripts/git.scm +++ b/guix/scripts/git.scm @@ -18,18 +18,26 @@ (define-module (guix scripts git) #:use-module (ice-9 match) + #:use-module (ice-9 format) #:use-module (guix ui) #:use-module (guix scripts) + #:use-module (srfi srfi-1) #:export (guix-git)) +(define %sub-commands + `(("authenticate" . "verify commit signatures and authorizations") + ("log". "show Git commit history"))) + (define (show-help) (display (G_ "Usage: guix git COMMAND ARGS... Operate on Git repositories.\n")) (newline) (display (G_ "The valid values for ACTION are:\n")) (newline) - (display (G_ "\ - authenticate verify commit signatures and authorizations\n")) + (for-each (match-lambda + ((name . help) + (format #t "~13a ~a\n" name help))) + %sub-commands) (newline) (display (G_ " -h, --help display this help and exit")) @@ -38,8 +46,6 @@ Operate on Git repositories.\n")) (newline) (show-bug-report-information)) -(define %sub-commands '("authenticate" "log")) - (define (resolve-sub-command name) (let ((module (resolve-interface `(guix scripts git ,(string->symbol name)))) @@ -61,7 +67,6 @@ Operate on Git repositories.\n")) ((or ("-V") ("--version")) (show-version-and-exit "guix git")) ((sub-command args ...) - (if (member sub-command %sub-commands) + (if (find (lambda (s) (string=? (first s) sub-command)) %sub-commands) (apply (resolve-sub-command sub-command) args) - (format (current-error-port) - (G_ "guix git: invalid sub-command~%"))))))) + (leave (G_ "~a: invalid sub-command~%") sub-command)))))) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable but =E2=80=9Cguix system=E2=80=9D hard code all the subcommands. So, maybe= hardcoding the =E2=80=9Clog=E2=80=9D subcommand is the way to do; with translation in = mind, I guess. > Another thing is that the command is a bit slower than 'git log' itself. > Thoughts on how that could be improved? I will provide more on a separate email. And review more in details the code. :-) Thanks for working on that. That=E2=80=99s cool! :-) Cheers, simon --=-=-=--