git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* rebase has no --cleanup option
@ 2023-03-24 12:11 Дилян Палаузов
  2023-03-24 12:52 ` Kristoffer Haugsbakk
  0 siblings, 1 reply; 2+ messages in thread
From: Дилян Палаузов @ 2023-03-24 12:11 UTC (permalink / raw)
  To: git

Hello,

in rare cases I want to write commit messages with leading # sign and 
for these messages I call “git commit --cleanup==whitespace”.  So far, 
so good.

Now I want to rebase - modify (edit) the commit message of an old 
commit, or squash a commit, which has leading # in its comment.  I 
cannot pass --cleanup=whitespace and this is the problem description 
here — the #-lines disappear after rebase (edit/squash operations).

In theory I could set the commit.cleanup configuration parameter (in 
.gitconfig), but I prefer not to do this, as I do not want to disable 
permanently the stripping of lines with leading # in git commit 
messages.

Please add --cleanup= option to the rebase command.

I use here the command-line git client 2.39.2, not a GUI or whatsoever.

Kind regards
   Дилян

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: rebase has no --cleanup option
  2023-03-24 12:11 rebase has no --cleanup option Дилян Палаузов
@ 2023-03-24 12:52 ` Kristoffer Haugsbakk
  0 siblings, 0 replies; 2+ messages in thread
From: Kristoffer Haugsbakk @ 2023-03-24 12:52 UTC (permalink / raw)
  To: Дилян Палаузов
  Cc: git

Hi Дилян

On Fri, Mar 24, 2023, at 13:11, Дилян Палаузов wrote:
> Hello,
>
> in rare cases I want to write commit messages with leading # sign

Have you considered changing your `commentchar` to something else that
you never use as a leading character in the message proper? For example
`%`:

    [core]
            commentchar = %

Looks like:

    git: temporary for demonstration

    % Please enter the commit message for your changes. Lines starting
    % with '%' will be ignored, and an empty message aborts the commit.
    %
    % Date:      Fri Mar 24 13:45:28 2023 +0100
    %
    % On branch master
    % Your branch is ahead of '<remote branch>' by 57 commits.
    %   (use "git push" to publish your local commits)
    %
    % Changes to be committed:
    %	modified:   config/.config/git/config
    %
    % Untracked files:
    %	config/.config/git/gitk
    %

That’s at least what I would do if I used leading `#` since it seems
like less trouble than having to change `cleanup`.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-24 12:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-24 12:11 rebase has no --cleanup option Дилян Палаузов
2023-03-24 12:52 ` Kristoffer Haugsbakk

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).