Skip to contentSkip to conversation

wherefore art thou, git-applymbox? - Adding non-self signoffs

DISCUSSION Joel Becker 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

Junio, et al,
When git-applymbox disappeared, I didn't pay much attention. I
just learned git-am and went along. Little did I know, there was a trap laid.
The ocfs2-tools.git repository is maintained by the entire ocfs2
team. It's a "shared" style repo. A proposed change is posted to ocfs2-tools-devel, and when a teammate approves, they respond with a signoff. The author then adds the signoff to the patch and pushes to the shared repo.
We used to do this very easily with git-applymbox:
(from http://oss.oracle.com/osswiki/GitRepositories/ForMaintainers)

$ echo "Julie Hacker <[email protected]>" > /tmp/signoff
$ git branch to-push master
$ git checkout to-push
$ git format-patch -C -k --stdout master..workingbranch > /tmp/changes-to-push
$ git applymbox -k /tmp/changes-to-push /tmp/signoff
$ git push ssh://my.server.com/path/project.git to-push:master

The <signoff> file argument to applymbox allowed us to add the
approvers signoff to an entire series in one go. git-am does not have this feature. As far as I can tell, I have to edit each patch by hand to add the new signoff. Is there a better way?

Joel

Signature · 9 lines
Life's Little Instruction Book #356

	"Be there when people need you."

Joel Becker
Principal Software Developer
Oracle
E-mail: [email protected]
Phone: (650) 506-8127
#1 lore raw
Quoted 10 lines · Joel Becker

We used to do this very easily with git-applymbox:
(from http://oss.oracle.com/osswiki/GitRepositories/ForMaintainers)

$ echo "Julie Hacker <[email protected]>" > /tmp/signoff
$ git branch to-push master
$ git checkout to-push
$ git format-patch -C -k --stdout master..workingbranch > /tmp/changes-to-push
$ git applymbox -k /tmp/changes-to-push /tmp/signoff
$ git push ssh://my.server.com/path/project.git to-push:master
Quoted 4 lines

The <signoff> file argument to applymbox allowed us to add the
approvers signoff to an entire series in one go. git-am does not have this feature. As far as I can tell, I have to edit each patch by hand to add the new signoff. Is there a better way?

Heh, applymbox's removal is an ancient news. May 20 2007?

My reading of an old copy of git-applypatch seems to suggest that the above example you quoted is probably wrong anyway; shouldn't the first one be like this instead?

 $ echo "Signed-off-by: Julie Hacker <[email protected]>" >/tmp/signoff

It was actually a bug that applymbox allowed only a single e-mail address to be added without doing any sanity checking of the address with the author nor committer information.

If it were designed to allow adding sign-offs from other people, the command would have allowed more than one lines in the file. It did not. It was not designed for that purpose.

It was designed to allow one's own sign-off; it should have verified that it matched the committer identity. It did not. That was not strictly a bug for people who used the mechanism to sign their own patches anyway, but not checking meant a misuse like yours went unnoticed. Not quite ideal.

I guess you can run filter-branch to munge the commit messages after you run the

git format-patch ... | git am

pipeline to build the to-push branch.

I do not mind a patch to enhance "git am", but not before 1.5.4. Most likely the change would take a form of an extra parameter that names a script (or command) that gets the commit log message as its argument and edits it in any way it wants (in your case you would add the S-o-b: lines in that script).