Skip to content

Conversation

@rcombs
Copy link
Collaborator

@rcombs rcombs commented Apr 17, 2022

I don't have a local setup to test this, but in theory it ought to work.

@softworkz
Copy link
Collaborator

Oh, I'm very sorry, I missed this PR somehow. This is the first time I'm seeing this.

@softworkz
Copy link
Collaborator

Seems my settings were wrong. I didn't get a message about your other PR from today either.

const args = [
"format-patch", "--thread", "--stdout", "--signature=ffmpeg-codebot",
"--add-header=Fcc: Sent",
"--signoff", "--zero-commit",
Copy link
Collaborator

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 [email protected], so it would add that to all messages.

What would be the purpose of adding --zero-commit?

Copy link
Collaborator Author

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.

Copy link
Collaborator

@softworkz softworkz Sep 20, 2022

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:

* 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):

Comment on lines +493 to +499
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);
}
Copy link
Collaborator

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?

Copy link
Collaborator Author

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.

Copy link
Collaborator

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?

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

Successfully merging this pull request may close these issues.

2 participants