-
Notifications
You must be signed in to change notification settings - Fork 1
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
PatchSeries: add a signed-off-by line for the original author #1
base: main
Are you sure you want to change the base?
Conversation
Oh, I'm very sorry, I missed this PR somehow. This is the first time I'm seeing this. |
Seems my settings were wrong. I didn't get a message about your other PR from today either. |
@@ -938,6 +946,7 @@ export class PatchSeries { | |||
const args = [ | |||
"format-patch", "--thread", "--stdout", "--signature=ffmpeg-codebot", | |||
"--add-header=Fcc: Sent", | |||
"--signoff", "--zero-commit", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The local git identity where this runs is ffmpegagent@gmail.com, so it would add that to all messages.
What would be the purpose of adding --zero-commit
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It inserts the local identity, which we later replace with the original author identity before sending.
--zero-commit
is because we'll be modifying the commit message, which means any git hash is invalidated, so it's more correct to set it to all-zeroes. This doesn't really matter for most purposes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GGG is using commit hashes to relate things together like for example syncing comments on the ML back to the GitHub PR.
For example here:
gitgitgadget/lib/github-glue.ts
Lines 190 to 200 in fbf571c
* Add a Pull Request comment on a specific commit | |
* | |
* @param {string} pullRequestURL the Pull Request to comment on | |
* @param {string} commit the hash of the commit to comment on | |
* @param {string} comment the comment | |
* @returns the comment ID and the URL to the comment | |
*/ | |
public async addPRCommitComment(pullRequestURL: string, | |
commit: string, | |
gitWorkDir: string | undefined, | |
comment: string): |
let body = match[2]; | ||
if (thisAuthor) { | ||
let senderSignoff = `\nSigned-off-by: ${thisAuthor}\n`; | ||
let authorSignoff = `\nSigned-off-by: ${authorMatch[2]}\n`; | ||
let replaceText = (body.indexOf(authorSignoff) == -1) ? '\n' : authorSignoff; | ||
body = body.replace(senderSignoff, replaceText); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you show an example of what this is trying to solve?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the author already signed-off on the commit, then the signoff inserted by format-patch
is dropped. If they didn't, the inserted signoff is changed to refer to the author.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wouldn't it be easier to insert that line right away instead of going through format-patch --signoff
and replacing later?
I don't have a local setup to test this, but in theory it ought to work.