git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] builtin/remote.c: show progress when renaming remote references

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Mar 3, 2022, 10:51 UTC
Message-ID
<220303.8635jz5mcz.gmgdl@evledraar.gmail.com>
In-Reply-To
<Yh/1zFChEXz7r1vN@nand.local>
On Wed, Mar 02 2022, Taylor Blau wrote:
Show 19 quoted lines
> On Wed, Mar 02, 2022 at 08:00:59PM +0100, Ævar Arnfjörð Bjarmason wrote:
>> So please have this by "int progress = 1", and have a "PARSE_OPT_NONEG"
>> "no-progress" option instead, there's no reason we need to propagate the
>> existing UX mistake in "reflog expire".
>
> Yes, I agree that `git remote` is unlike other commands where you have
> to opt _in_ to see progress, not out.
>
> But I deliberately avoided doing anything about it here, since this
> patch is more about making an existing set of arguments (`git remote -v
> rename`) do something more useful than before, and not adding a new
> option.
>
> In other words, I felt that because you could already run:
>
>     $ git remote -v rename old new
>
> that it was better to punt on any changes to the option itself until
> later.

So first, I must say that I was just entirely confused when I wrote this. I managed to somehow read this code and also mentally mix up that you were patching git-remote and not git-reflog, hence linking to those "reflog" patches.

By way of explanation I think that's because I started thinking "oh yeah, it's that one special case where --verbose shows progress..." :)

But in any case, for *this patch* I think that also means that using --verbose here makes even less sense, because --verbose for "git-remote" is:

    Be a little more verbose and show remote url after name.
    NOTE: This must be placed between remote and subcommand.

Although reading it over it seems that was written for "git remote -v [show]", but we don't entirely hold to it already, but in any case let's not also conflate it with what should be a "--no-progress" here.

Show 9 quoted lines
> On a similar note, it would be nice if this option worked on either side
> of the sub-command, like how you can do either of:
>
>     $ git multi-pack-index --object-dir=... write
>     $ git multi-pack-index write --object-dir=...
>
> But I don't think we should let perfect be the enemy of the good here,
> in case you were suggesting delaying this patch until we sort that issue
> out.

I think per [1] and your [2] we agreed to move forward in not adding any more of these subcommand-level options. I.e. I was arguing in [1] that it might be a good idea for e.g. --no-progress or --verbose, but the consensus was to go for your [2] of declaring that it's always the subcommand that takes the option.

(Which as an aside, I'm fine with, and have come more around to being the Way It Should Be since then).

So just doing:
	
	diff --git a/builtin/remote.c b/builtin/remote.c
	index 6f27ddc47bd..047bcda57c5 100644
	--- a/builtin/remote.c
	+++ b/builtin/remote.c
	@@ -674,7 +674,9 @@ static void handle_push_default(const char* old_name, const char* new_name)
	 
	 static int mv(int argc, const char **argv)
	 {
	+	int progress = 1;
	 	struct option options[] = {
	+		OPT_BOOL(0, "progress", &progress, N_("show progress")),
	 		OPT_END()
	 	};
	 	struct remote *oldremote, *newremote;

Would be consistent with [2] and not mix up --verbose and its (probably somewhat inaccurate already) documented promises with this new output, and improve the UX by turning it on by default.

1. https://lore.kernel.org/git/87zgsad6mn.fsf@evledraar.gmail.com/
2. https://lore.kernel.org/git/cover.1631980949.git.me@ttaylorr.com/
Show 11 quoted lines
>> [I reversed the order you wrote the following, due to the obvious
>> digression...] :)
>
> ;-), thanks.
>
>> As an aside I think the reftable code "emulates" the D/F conflicts of
>> the files backend, but I'm not sure (this is from vague memory).
>
> Perhaps, though I'm admittedly not familiar enough with that work to
> tell know for sure, either. I don't think I have a ton to add to the
> lower part of your reply, so I'll stop here.
:)
Previous: Taylor BlauNext: Taylor Blau
Message 8 of 23 in “builtin/remote.c: show progress when renaming remote references”
  1. builtin/remote.c: show progress when renaming remote referencesTaylor Blau, Mar 1, 2022
  2. Derrick StoleeMar 2, 2022
  3. Taylor BlauMar 2, 2022
  4. Derrick StoleeMar 2, 2022
  5. Junio C HamanoMar 2, 2022
  6. Ævar Arnfjörð BjarmasonMar 2, 2022
  7. Taylor BlauMar 2, 2022
  8. Ævar Arnfjörð BjarmasonMar 3, 2022
  9. Taylor BlauMar 3, 2022
  10. Han-Wen NienhuysMar 7, 2022
  11. brian m. carlsonMar 2, 2022
  12. Taylor BlauMar 2, 2022
  13. Derrick StoleeMar 3, 2022
  14. Taylor BlauMar 3, 2022
  15. builtin/remote.c: show progress when renaming remote referencesTaylor Blau, Mar 2, 2022
  16. Ævar Arnfjörð BjarmasonMar 3, 2022
  17. 0/2 remote: show progress display when renamingTaylor Blau, Mar 3, 2022
  18. 1/2 builtin/remote.c: parse options in 'rename'Taylor Blau, Mar 3, 2022
  19. Ævar Arnfjörð BjarmasonMar 5, 2022
  20. 2/2 builtin/remote.c: show progress when renaming remote referencesTaylor Blau, Mar 3, 2022
  21. Junio C HamanoMar 3, 2022
  22. Taylor BlauMar 3, 2022
  23. Ævar Arnfjörð BjarmasonMar 5, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.