# How to omit/alter the sigend-off line in a patch set?

2 messages from 2008-06-16 to 2008-06-16. Participants: Ian Brown, Jakub Narebski.
Thread: https://gitlist.dev/t/13975

## Ian Brown, 2008-06-16 10:24

Subject: How to omit/alter the sigend-off line in a patch set?
Message-ID: <d0383f90806160324j3f1b2a09tbb4caa1e934c7635@mail.gmail.com>
URL: https://gitlist.dev/e/d0383f90806160324j3f1b2a09tbb4caa1e934c7635%40mail.gmail.com

```
Hello,

  I am creating a patch set in this way:
I make a change in one file, than commit it. (git commit file1)
Then I make a change in a second file, than commit it. (git commit file1)
and so on.

Then I create a patch set thus:

git-format-patch -M -s -n -o patchdir origin

And a number of patch files are created, according to the number of commits
I had made.


Now, in each created patch file there is a line saying:
Signed-off-by: root <root@hostName.(none)>


Which is caused as I am doing this patches as root, and the machine name is
hostName (and the domain name is none).

Now, is there a way to cause git-format-patch to omit this
Signed-off-by: root <root@hostName.(none)> line ?
Or, altetnatively, is there a way to cause the git-format-patch to
generate a differnet
signed off by line (like signed off by ianbrn@gmail.com)?

I had tried using the --signoff option for  git-format-patch , in
these two ways,
but got an error:

git-format-patch --signoff=ianbrn@gmail.com -M -n -o patchdir origin
fatal: unrecognized argument: --signoff=ianbrn@gmail.com

git-format-patch --signoff ianbrn@gmail.com -M -n -o patchdir origin
fatal: ambiguous argument 'ianbrn@gmail.com': unknown revision or path
not in the working tree.
Use '--' to separate paths from revisions

I also tried to use the -a flag for commit
git-commit -a ianbrn@gmail.com
but again it did not help either.

Any ideas?

Any help will be appreciated,


Regards,
Ian

```

## Jakub Narebski, 2008-06-16 11:26

Subject: Re: How to omit/alter the sigend-off line in a patch set?
Message-ID: <m33andpqmi.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m33andpqmi.fsf%40localhost.localdomain
In-Reply-To: <d0383f90806160324j3f1b2a09tbb4caa1e934c7635@mail.gmail.com>

```
"Ian Brown" <ianbrn@gmail.com> writes:

> I am creating a patch set in this way:
>
> I make a change in one file, than commit it. (git commit file1)
> Then I make a change in a second file, than commit it. (git commit
> file1) and so on.

So you don't add Signed-off-by to yout commit.  If you plan on sharing
your work not only by sending patches, but by publishing your
repository somwehere, it would be better to signoff your commit, so
S-o-b is in "history", not only in mailing list archive...

This can be done by using '-s' option to git-commit, i.e.
  $ git commit -s file1
or by adding signoff to your commit template, if you use it.

By the way, usually one uses either
  $ git add file1; git commit
or
  $ git commit -a
(optionally with signoff).

> Then I create a patch set thus:
> 
> git-format-patch -M -s -n -o patchdir origin

Adding '-s | --signoff' option is what creates Signed-off-by line.

> And a number of patch files are created, according to the number of
> commits I had made.
> 
> 
> Now, in each created patch file there is a line saying:
> Signed-off-by: root <root@hostName.(none)>
> 
> 
> Which is caused as I am doing this patches as root, and the machine
> name is hostName (and the domain name is none).

WHY do you work as ROOT?

> Now, is there a way to cause git-format-patch to omit this
> Signed-off-by: root <root@hostName.(none)> line ?

Simply do not add '-s' option to git-format-patch, and if signoff line
was not present in commit, it wouldn't be present in patch.

> Or, altetnatively, is there a way to cause the git-format-patch to
> generate a different signed off by line (like signed off by
> ianbrn@gmail.com)?

You can configure git, either in repository config (.git/config),
or in your user config (~/.gitconfig) by adding the following

-- cut starts here --
[user]
	name  = Ian Brown
	email = ianbrn@gmail.com
-- cut ends here --

You can use git-config to set those config variables, but I think
editing simple ini-like text file is simpler.  But if you prefer,
there is scriptable solution:

  $ git config --global user.name "Ian Brown"
  $ git config --global user.email ianbrn@gmail.com

> I had tried using the --signoff option for git-format-patch, in
> these two ways, but got an error:
> 
> git-format-patch --signoff=ianbrn@gmail.com -M -n -o patchdir origin
> fatal: unrecognized argument: --signoff=ianbrn@gmail.com

According to git-format-patch(1) manpage the --signoff option does not
accept any parameters.  It always uses committer identity of yourself.

> I also tried to use the -a flag for commit
>   $ git-commit -a ianbrn@gmail.com
> but again it did not help either.

Please, please read the documentation.  git-commit -a has _nothing_ to
do with signoff...

-- 
Jakub Narebski
Poland
ShadeHawk on #git

```
