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

Re: [PATCH] Cleanup cogito command usage reporting

From
Petr Baudis <pasky@ucw.cz>
Date
May 30, 2005, 08:45 UTC
Message-ID
<20050530084558.GE1036@pasky.ji.cz>
In-Reply-To
<20050530030521.GA13232@diku.dk>

Dear diary, on Mon, May 30, 2005 at 05:05:21AM CEST, I got a letter where Jonas Fonseca <fonseca@diku.dk> told me that...

Show 5 quoted lines
> [ Sorry for the resend. This should bring all usage strings in sync. I
>   forgot to add the new options. ]
> 
>  - Synchronize usage strings with those in cg-help. The command
>    identifiers are still not as descriptive, though.

Ok, I'll focus on this point (the rest seems fine). I think it's inferior this way, since you are losing information, and for no benefit.

Show 12 quoted lines
> diff --git a/cg-clone b/cg-clone
> --- a/cg-clone
> +++ b/cg-clone
> @@ -15,11 +15,12 @@
> -USAGE="cg-clone [-s] LOCATION [<directory>]"
> +USAGE="cg-clone [-s] LOCATION [DESTINATION]"
> @@ -30,7 +31,7 @@ if [ "$1" = "-s" ]; then
>  fi
>  
>  location=$1
> -[ "$location" ] || die "usage: cg-clone [-s] SOURCE_LOC [DESTDIR]"
> +[ "$location" ] || usage

LOCATION -> SOURCE_LOC is fine in this context (if we would ever want DEST_LOC, it would be better to stick with SOURCE_LOC, though). But DESTDIR->DESTINATION is losing information. In cogito.txt you describe DESTINATION as a general target location, but it's really a directory here. And it's shorter.

Show 9 quoted lines
> diff --git a/cg-export b/cg-export
> --- a/cg-export
> +++ b/cg-export
> @@ -22,7 +22,7 @@ USAGE="cg-export DESTINATION [TREE]"
>  dest=$1
>  id=$(tree-id $2)
>  
> -([ "$dest" ] && [ "$id" ]) || die "usage: cg-export DEST [TREE_ID]"
> +([ "$dest" ] && [ "$id" ]) || usage

I'm for DESTDIR here too, and what harm does the _ID part make here? I think it's non-obvious otherwise - "TREE" can be understood as some directory name too.

Show 12 quoted lines
> diff --git a/cg-help b/cg-help
> --- a/cg-help
> +++ b/cg-help
> @@ -43,7 +43,7 @@ Available commands:
>  	cg-export	DEST [TREE_ID]
>  	cg-help		[COMMAND]
>  	cg-init
> -	cg-log		[-c] [-f] [-m] [-r FROM_ID[:TO_ID]] [FILE]...
> +	cg-log		[-c] [-f] [-m] [-uUSERNAME] [-r FROM_ID[:TO_ID]] [FILE]...
>  	cg-ls		[TREE_ID]
>  	cg-merge	[-c] [-b BASE_ID] FROM_ID
>  	cg-mkpatch	[-m] [-s] [-r FROM_ID[:TO_ID]]

So what about bringing those in sync too? (Or alternatively letting it be now and build the output dynamically in another patch.)

Show 9 quoted lines
> diff --git a/cg-merge b/cg-merge
> --- a/cg-merge
> +++ b/cg-merge
> @@ -38,11 +38,11 @@ fi
>  base=
>  if [ "$1" = "-b" ]; then
>  	shift
> -	[ "$1" ] || die "usage: cg-merge [-c] [-b BASE_ID] FROM_ID"
> +	[ "$1" ] || usage

I think BASE_ID->REVISION is loosing information too. What about BASE_COMMIT or something?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
C++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor
Previous: Jonas FonsecaNext: Jonas Fonseca
Message 3 of 4 in “Cleanup cogito command usage reporting”
  1. Cleanup cogito command usage reportingJonas Fonseca, May 30, 2005
  2. Jonas FonsecaMay 30, 2005
  3. Petr BaudisMay 30, 2005
  4. Jonas FonsecaMay 31, 2005

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.