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

Re: [PATCH] git-rm: add --quiet option to suppress "rm 'file'" messages

From
Junio C Hamano <junkio@cox.net>
Date
Mar 26, 2007, 22:56 UTC
Message-ID
<7v8xdjvck7.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<1174904904.5662.8.camel@localhost>
Eric Lesh <eclesh@ucla.edu> writes:
Show 39 quoted lines
> Signed-off-by: Eric Lesh <eclesh@ucla.edu>
>
> ---
>
> On Sun, 2007-03-25 at 23:36 +0200, Johannes Schindelin wrote:
>> > Too bad, I find it rather annoying and irritating.
>> 
>> Why not do the common thing, and add a "--quiet" option? You can even add 
>> a config variable to enable it by default (for git-rm). It's not like 
>> git-rm is performance critical...
>
> Is something like this right?
>
>  builtin-rm.c |    7 +++++--
>  1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/builtin-rm.c b/builtin-rm.c
> index 00dbe39..d193fb0 100644
> --- a/builtin-rm.c
> +++ b/builtin-rm.c
> @@ -114,7 +114,7 @@ static struct lock_file lock_file;
>  int cmd_rm(int argc, const char **argv, const char *prefix)
>  {
>  	int i, newfd;
> -	int show_only = 0, force = 0, index_only = 0, recursive = 0;
> +	int show_only = 0, force = 0, index_only = 0, recursive = 0, quiet = 0;
>  	const char **pathspec;
>  	char *seen;
>  
> @@ -197,7 +199,8 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
>  	 */
>  	for (i = 0; i < list.nr; i++) {
>  		const char *path = list.name[i];
> -		printf("rm '%s'\n", path);
> +		if (!quiet)
> +			printf("rm '%s'\n", path);
>  
>  		if (remove_file_from_cache(path))
>  			die("git-rm: unable to remove %s", path);
I wonder how this would interact with show_only...
Previous: Eric LeshNext: Martin Waitz
Message 6 of 7 in “Re: [PATCH] Removed the printf("rm 'file'") from git-rm.”
  1. Junio C HamanoMar 25, 2007
  2. Anand KumriaMar 25, 2007
  3. Tilman SauerbeckMar 25, 2007
  4. Johannes SchindelinMar 25, 2007
  5. git-rm: add --quiet option to suppress "rm 'file'" messagesEric Lesh, Mar 26, 2007
  6. Junio C HamanoMar 26, 2007
  7. Martin WaitzMar 26, 2007

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.