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

Re: [PATCH 3/3] commit: add --cleanup=scissors

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Feb 16, 2014, 03:44 UTC
Message-ID
<CAPig+cSwU5CEBZX7sBJnSvUo=sx=uC5qJx+9UwikqYWSgM7wMw@mail.gmail.com>
In-Reply-To
<1392521840-21628-4-git-send-email-pclouds@gmail.com>

On Sat, Feb 15, 2014 at 10:37 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:

Show 5 quoted lines
> Since 1a72cfd (commit -v: strip diffs and submodule shortlogs from the
> commit message - 2013-12-05) we have a less fragile way to cut out
> "git status" at the end of a commit message but it's only enabled for
> stripping submodule shortlogs. Add new cleanup option that reuses the
> same mechanism for the entire "git status" without accidentally remove
s/remove/removing/
Show 24 quoted lines
> lines starting with '#'
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
> ---
> diff --git a/Documentation/git-commit.txt b/Documentation/git-commit.txt
> index 1a7616c..98f976a 100644
> --- a/Documentation/git-commit.txt
> +++ b/Documentation/git-commit.txt
> @@ -176,7 +176,7 @@ OPTIONS
>  --cleanup=<mode>::
>         This option determines how the supplied commit message should be
>         cleaned up before committing.  The '<mode>' can be `strip`,
> -       `whitespace`, `verbatim`, or `default`.
> +       `whitespace`, `verbatim`, `scissors` or `default`.
>  +
>  --
>  strip::
> @@ -186,6 +186,11 @@ whitespace::
>         Same as `strip` except #commentary is not removed.
>  verbatim::
>         Do not change the message at all.
> +scissors::
> +       Same as `whitespace`, except that everything from the line
> +       "`# ------------------------ >8 ------------------------`"

Would it make sense to be more explicit and say that the 'cut' line is also removed?

    Same as `whitespace`, except that the line
    `# ------------------------ >8 ------------------------`
    and all lines following it are removed ...
> +       is truncated if the message is to be edited. "`#`" could be
s/could/can/
> +       customized with core.commentChar.
>  default::
>         Same as `strip` if the message is to be edited.
>         Otherwise `whitespace`.
Previous: Nguyễn Thái Ngọc DuyNext: Nguyễn Thái Ngọc Duy
Message 6 of 14 in “commit --cleanup=<scissors marker>”
  1. 0/3 commit --cleanup=<scissors marker>Nguyễn Thái Ngọc Duy, Feb 16, 2014
  2. 1/3 wt-status.c: make cut_lines[] const to shrink .data section a bitNguyễn Thái Ngọc Duy, Feb 16, 2014
  3. brian m. carlsonFeb 16, 2014
  4. 2/3 wt-status.c: move cut-line print code out to wt_status_add_cut_lineNguyễn Thái Ngọc Duy, Feb 16, 2014
  5. 3/3 commit: add --cleanup=scissorsNguyễn Thái Ngọc Duy, Feb 16, 2014
  6. Eric SunshineFeb 16, 2014
  7. 0/3 commit --cleanup=<scissors marker>Nguyễn Thái Ngọc Duy, Feb 17, 2014
  8. 1/3 wt-status.c: make cut_line[] const to shrink .data section a bitNguyễn Thái Ngọc Duy, Feb 17, 2014
  9. 2/3 wt-status.c: move cut-line print code out to wt_status_add_cut_lineNguyễn Thái Ngọc Duy, Feb 17, 2014
  10. 3/3 commit: add --cleanup=scissorsNguyễn Thái Ngọc Duy, Feb 17, 2014
  11. Duy NguyenFeb 22, 2014
  12. Junio C HamanoFeb 24, 2014
  13. Duy NguyenFeb 24, 2014
  14. Junio C HamanoFeb 25, 2014

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.