Re: [Openocd-development] git question.....

2011-10-25 Thread Christopher Harvey

On 25/10/11 07:57 PM, jim norris wrote:


I do the following...


git add file1.c
git commit file1.c
git push review

git add file2.c
git commit file2.c
git push review

git add file3.c
git commit file3.c
git push review

I then realize I made a mistake in file1.c so...

-- make the change
git add file1.c
git commit --amend file1.c

However, the comment message I see when I do the commit is
from the commit of file3.c. Is this okay? Or did I do something
wrong? I've noticed there's a -C option that indicates to pick
up information from a previous commit. Is that what should be
used?



afaik you can only change the last commit with amend. You'd need to do a 
commit like normal for the last file1.c change, then rebase all the (4) 
commits interactively and merge the last and 1st onesbut then again 
this wouldn't be the first time somebody pointed out to me some easier 
way to do the same thing with git.

___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] git question.....

2011-10-25 Thread Austin, Alex
Does file3 rely on file2, which relies on file1, or are they all
independent? If they're a sequence, then

git checkout -b temp HEAD~2
edit file1.c
git add file1.c
git commit --amend
git checkout original branch
git rebase temp
git push review

You don't need to do individual pushes for each commit, as the
sequence of commits leading up to the head of the branch off of trunk
will create a sequence of patches in Gerrit.

 -Original Message-
 From: openocd-development-boun...@lists.berlios.de [mailto:openocd-
 development-boun...@lists.berlios.de] On Behalf Of jim norris
 Sent: Tuesday, October 25, 2011 6:58 PM
 To: Openocd-development@lists.berlios.de
 Subject: [Openocd-development] git question.
 
 
 I do the following...
 
 
  git add file1.c
  git commit file1.c
  git push review
 
  git add file2.c
  git commit file2.c
  git push review
 
  git add file3.c
  git commit file3.c
  git push review
 
 I then realize I made a mistake in file1.c so...
 
  -- make the change
  git add file1.c
  git commit --amend file1.c
 
 However, the comment message I see when I do the commit is
 from the commit of file3.c. Is this okay? Or did I do something
 wrong? I've noticed there's a -C option that indicates to pick
 up information from a previous commit. Is that what should be
 used?
 
 
 ___
 Openocd-development mailing list
 Openocd-development@lists.berlios.de
 https://lists.berlios.de/mailman/listinfo/openocd-development
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] git question.....

2011-10-25 Thread Austin, Alex
Oh, that should be git rebase -I temp and remove the pick line for
the original commit, so that its replacement will be there instead.

 -Original Message-
 From: openocd-development-boun...@lists.berlios.de [mailto:openocd-
 development-boun...@lists.berlios.de] On Behalf Of Austin, Alex
 Sent: Tuesday, October 25, 2011 8:28 PM
 To: jim norris; Openocd-development@lists.berlios.de
 Subject: Re: [Openocd-development] git question.
 
 Does file3 rely on file2, which relies on file1, or are they all
 independent? If they're a sequence, then
 
   git checkout -b temp HEAD~2
   edit file1.c
   git add file1.c
   git commit --amend
   git checkout original branch
   git rebase temp
   git push review
 
 You don't need to do individual pushes for each commit, as the
 sequence of commits leading up to the head of the branch off of trunk
 will create a sequence of patches in Gerrit.
 
  -Original Message-
  From: openocd-development-boun...@lists.berlios.de [mailto:openocd-
  development-boun...@lists.berlios.de] On Behalf Of jim norris
  Sent: Tuesday, October 25, 2011 6:58 PM
  To: Openocd-development@lists.berlios.de
  Subject: [Openocd-development] git question.
 
 
  I do the following...
 
 
   git add file1.c
   git commit file1.c
   git push review
 
   git add file2.c
   git commit file2.c
   git push review
 
   git add file3.c
   git commit file3.c
   git push review
 
  I then realize I made a mistake in file1.c so...
 
   -- make the change
   git add file1.c
   git commit --amend file1.c
 
  However, the comment message I see when I do the commit is
  from the commit of file3.c. Is this okay? Or did I do something
  wrong? I've noticed there's a -C option that indicates to pick
  up information from a previous commit. Is that what should be
  used?
 
 
  ___
  Openocd-development mailing list
  Openocd-development@lists.berlios.de
  https://lists.berlios.de/mailman/listinfo/openocd-development
 ___
 Openocd-development mailing list
 Openocd-development@lists.berlios.de
 https://lists.berlios.de/mailman/listinfo/openocd-development
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development


Re: [Openocd-development] git question.....

2011-10-25 Thread Øyvind Harboe
Use interactive rebasing:

git rebase --help

When you're done rebasing, just type git push review and all the updated
patches will be updated in gerrit.

-- 
Øyvind Harboe - Can Zylin Consulting help on your project?
US toll free 1-866-980-3434
http://www.zylin.com/
___
Openocd-development mailing list
Openocd-development@lists.berlios.de
https://lists.berlios.de/mailman/listinfo/openocd-development