[PATCH] guix: pull: Also print the name of the branch.

  • Open
  • quality assurance status badge
Details
2 participants
  • Attila Lendvai
  • Simon Tournier
Owner
unassigned
Submitted by
Attila Lendvai
Severity
normal
A
A
Attila Lendvai wrote on 29 Jul 2023 14:04
(address . guix-patches@gnu.org)(name . Attila Lendvai)(address . attila@lendvai.name)
9428a39d118ff033fb117abdeaf7015c9bbf80e2.1690632263.git.attila@lendvai.name
---

i was missing this. maybe you will find it useful, too.

guix/channels.scm | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

Toggle diff (23 lines)
diff --git a/guix/channels.scm b/guix/channels.scm
index 681adafc6c..731e0d90d3 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -537,9 +537,11 @@ (define* (latest-channel-instances store channels
(values previous-channels instances)
(begin
(format (current-error-port)
- (G_ "Updating channel '~a' from Git repository at '~a'...~%")
+ (G_ "Updating channel '~a' from Git repository at \
+'~a', branch '~a'...~%")
(channel-name channel)
- (channel-url channel))
+ (channel-url channel)
+ (channel-branch channel))
(let* ((current (current-commit (channel-name channel)))
(instance
(latest-channel-instance store channel

base-commit: e43cbeafd1b632f39b08b3644af5230d5350a656
prerequisite-patch-id: 6793c8ad24215c5f14ce71a4741fff5f6ccd7eeb
--
2.40.1
S
S
Simon Tournier wrote on 16 Aug 2023 18:41
871qg3ey81.fsf@gmail.com
Hi,

On Sat, 29 Jul 2023 at 14:04, Attila Lendvai <attila.lendvai@gmail.com> wrote:

Toggle quote (8 lines)
> - (G_ "Updating channel '~a' from Git repository at '~a'...~%")
> + (G_ "Updating channel '~a' from Git repository at \
> +'~a', branch '~a'...~%")
> (channel-name channel)
> - (channel-url channel))
> + (channel-url channel)
> + (channel-branch channel))

That’s nice but I see a potential confusion when using “guix pull
--commit” or “guix time-machine --commit”. Well, from ’channel-list’ in
(guix scripts pull), if the option --commit is provided then the branch
is set to #f. Therefore, it would display “, branch #f...” which could
be misleading.

Somehow, this display should be conditional depending on if
’channel-branch’ is not #f. WDYT?

Cheers,
simon
A
A
Attila Lendvai wrote on 9 Sep 2023 22:48
[PATCH v2] guix: pull: Also print the name of the branch.
(address . 64931@debbugs.gnu.org)(name . Attila Lendvai)(address . attila@lendvai.name)
c399a50cfddb4c55d34b150c3ad0e4933b8b29d3.1694292523.git.attila@lendvai.name
* guix/channels.scm (latest-channel-instances): Also print the branch name.
---

v2: added conditional formatting to only print the branch name when it's
specified.

guix/channels.scm | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)

Toggle diff (26 lines)
diff --git a/guix/channels.scm b/guix/channels.scm
index 681adafc6c..5b48d206c4 100644
--- a/guix/channels.scm
+++ b/guix/channels.scm
@@ -537,9 +537,15 @@ (define* (latest-channel-instances store channels
(values previous-channels instances)
(begin
(format (current-error-port)
- (G_ "Updating channel '~a' from Git repository at '~a'...~%")
+ (G_ "Updating channel '~a' from Git repository at \
+'~a'~:[~;, branch '~a'~]...~%")
(channel-name channel)
- (channel-url channel))
+ (channel-url channel)
+ ;; Only conditionally print the branch name. If
+ ;; --commit is provided for channel-list in (guix
+ ;; scripts pull), then the branch is set to #f.
+ (channel-branch channel)
+ (channel-branch channel))
(let* ((current (current-commit (channel-name channel)))
(instance
(latest-channel-instance store channel

base-commit: e43cbeafd1b632f39b08b3644af5230d5350a656
--
2.41.0
?