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

Re: [PATCH] commit: make default of "cleanup" option configurable

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jan 9, 2013, 07:29 UTC
Message-ID
<20130109072952.GC6503@elie.Belkin>
In-Reply-To
<1357676176-30019-1-git-send-email-ralf.thielow@gmail.com>
Hi,
Ralf Thielow wrote:
> The default of the "cleanup" option in "git commit"
> is not configurable. Users who don't want to use the
> default have to pass this option on every commit since
> there's no way to configure it.

Could you give an example? I'm trying to get a sense of whether these habitual --cleanup= passers would use --cleanup=verbatim or --cleanup=strip.

I'm a bit worried that a setting like 'commit.cleanup = strip' would be likely to break scripts. Yes, scripts using "git commit" instead of commit-tree while caring about detailed semantics are asking for trouble, but I'm worried about importers, for example, which are sometimes written by new git users. Some scripts might assume that "git commit" preserves the entire change description from their source data, even when some lines happen to start by listing the ways the author is #1.

I don't think that necessarily rules out this change, but:
 1. We need more of an explanation of the purpose than "this lets
    people type less".  What workflow does setting this option fit
    into?
 2. I would prefer to see a little thought about whether it's possible
    to avoid silently impacting scripts.  E.g., depending on the
    answer to (1), maybe supporting "verbatim" but not "strip" would be
    ok?  Or alternatively, maybe a search of public code repositories
    would reveal that new git users tend to write their importers in a
    way that this doesn't break.

As a side effect, the information gathered to answer (1) and (2) could have the potential to make the user-level documentation more useful, by adding context to the description of the configuration item.

[...]
Show 8 quoted lines
> --- a/builtin/commit.c
> +++ b/builtin/commit.c
> @@ -103,7 +103,7 @@ static enum {
>  	CLEANUP_NONE,
>  	CLEANUP_ALL
>  } cleanup_mode;
> -static char *cleanup_arg;
> +const static char *cleanup_arg;

Style nit: storage class comes first, then the type. Otherwise the typename "const char *" is split up.

Hope that helps, Jonathan

Previous: Junio C HamanoNext: Ralf Thielow
Message 3 of 18 in “commit: make default of "cleanup" option configurable”
  1. commit: make default of "cleanup" option configurableRalf Thielow, Jan 8, 2013
  2. Junio C HamanoJan 8, 2013
  3. Jonathan NiederJan 9, 2013
  4. Ralf ThielowJan 9, 2013
  5. Jonathan NiederJan 9, 2013
  6. Junio C HamanoJan 9, 2013
  7. Junio C HamanoJan 9, 2013
  8. Re* [PATCH] commit: make default of "cleanup" option configurableJunio C Hamano, Jan 10, 2013
  9. Allow custom "comment char"Ralf Thielow, Jan 15, 2013
  10. Junio C HamanoJan 15, 2013
  11. Junio C HamanoJan 16, 2013
  12. Ralf ThielowJan 16, 2013
  13. Allow custom "comment char"Ralf Thielow, Jan 16, 2013
  14. Junio C HamanoJan 16, 2013
  15. Jens LehmannJan 16, 2013
  16. [PATCHv2] commit: make default of "cleanup" option configurableRalf Thielow, Jan 9, 2013
  17. Junio C HamanoJan 10, 2013
  18. [PATCHv3] commit: make default of "cleanup" option configurableRalf Thielow, Jan 10, 2013

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.