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

Re: [PATCH 1/2] Suggest use of 'git add' when 'nothing to commit' gets shown.

From
Andreas Ericsson <ae@op5.se>
Date
Dec 15, 2006, 09:11 UTC
Message-ID
<458266D4.5050301@op5.se>
In-Reply-To
<20061215001350.GA26755@spearce.org>
Shawn O. Pearce wrote:
>  else
>  	if [ -z "$(git-ls-files)" ]; then
> -		echo >&2 Nothing to commit
> +		echo >&2 "Nothing to commit (use \"git add\" include for commit)"
s/git add include/git add to include/
Show 13 quoted lines
>  		exit 1
>  	fi
>  	PARENTS=""
> diff --git a/wt-status.c b/wt-status.c
> index 6e9414d..f9ed54f 100644
> --- a/wt-status.c
> +++ b/wt-status.c
> @@ -163,7 +163,7 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q,
>  	int i;
>  	if (q->nr)
>  		wt_status_print_header("Changed but not updated",
> -				"use git-add on files to include for commit");
> +				"use \"git add\" on files to include for commit");

Here it's "on files", whereas in other threads people have stated that git add adds content, so perhaps

use \"git add file1 file2\" to include for commit
which also gives a nice "simplest-possible-usage" message.
>  		if (!shown_header) {
>  			wt_status_print_header("Untracked files",
> -				"use \"git add\" to add to commit");
> +				"use \"git add\" on files to include for commit");
Same here.
Show 5 quoted lines
>  	if (!s->commitable)
> -		printf("%s\n", s->amend ? "# No changes" : "nothing to commit");
> +		printf("%s (use \"git add\" include for commit)\n",
> +			s->amend ? "# No changes" : "Nothing to commit");
>  }
This is same as first one (missing "to " before "include").
It would probably be nice to use one and the same message everywhere though.
-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Previous: Shawn O. PearceNext: Shawn Pearce
Message 2 of 3 in “Suggest use of 'git add' when 'nothing to commit' gets shown.”
  1. 1/2 Suggest use of 'git add' when 'nothing to commit' gets shown.Shawn O. Pearce, Dec 15, 2006
  2. Andreas EricssonDec 15, 2006
  3. Shawn PearceDec 15, 2006

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.