From: Johannes Schindelin Date: Tue, 27 Nov 2007 11:18:38 GMT Subject: Re: [PATCH] builtin-commit: add --cached to operate only on index Message-ID: In-Reply-To: <81b0412b0711270254i58be4d2fi5021767d99fcb753@mail.gmail.com> Hi, [commenting on the patch is a little cumbersome when the mailer does not quote it for you...] On Tue, 27 Nov 2007, Alex Riesen wrote: @@ -550,6 +557,8 @@ static int parse_and_validate_options(int argc, const char *argv[]) free(enc); } + if (all) + cached_only = 0; if (!!also + !!only + !!all + !!interactive > 1) die("Only one of --include/--only/--all/--interactive can be used."); if (argc == 0 && (also || (only && !amend))) My reply> I would rather add another !!cached_only to the existing if(). @@ -678,7 +688,8 @@ int cmd_commit(int argc, const char **argv, const char *prefix) } if (!prepare_log_message(index_file, prefix) && !in_merge) { - run_status(stdout, index_file, prefix); + if (!cached_only) + run_status(stdout, index_file, prefix); rollback_index_files(); unlink(commit_editmsg); return 1; My reply> Would it not make more sense to avoid run_status() when no_edit? My reply> Ciao, My reply> Dscho