[haiku-development] Re: GIT help

  • From: Ryan Leavengood <leavengood@xxxxxxxxx>
  • To: "haiku-development@xxxxxxxxxxxxx" <haiku-development@xxxxxxxxxxxxx>
  • Date: Wed, 3 Apr 2013 00:49:26 -0400

On Tue, Apr 2, 2013 at 8:48 PM, Pete Goodeve <pete.goodeve@xxxxxxxxxxxx> wrote:
> [I hadn't noticed that page before, but it is singularly unhelpful.
> For instance:
> " Now, you need to create the actual patch file that you can, for example, 
> attach to a ticket:
>    git format-patch <commitsha or branch name>"
>                                    ^^^^^  *What* is that supposed to be??]

Every commit in git has a name which is a SHA1 hash based on the
content of the commit and information about its parent commits. It is
really part of the whole thing which makes git able to be distributed.
The word commitsha refers to that.

> So then I did git "commit -m 'PatchBay revisions for Haiku'"
> and got:
> [work 5c0dede] PatchBay revisions for Haiku

The 5c0dede above is the shortened initial part of your commit SHA.

> I did: "git format-patch work "  (as that's the name of the current branch).
> It returned immediately with no error, but I can find *no* resulting patch

You need to provide some sort of commit range. Looking at the current
docs of git format-patch I don't see how one could use a branch name,
so I think the above documentation from our patch page is wrong.

Probably the easiest way for you to get a patch if you only have one
commit with your changes is:

git format-patch HEAD~1

That will provide a patch for the last commit (much like how you can
use the same HEAD~1 to get a diff of the last commit with git diff.)

> It's gotta be simpler that this...!

Git is a really nice tool once you learn it, much like Vim. But
neither would be called simple.


Other related posts: