Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change in behavior: Text after --- now deleted #243

Closed
gwd opened this issue Dec 7, 2022 · 2 comments
Closed

Change in behavior: Text after --- now deleted #243

gwd opened this issue Dec 7, 2022 · 2 comments
Milestone

Comments

@gwd
Copy link

gwd commented Dec 7, 2022

When doing email-based development, it's not uncommon to put things after a --- line which you want to be in the patchbombed email, but not in the final commit. For instance:

Frob the googleblarf

<description>

Signed-off-by: Joe Smith <joe@smith.com>
---
I thought about blarfing the googlefrob as well; let me know if that's desired.

CC: Amanda Hug <hugz@gmail.com>
CC: Tom Thumb <tiny@carrot.net>

In this case there's a comment to reviewers, as well as people to automatically CC when sending the mail, none of which you want to be committed; because git am will automatically strip it.

It used to be that you could add this when doing a stg refresh, and it would remain; but now anything like that seems to be deleted on refresh -- making stackgit much less useful for email-based workflows.

$ stg version
Stacked Git 2.0.4
Copyright (C) 2005-2022 StGit authors
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
SPDX-License-Identifier: GPL-2.0-only
git version 2.38.1
@jpgrayson
Copy link
Collaborator

Thank you for this issue report, @gwd. Much appreciated.

Here's what I've found from a quick, initial triage:

StGit 1.5

  • stg edit -> --- in message works
  • stg edit -d -> --- is not captured in message
  • stg new -> --- in message works
  • stg new -v -> --- in message works

StGit 2.0

  • stg edit -> --- is not captured in message
  • stg edit -d -> --- is not captured in message
  • stg new -> --- is not captured in message
  • stg new -d -> --- is not captured in message

So it seems like a --- line and subsequent lines could be part of patch message in StGit 1.x, except with stg edit -d where the --- was used to separate the message from the diff. And in StGit 2.0, a --- line is always used to separate the diff from the message body.

I agree that this is a significant regression and needs to be fixed. I'm thinking the solution will be to use a comment-based separator (e.g. # ----- >8 -----) instead of --- to separate the patch message from the diff. There is precedence for this in git commit --verbose and stg new --verbose in StGit 1.x. Need to be careful to still respect --- as a separator in stg import though.

@jpgrayson jpgrayson added this to the 2.1 milestone Dec 8, 2022
@gwd
Copy link
Author

gwd commented Dec 9, 2022

Amazing, thanks all!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants