Skip to content

RFE: Persistent patch names through git trailers? #384

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

Closed
larsks opened this issue Nov 2, 2023 · 2 comments
Closed

RFE: Persistent patch names through git trailers? #384

larsks opened this issue Nov 2, 2023 · 2 comments

Comments

@larsks
Copy link
Contributor

larsks commented Nov 2, 2023

I'm often working on a single patch series on multiple systems, and find that as I move things back and forth I end up running something like stg branch --clean --force; stg uncommit -x -t upstream/main fairly often. This works fine, but an annoying side effect is that I lose any customized patch names.

What do you think about teaching stgit how to (optionally) read patch names from something like an x-stg-patch trailer in the commit message? So that if I have commit 1:

Change some configuration setting in production

x-stg-patch: change-setting-prod

And commit 2:

Change some configuration setting in development

x-stg-patch: change-setting-dev

If I run stg uncommit ... and it hits those commits, I get stg patches named change-setting-prod and change-setting-dev rather than change-some-configuration and change-some-configuration-1.

@jpgrayson
Copy link
Collaborator

What if this was captured out-of-band in a note (git-notes[1]) instead of trying to keep it in-band in the commit message?

I think we would want to use a StGit-specific notes refs; e.g. refs/notes/stgit instead of refs/notes/commits.

I note that there are several outstanding issues related to improving StGit's integration with git notes (#264, #263, #108) and may be the basis for a solution for others (#23, #70). So I see "doing more with notes" as the next likely area of StGit development.

Regarding the idea of using trailers for this purpose: I'm not in favor. Having x-stg-patch trailers leak into the wild and cause undue attention on the StGit project. A really important property of StGit is that it improves local git workflow, but without imposing anything on other git users, remote repos, forges, mailing lists, etc. Trailer litter would erode that property to some degree.

@larsks
Copy link
Contributor Author

larsks commented Nov 2, 2023

What if this was captured out-of-band in a note (git-notes[1]) instead of trying to keep it in-band in the commit message?

Notes won't work because they are associated with a specific commit id and don't follow when things get rebased.

A really important property of StGit is that it improves local git workflow, but without imposing anything on other git users, remote repos, forges, mailing lists, etc. Trailer litter would erode that property to some degree.

I understand where you're coming from; it's a bit like putting editor modelines in source code in that you're exposing aspects of your local development environment.

I still wish I could do something like this :).

@larsks larsks closed this as completed Dec 1, 2023
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