git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Make git status usage say git status instead of git commit
@ 2007-12-03  5:02 Shawn Bohrer
  2007-12-03  5:34 ` Junio C Hamano
  0 siblings, 1 reply; 6+ messages in thread
From: Shawn Bohrer @ 2007-12-03  5:02 UTC (permalink / raw)
  To: git; +Cc: gitster, Shawn Bohrer

git status shares the same usage information as git commit since it
shows what would be committed if the same options are given.  However,
when displaying the usage information for git status it should say it
is for git status not git commit.

Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>
---

As a side question, should the usage information also use the non dash
notation of the command since it is deprecated?  I noticed all of the
other commands are presently using the dash form, so I left it as is for
now.

 builtin-commit.c |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/builtin-commit.c b/builtin-commit.c
index f6e8e44..5e85a22 100644
--- a/builtin-commit.c
+++ b/builtin-commit.c
@@ -27,6 +27,11 @@ static const char * const builtin_commit_usage[] = {
 	NULL
 };
 
+static const char * const builtin_status_usage[] = {
+	"git-status [options] [--] <filepattern>...",
+	NULL
+};
+
 static unsigned char head_sha1[20], merge_head_sha1[20];
 static char *use_message_buffer;
 static const char commit_editmsg[] = "COMMIT_EDITMSG";
@@ -495,12 +500,12 @@ static void determine_author_info(struct strbuf *sb)
 	strbuf_addf(sb, "author %s\n", fmt_ident(name, email, date, 1));
 }
 
-static int parse_and_validate_options(int argc, const char *argv[])
+static int parse_and_validate_options(int argc, const char *argv[],
+				      const char * const usage[])
 {
 	int f = 0;
 
-	argc = parse_options(argc, argv, builtin_commit_options,
-			     builtin_commit_usage, 0);
+	argc = parse_options(argc, argv, builtin_commit_options, usage, 0);
 
 	if (logfile || message.len || use_message)
 		no_edit = 1;
@@ -597,7 +602,7 @@ int cmd_status(int argc, const char **argv, const char *prefix)
 
 	git_config(git_status_config);
 
-	argc = parse_and_validate_options(argc, argv);
+	argc = parse_and_validate_options(argc, argv, builtin_status_usage);
 
 	index_file = prepare_index(argc, argv, prefix);
 
@@ -689,7 +694,7 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
 
 	git_config(git_commit_config);
 
-	argc = parse_and_validate_options(argc, argv);
+	argc = parse_and_validate_options(argc, argv, builtin_commit_usage);
 
 	index_file = prepare_index(argc, argv, prefix);
 
-- 
1.5.3.6

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Make git status usage say git status instead of git commit
  2007-12-03  5:02 [PATCH] Make git status usage say git status instead of git commit Shawn Bohrer
@ 2007-12-03  5:34 ` Junio C Hamano
  2007-12-03 10:09   ` David Kastrup
  0 siblings, 1 reply; 6+ messages in thread
From: Junio C Hamano @ 2007-12-03  5:34 UTC (permalink / raw)
  To: Shawn Bohrer; +Cc: git, gitster

Shawn Bohrer <shawn.bohrer@gmail.com> writes:

> git status shares the same usage information as git commit since it
> shows what would be committed if the same options are given.  However,
> when displaying the usage information for git status it should say it
> is for git status not git commit.
>
> Signed-off-by: Shawn Bohrer <shawn.bohrer@gmail.com>

Thanks.  Will apply.

> As a side question, should the usage information also use the non dash
> notation of the command since it is deprecated?  I noticed all of the
> other commands are presently using the dash form, so I left it as is for
> now.

Wise choice.  We would probably want to clean them up at the same time
early post 1.5.4.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Make git status usage say git status instead of git commit
  2007-12-03  5:34 ` Junio C Hamano
@ 2007-12-03 10:09   ` David Kastrup
  2007-12-03 10:15     ` Florian Weimer
  2007-12-03 10:21     ` Miklos Vajna
  0 siblings, 2 replies; 6+ messages in thread
From: David Kastrup @ 2007-12-03 10:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Shawn Bohrer, git

Junio C Hamano <gitster@pobox.com> writes:

> Shawn Bohrer <shawn.bohrer@gmail.com> writes:
>
>> As a side question, should the usage information also use the non
>> dash notation of the command since it is deprecated?  I noticed all
>> of the other commands are presently using the dash form, so I left it
>> as is for now.
>
> Wise choice.  We would probably want to clean them up at the same time
> early post 1.5.4.

Deprecating the dash form will probably mean that we need to think up
(and document) a rationale for

  man git-commit

I actually have typed something like

  man git commit

a number of times already with obvious results.  Finger memory.

-- 
David Kastrup, Kriemhildstr. 15, 44793 Bochum

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Make git status usage say git status instead of git commit
  2007-12-03 10:09   ` David Kastrup
@ 2007-12-03 10:15     ` Florian Weimer
  2007-12-03 12:04       ` Eyvind Bernhardsen
  2007-12-03 10:21     ` Miklos Vajna
  1 sibling, 1 reply; 6+ messages in thread
From: Florian Weimer @ 2007-12-03 10:15 UTC (permalink / raw)
  To: git

* David Kastrup:

> Deprecating the dash form will probably mean that we need to think up
> (and document) a rationale for
>
>   man git-commit
>
> I actually have typed something like
>
>   man git commit
>
> a number of times already with obvious results.  Finger memory.

It's also a bit strange to have a git-commit(1) manpage when there is no
git-commit on the path.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Make git status usage say git status instead of git commit
  2007-12-03 10:09   ` David Kastrup
  2007-12-03 10:15     ` Florian Weimer
@ 2007-12-03 10:21     ` Miklos Vajna
  1 sibling, 0 replies; 6+ messages in thread
From: Miklos Vajna @ 2007-12-03 10:21 UTC (permalink / raw)
  To: David Kastrup; +Cc: Junio C Hamano, Shawn Bohrer, git

[-- Attachment #1: Type: text/plain, Size: 402 bytes --]

On Mon, Dec 03, 2007 at 11:09:24AM +0100, David Kastrup <dak@gnu.org> wrote:
> Deprecating the dash form will probably mean that we need to think up
> (and document) a rationale for
> 
>   man git-commit
> 
> I actually have typed something like
> 
>   man git commit
> 
> a number of times already with obvious results.  Finger memory.

that's why we have git help commit :)

- VMiklos

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Make git status usage say git status instead of git commit
  2007-12-03 10:15     ` Florian Weimer
@ 2007-12-03 12:04       ` Eyvind Bernhardsen
  0 siblings, 0 replies; 6+ messages in thread
From: Eyvind Bernhardsen @ 2007-12-03 12:04 UTC (permalink / raw)
  To: Florian Weimer; +Cc: git

On 3. des. 2007, at 11.15, Florian Weimer wrote:

> * David Kastrup:
>
>> Deprecating the dash form will probably mean that we need to think up
>> (and document) a rationale for
>>
>>   man git-commit
>>
>> I actually have typed something like
>>
>>   man git commit
>>
>> a number of times already with obvious results.  Finger memory.
>
> It's also a bit strange to have a git-commit(1) manpage when there  
> is no
> git-commit on the path.

No stranger than having a perlfunc(1) manpage.  bash-builtins is in  
section 7, maybe git-* should be moved there?  Of course, then git  
wouldn't have any manpages in section 1 at all.

Eyvind

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-12-03 12:05 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-03  5:02 [PATCH] Make git status usage say git status instead of git commit Shawn Bohrer
2007-12-03  5:34 ` Junio C Hamano
2007-12-03 10:09   ` David Kastrup
2007-12-03 10:15     ` Florian Weimer
2007-12-03 12:04       ` Eyvind Bernhardsen
2007-12-03 10:21     ` Miklos Vajna

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).