[haiku-development] Re: GIT help

  • From: Pete Goodeve <pete.goodeve@xxxxxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Wed, 3 Apr 2013 17:49:31 -0700

Summarizing and responding to all your answers -- thanks!

On Wed, Apr 03, 2013 at 12:49:26AM -0400, Ryan Leavengood wrote:
> On Tue, Apr 2, 2013 at 8:48 PM, Pete Goodeve <pete.goodeve@xxxxxxxxxxxx> 
> wrote:
> >
> >    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.
> The word commitsha refers to that.

Ahh, OK.  I think a little more in-place documentation would help, though! (:-/)
(I hadn't got deep enough in GIT documentation to have the faintest clue...)
> 
> 
> > I did: "git format-patch work " 
> 
> 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.

I would say it is definitely wrong! Some knowledgeable individual should
do some rewriting, as this is apparently important information!

> 
> 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.)

Ahh, yes.  That worked ([once I read that correctly as '~', not '-'!]

After digging deeper into a user manual I found (see below), I saw the
example 'git format-patch origin', which also worked, but I'll have to
revisit the basics to find out exacly what 'origin' represents.

An even simpler command that worked for me (from another place in
the manual) was 'git format-patch -1'.
> 
> 
> Git is a really nice tool once you learn it, much like Vim. But
> neither would be called simple.
I dunno -- never had this much trouble with vim (:-/)  [emacs on the
other hand...]
>
--------------
> 
On Wed, Apr 03, 2013 at 09:46:48AM +0100, Simon Taylor wrote:
> On 03/04/2013 01:48, Pete Goodeve wrote:
> >
> >On Ingo's suggestion I moved the patchbay directory myself from
> >  .../src/tests/kits/midi to .../src/apps, modified all the relevant 
> >  jamfiles,
> >and checked that it compiled.
> 
> >It worries me a bit that some files are "renamed" and others are 
> >"deleted/new file", [...]
> 
> Ingo did say to do it in a separate commit [...]
> 
> If you had committed just the modifications first (git commit -m "Update 
> PatchBay coding standards, use Haiku Tooltips") and followed that by 
> moving the files then git would have found it easier to track them all 
> as renames.

Ingo's point flew by me, because I'm not used to the whole scheme,
but it looks as if the patch I finally managed to create is good enough.
If I understand correctly, the patch would *still* have to include both
the full 'new' (i.e. moved) text, and the old 'deleted' text in the old
location, so a two-stage commit would have had about the same
result.
> 
> It looks like you're trying to use the SVN workflow
Not really -- never got particularly familiar with that either.  I'm just not
that used to the concept of "committing", I guess.
>
--------------------------- 
> 
On Wed, Apr 03, 2013 at 10:19:51AM -0500, Alexander von Gluck IV wrote:
> 
> This is how I got so good at git:
>   https://peepcode.com/products/git
>   https://peepcode.com/products/advanced-git
Looks like you have to fork over cash for those.
I don't feel I should need to do that...(:-/) 

I have been using some sources from the web:
  http://www.siteground.com/tutorials/git/commands.htm
  -- which i made a local copy of, and initially gave me seemingly good basic 
info.
    But it doesn't even *mention* format-patch!
It links to the full docs, though, at:
  https://www.kernel.org/pub/software/scm/git/docs/
  -- where everything is described, but not in a form that I can always easily
  digest!  (Including the long page on format-patch)
 this in turn links to a user manual (where I got a bit of help):
  https://www.kernel.org/pub/software/scm/git/docs/user-manual.html
> 
> 
> I also made this for the git page:
> http://www.haiku-os.org/guides/building/get-source-git
> 
> At the bottom there is a nice little info graphic covering the larger 
> picture basic  development model.

There's no mention of format-patch on that page, though.

> 
> Sorry you're having so much trouble, once you learn the power of git 
> though you'll hate using svn and cvs :)

Never had any affection for them, either... (:-))

Thanks, all.

        -- Pete --


Other related posts: