3

I have a project where I made changes, and want to send them to another user, using git send-email feature.

I found that it works by sending patches (created by git format-patch of each commit).

Is it able to send just diff's ? I don't want to commit first, and then send the patch.

Does git format-patch or maybe send-email have some parameter to just do that quickly?

Thanks in advance.

parsley72
  • 8,449
  • 8
  • 65
  • 98
Gabriel L. Oliveira
  • 3,922
  • 6
  • 31
  • 40

1 Answers1

4

It turns out not to be possible. So I commited and tried to send-email it, which throws an error

Command unknown: 'AUTH' at /usr/lib/git-core/git-send-email

This error is related to my smtp-server not supporting authentication.

To solve this, I commented the line in my .gitconfig where it says smtpuser, so that it doesn't pass any user or password to git. Then, the email gets sent without a problem.

But I still think that should have an option to use send-email feature, sending a patch without having to commit it first.

Matti Lyra
  • 12,828
  • 8
  • 49
  • 67
Gabriel L. Oliveira
  • 3,922
  • 6
  • 31
  • 40
  • I suspect this is a conscious design decision as git usually tries very hard not to lose any of your code. Imagine you sent out the diff without committing, and then changed something. Now the person looking at the diff is actually looking at an inconsistent state of your repo because the source of the diff is no longer there. – Matti Lyra Nov 17 '12 at 16:29
  • The logic of send-email is to send a couple of commits with sensible commit messages. If you want to send a diff, you can simply use `git diff | mail`. It's so easy to create a commit, though that I don't think this is an issue at all. – Pavel Šimerda Apr 13 '15 at 11:51