* Pulling one commit at a time.
[not found] <F536B7C316F9474E9F7091239725AC9A02FA7F44@CHN-CL-MAIL01.mchp-main.com>
@ 2009-08-23 16:48 ` Sanjiv Gupta
2009-08-23 20:11 ` Alex Riesen
` (3 more replies)
0 siblings, 4 replies; 20+ messages in thread
From: Sanjiv Gupta @ 2009-08-23 16:48 UTC (permalink / raw)
To: git
Hi,
This is my first post here.
I just wanted to know how can I pull one commit at a time from public
repository.
e.g.
when I first cloned from the public repo, it was at X. now it
has reached Y. I just want to pull x+1.
how to do that?
In SVN, we can just do $ svn update -r next_rev_num
thanks
- Sanjiv
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-23 16:48 ` Pulling one commit at a time Sanjiv Gupta
@ 2009-08-23 20:11 ` Alex Riesen
2009-08-23 20:17 ` Adam Brewster
` (2 subsequent siblings)
3 siblings, 0 replies; 20+ messages in thread
From: Alex Riesen @ 2009-08-23 20:11 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: git
On Sun, Aug 23, 2009 at 18:48, Sanjiv Gupta<sanjiv.gupta@microchip.com> wrote:
> when I first cloned from the public repo, it was at X. now it has reached Y.
> I just want to pull x+1.
>
> how to do that?
Depending on what you mean, it maybe either the what Git already
does (a git fetch/git pull always transmits only the differences) or a
security risk and impossible (an ability to fetch an arbitrary commit
bypasses checks imposed by the reference names published).
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-23 16:48 ` Pulling one commit at a time Sanjiv Gupta
2009-08-23 20:11 ` Alex Riesen
@ 2009-08-23 20:17 ` Adam Brewster
2009-08-23 20:19 ` Sam Vilain
2009-08-23 21:07 ` Nanako Shiraishi
3 siblings, 0 replies; 20+ messages in thread
From: Adam Brewster @ 2009-08-23 20:17 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: git
On Sun, Aug 23, 2009 at 12:48 PM, Sanjiv
Gupta<sanjiv.gupta@microchip.com> wrote:
> Hi,
> This is my first post here.
> I just wanted to know how can I pull one commit at a time from public
> repository.
> e.g.
> when I first cloned from the public repo, it was at X. now it has reached Y.
> I just want to pull x+1.
>
> how to do that?
>
> In SVN, we can just do $ svn update -r next_rev_num
>
Git is a distributed system and handles branching much differently
than svn, so pull x+1 sounds like a funny request to git.
You could use `git fetch` to get the history from the remote
repository, then use `git log` or `gitk` to find the name of the
commit you're interested in, and use `git checkout` to switch to that
branch or `git merge` to merge the changes from the next commit into
your current branch.
Perhaps it would help if we knew why you only wanted to fetch one
commit at a time.
Adam
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-23 16:48 ` Pulling one commit at a time Sanjiv Gupta
2009-08-23 20:11 ` Alex Riesen
2009-08-23 20:17 ` Adam Brewster
@ 2009-08-23 20:19 ` Sam Vilain
2009-08-23 21:07 ` Nanako Shiraishi
3 siblings, 0 replies; 20+ messages in thread
From: Sam Vilain @ 2009-08-23 20:19 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: git
On Sun, 2009-08-23 at 22:18 +0530, Sanjiv Gupta wrote:
> Hi,
> This is my first post here.
> I just wanted to know how can I pull one commit at a time from public
> repository.
> e.g.
> when I first cloned from the public repo, it was at X. now it
> has reached Y. I just want to pull x+1.
>
> how to do that?
>
> In SVN, we can just do $ svn update -r next_rev_num
git pull or git pull --rebase
Why not find a tutorial or go through the user manual.
Sam
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-23 16:48 ` Pulling one commit at a time Sanjiv Gupta
` (2 preceding siblings ...)
2009-08-23 20:19 ` Sam Vilain
@ 2009-08-23 21:07 ` Nanako Shiraishi
2009-08-23 22:33 ` Junio C Hamano
2009-08-24 6:22 ` Sanjiv Gupta
3 siblings, 2 replies; 20+ messages in thread
From: Nanako Shiraishi @ 2009-08-23 21:07 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: git
Quoting Sanjiv Gupta <sanjiv.gupta@microchip.com>
> I just wanted to know how can I pull one commit at a time from public
> repository.
> e.g.
> when I first cloned from the public repo, it was at X. now it has
> reached Y. I just want to pull x+1.
When your histories look like this:
A your 'master'
/
---X---U---V---W---Y public 'master' (your 'origin')
instead of creating a single merge like this with "git pull":
A---------------M your 'master' (fully merges 'origin')
/ /
---X---U---V---W---Y public 'master'
you want to create a history like this?
A---J your 'master' (lacks V, W and Y)
/ /
---X---U---V---W---Y public 'master'
For that, you can fetch first.
git fetch origin
Then look at the history in gitk
gitk master origin
And find the commit you are interested in merging (U in the above picture). And merge it.
git merge origin~3
Replace "origin~3" in the example above with whatever commit you want to merge the entire history leading to it.
You can repeat this final step as many times you want. For example, if you want create a history like this:
A---J---K---L---M your 'master'
/ / / / /
---X---U---V---W---Y public 'master'
you can do so by repeating the last step for V, W and Y in turn.
In general the public history isn't necessarily a single straight line like this picture and it doesn't make sense to merge one at a time for all the commits on the public branch, but if that is what you really want to do, you can do so.
--
Nanako Shiraishi
http://ivory.ap.teacup.com/nanako3/
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-23 21:07 ` Nanako Shiraishi
@ 2009-08-23 22:33 ` Junio C Hamano
2009-08-24 6:22 ` Sanjiv Gupta
1 sibling, 0 replies; 20+ messages in thread
From: Junio C Hamano @ 2009-08-23 22:33 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: Nanako Shiraishi, git
Nanako Shiraishi <nanako3@lavabit.com> writes:
> When your histories look like this:
>
> A your 'master'
> /
> ---X---U---V---W---Y public 'master' (your 'origin')
>
> ... you can fetch first.
>
> git fetch origin
>
> Then look at the history in gitk
>
> gitk master origin
>
> And find the commit you are interested in merging (U in the above
> picture). And merge it.
>
> git merge origin~3
>
> Replace "origin~3" in the example above with whatever commit you want to
> merge the entire history leading to it.
A good description. Thanks, Nana.
Novice readers should notice the careful wording used here. She says
"merge the entire history leading to it" instead of simply "merge the
commit". Merging a commit in git always means merging the entire history
leading to that commit, so they mean the same thing to people who know git
well, but it avoids a misunderstanding that, if you did
$ git merge V
it might apply the effect of only V, ignoring what U did, on top of your
current state A. It doesn't.
A-------M your 'master'
/ /
---X---U---V---W---Y public 'master' (your 'origin')
To create a commit that has only the effect of a single commit, you would
need to cherry-pick it.
$ git cherry-pick V
will give you
A-------V' your 'master'
/
---X---U---V---W---Y public 'master' (your 'origin')
where "git diff A V'" is a moral equivalent of "git diff U V".
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-23 21:07 ` Nanako Shiraishi
2009-08-23 22:33 ` Junio C Hamano
@ 2009-08-24 6:22 ` Sanjiv Gupta
2009-08-24 7:46 ` Kai Blin
` (2 more replies)
1 sibling, 3 replies; 20+ messages in thread
From: Sanjiv Gupta @ 2009-08-24 6:22 UTC (permalink / raw)
To: Nanako Shiraishi; +Cc: git
Nanako Shiraishi wrote:
> Quoting Sanjiv Gupta <sanjiv.gupta@microchip.com>
>
>
>> I just wanted to know how can I pull one commit at a time from public
>> repository.
>> e.g.
>> when I first cloned from the public repo, it was at X. now it has
>> reached Y. I just want to pull x+1.
>>
>
> When your histories look like this:
>
> A your 'master'
> /
> ---X---U---V---W---Y public 'master' (your 'origin')
>
> instead of creating a single merge like this with "git pull":
>
> A---------------M your 'master' (fully merges 'origin')
> / /
> ---X---U---V---W---Y public 'master'
>
> you want to create a history like this?
>
> A---J your 'master' (lacks V, W and Y)
> / /
> ---X---U---V---W---Y public 'master'
>
> For that, you can fetch first.
>
> git fetch origin
>
> Then look at the history in gitk
>
> gitk master origin
>
> And find the commit you are interested in merging (U in the above picture). And merge it.
>
> git merge origin~3
>
> Replace "origin~3" in the example above with whatever commit you want to merge the entire history leading to it.
>
> You can repeat this final step as many times you want. For example, if you want create a history like this:
>
> A---J---K---L---M your 'master'
> / / / / /
> ---X---U---V---W---Y public 'master'
>
> you can do so by repeating the last step for V, W and Y in turn.
>
> In general the public history isn't necessarily a single straight line like this picture and it doesn't make sense to merge one at a time for all the commits on the public branch, but if that is what you really want to do, you can do so.
>
>
Excellent description. Thanks for that. I want to merge commits one by
one because I want to run a regression suite on each commit and
therefore know if any one is causing failures.
- Sanjiv
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 6:22 ` Sanjiv Gupta
@ 2009-08-24 7:46 ` Kai Blin
2009-08-24 7:55 ` Sanjiv Gupta
2009-08-24 10:22 ` David Aguilar
2009-08-24 18:19 ` Avery Pennarun
2 siblings, 1 reply; 20+ messages in thread
From: Kai Blin @ 2009-08-24 7:46 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: Nanako Shiraishi, git
[-- Attachment #1: Type: text/plain, Size: 2351 bytes --]
On Monday 24 August 2009 08:22:07 Sanjiv Gupta wrote:
> > In general the public history isn't necessarily a single straight line
> > like this picture and it doesn't make sense to merge one at a time for
> > all the commits on the public branch, but if that is what you really want
> > to do, you can do so.
>
> Excellent description. Thanks for that. I want to merge commits one by
> one because I want to run a regression suite on each commit and
> therefore know if any one is causing failures.
What I do for a case like this is using rebase. I'm not sure if I get the
explanation right enough to please all the git gurus on the list, but I'll
try. What this basically does is to back out all the commits you did on your
branch to the point you diverged from the branch you're rebasing on now.
So assuming you had a structure like this:
your 'master' HEAD
|
A---B---C
/
---X---U---V---W---Y
|
public 'master' HEAD
git would back out commits A-C, so your local branch HEAD would be at X. Then,
if forwards your branch to the branch you're rebasing on, so your local
branch HEAD is at Y now, like the public branch HEAD.
After that, git applies all of your patches back to your local branch,
producing a tree that looks like this:
your 'master' HEAD
|
A---B---C
/
---X---U---V---W---Y
|
public 'master' head
Personally I prefer that solution as it keeps the history linear. Of course
this means that all of your commits change sha1s, and you should not do this
on public branches with tags. But if you're still developing, it's much
easier to wrap your head around a history like this. It's also nice to
present feature branches to other people, as all of your commits are in one
block, without lots of annoying merge commits between them.
rebase also handles more complicated cases of merging, but from the way I
understood your issue, this should already help.
Cheers,
Kai
--
Kai Blin
WorldForge developer http://www.worldforge.org/
Wine developer http://wiki.winehq.org/KaiBlin
Samba team member http://www.samba.org/samba/team/
--
Will code for cotton.
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 7:46 ` Kai Blin
@ 2009-08-24 7:55 ` Sanjiv Gupta
2009-08-24 8:20 ` Sean Estabrooks
` (3 more replies)
0 siblings, 4 replies; 20+ messages in thread
From: Sanjiv Gupta @ 2009-08-24 7:55 UTC (permalink / raw)
To: Kai Blin; +Cc: Nanako Shiraishi, git
Kai Blin wrote:
> On Monday 24 August 2009 08:22:07 Sanjiv Gupta wrote:
>
>
>>> In general the public history isn't necessarily a single straight line
>>> like this picture and it doesn't make sense to merge one at a time for
>>> all the commits on the public branch, but if that is what you really want
>>> to do, you can do so.
>>>
>> Excellent description. Thanks for that. I want to merge commits one by
>> one because I want to run a regression suite on each commit and
>> therefore know if any one is causing failures.
>>
>
> What I do for a case like this is using rebase. I'm not sure if I get the
> explanation right enough to please all the git gurus on the list, but I'll
> try. What this basically does is to back out all the commits you did on your
> branch to the point you diverged from the branch you're rebasing on now.
>
> So assuming you had a structure like this:
>
> your 'master' HEAD
> |
> A---B---C
> /
> ---X---U---V---W---Y
> |
> public 'master' HEAD
>
> git would back out commits A-C, so your local branch HEAD would be at X. Then,
> if forwards your branch to the branch you're rebasing on, so your local
> branch HEAD is at Y now, like the public branch HEAD.
>
> After that, git applies all of your patches back to your local branch,
> producing a tree that looks like this:
>
> your 'master' HEAD
> |
> A---B---C
> /
> ---X---U---V---W---Y
> |
> public 'master' head
>
> Personally I prefer that solution as it keeps the history linear. Of course
> this means that all of your commits change sha1s, and you should not do this
> on public branches with tags. But if you're still developing, it's much
> easier to wrap your head around a history like this. It's also nice to
> present feature branches to other people, as all of your commits are in one
> block, without lots of annoying merge commits between them.
>
> rebase also handles more complicated cases of merging, but from the way I
> understood your issue, this should already help.
>
> Cheers,
> Kai
>
Thanks Kai.
What I would like is to "test *every* commit" available in the public
master. There would be no local changes or commits that aren't pushed in
the private copy.
So I just want to clone one copy from the public master and then just
keep pulling commits from the public master one by one and run
regressions on each one.
It's a damn simple thing in SVN world.
$ svn info will give you the current version you are at, assume it is
"cur_rev"
$ svn update -r `expr $cur_rev + 1`
$ build
$ test
Thanks,
- Sanjiv
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 7:55 ` Sanjiv Gupta
@ 2009-08-24 8:20 ` Sean Estabrooks
2009-08-24 8:20 ` Erik Faye-Lund
` (2 subsequent siblings)
3 siblings, 0 replies; 20+ messages in thread
From: Sean Estabrooks @ 2009-08-24 8:20 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: Kai Blin, Nanako Shiraishi, git
On Mon, 24 Aug 2009 13:25:22 +0530
Sanjiv Gupta <sanjiv.gupta@microchip.com> wrote:
Hi Sanjiv,
> What I would like is to "test *every* commit" available in the public
> master. There would be no local changes or commits that aren't pushed in
> the private copy.
> So I just want to clone one copy from the public master and then just
> keep pulling commits from the public master one by one and run
> regressions on each one.
There's no reason to ask for the commits from the public master one by
one. You can download them all in one operation. After that it is
a local operation to checkout each new commit and build-test it. This
is more efficient than needing a network operation to get each commit
individually.
As an aside, you might not really need to test each and every commit.
It is likely enough to just test the most recent commit since it is
built on top of all the commits that came before it. Essentially
you'd be testing all the new commits at once and only need to test
more commits (git bisect) if you found a regression with that first
test.
> It's a damn simple thing in SVN world.
With Git you have a complete local copy of the history. Once you're
up to date with remote master you can checkout each new commit at
your leisure pretty damn simply ;o)
Cheers,
Sean
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 7:55 ` Sanjiv Gupta
2009-08-24 8:20 ` Sean Estabrooks
@ 2009-08-24 8:20 ` Erik Faye-Lund
2009-08-24 8:22 ` Erik Faye-Lund
2009-08-24 8:28 ` Matthieu Moy
2009-08-24 8:33 ` skillzero
3 siblings, 1 reply; 20+ messages in thread
From: Erik Faye-Lund @ 2009-08-24 8:20 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: Kai Blin, Nanako Shiraishi, git
On Mon, Aug 24, 2009 at 9:55 AM, Sanjiv Gupta<sanjiv.gupta@microchip.com> wrote:
> It's a damn simple thing in SVN world.
> $ svn info will give you the current version you are at, assume it is
> "cur_rev"
> $ svn update -r `expr $cur_rev + 1`
> $ build
> $ test
I guess you could do it something like this. Unlike your example, this
processes all new commits, not just the next one.
$ git fetch origin master
$ for c in $(git rev-list HEAD..FETCH_HEAD); do
$ git checkout $c
$ build
$ test
$ done
$ git merge FETCH_HEAD
--
Erik "kusma" Faye-Lund
kusmabite@gmail.com
(+47) 986 59 656
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 8:20 ` Erik Faye-Lund
@ 2009-08-24 8:22 ` Erik Faye-Lund
0 siblings, 0 replies; 20+ messages in thread
From: Erik Faye-Lund @ 2009-08-24 8:22 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: Kai Blin, Nanako Shiraishi, git
> $ git merge FETCH_HEAD
Uhm, of course, you'd have to reattach HEAD to your branch before
merging. My bad ;)
--
Erik "kusma" Faye-Lund
kusmabite@gmail.com
(+47) 986 59 656
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 7:55 ` Sanjiv Gupta
2009-08-24 8:20 ` Sean Estabrooks
2009-08-24 8:20 ` Erik Faye-Lund
@ 2009-08-24 8:28 ` Matthieu Moy
2009-08-24 8:33 ` skillzero
3 siblings, 0 replies; 20+ messages in thread
From: Matthieu Moy @ 2009-08-24 8:28 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: Kai Blin, Nanako Shiraishi, git
Sanjiv Gupta <sanjiv.gupta@microchip.com> writes:
> What I would like is to "test *every* commit" available in the
> public master.
Then, you don't want to _merge_ each of them, you want to _fetch_ and
test each of them (Erik Faye-Lund's reply gives a solution for that).
Fetching is about getting existing commits from another repository,
while merging is about creating new commits.
--
Matthieu
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 7:55 ` Sanjiv Gupta
` (2 preceding siblings ...)
2009-08-24 8:28 ` Matthieu Moy
@ 2009-08-24 8:33 ` skillzero
2009-08-24 8:41 ` Matthieu Moy
3 siblings, 1 reply; 20+ messages in thread
From: skillzero @ 2009-08-24 8:33 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: Kai Blin, Nanako Shiraishi, git
On Mon, Aug 24, 2009 at 12:55 AM, Sanjiv
Gupta<sanjiv.gupta@microchip.com> wrote:
> What I would like is to "test *every* commit" available in the public
> master. There would be no local changes or commits that aren't pushed in the
> private copy.
> So I just want to clone one copy from the public master and then just keep
> pulling commits from the public master one by one and run regressions on
> each one.
>
> It's a damn simple thing in SVN world.
> $ svn info will give you the current version you are at, assume it is
> "cur_rev"
> $ svn update -r `expr $cur_rev + 1`
> $ build
> $ test
I'm not sure if this is the best way, but you can use git fetch to get
the latest stuff from the server without merging it then you can merge
from origin/master (i.e. the server) into your local master, one
commit at a time, and verify at each step:
$ git merge `git log --format=%h master..origin/master | sed '$!d'`
$ build
$ test
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 8:33 ` skillzero
@ 2009-08-24 8:41 ` Matthieu Moy
0 siblings, 0 replies; 20+ messages in thread
From: Matthieu Moy @ 2009-08-24 8:41 UTC (permalink / raw)
To: skillzero; +Cc: Sanjiv Gupta, Kai Blin, Nanako Shiraishi, git
skillzero@gmail.com writes:
> On Mon, Aug 24, 2009 at 12:55 AM, Sanjiv
> Gupta<sanjiv.gupta@microchip.com> wrote:
>
>> What I would like is to "test *every* commit" available in the public
>> master. There would be no local changes or commits that aren't pushed in the
>> private copy.
>> So I just want to clone one copy from the public master and then just keep
>> pulling commits from the public master one by one and run regressions on
>> each one.
>>
>> It's a damn simple thing in SVN world.
>> $ svn info will give you the current version you are at, assume it is
>> "cur_rev"
>> $ svn update -r `expr $cur_rev + 1`
>> $ build
>> $ test
>
> I'm not sure if this is the best way, but you can use git fetch to get
> the latest stuff from the server without merging it then you can merge
> from origin/master (i.e. the server) into your local master, one
> commit at a time, and verify at each step:
See my other reply, but I really don't think you want to _merge_ one
commit at a time. This would not mean "test each commit" but "test the
interaction between any two commits", which few people would care
about.
The example above in SVN doesn't merge each commit, it just walks
history (assuming the history is linear, the example wouldn't be as
simple if it had to walk /branches/* too). To continue the analogy,
merging commits one by one in Git would be more or less the equivalent
in SVN of:
$ svn status
# Hmm, OK, I have stuff to commit.
$ test
# Yes, it works. But do my changes work too on top of the previous
# commits?
$ while ...; do
svn update $(($cur_rev - 1))
build
test
done
# If so, then
$ svn update
$ svn commit
That is: test the interaction between your new change with any other
changes in the repository. 'never seen anyone interested by such
thing, but why not ;-).
--
Matthieu
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 6:22 ` Sanjiv Gupta
2009-08-24 7:46 ` Kai Blin
@ 2009-08-24 10:22 ` David Aguilar
2009-08-24 10:49 ` Sanjiv Gupta
2009-08-24 18:19 ` Avery Pennarun
2 siblings, 1 reply; 20+ messages in thread
From: David Aguilar @ 2009-08-24 10:22 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: Nanako Shiraishi, git
On Mon, Aug 24, 2009 at 11:52:07AM +0530, Sanjiv Gupta wrote:
> Excellent description. Thanks for that. I want to merge commits one by
> one because I want to run a regression suite on each commit and
> therefore know if any one is causing failures.
'git bisect' is your friend.
If your developers are disciplined and test each change as they
commit it then you're going to have fewer problems.
If they aren't, then make 'em send you patches. Then you can
at least 'git am' each one and run the tests at each step,
including the critical steps where you merge various topics
together.
I'm not sure what exactly you're trying to accomplish, though.
I'm just making guesses without you telling us more.
Are you trying to do post-mortem change-that-introduced-bug
finding (git bisect), commit-time bug prevention
(patch-based workflows, using git commit hooks to disallow
commits that fail the tests, etc), or is it something
completely different?
HTH,
--
David
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 10:22 ` David Aguilar
@ 2009-08-24 10:49 ` Sanjiv Gupta
2009-08-24 11:07 ` Matthieu Moy
0 siblings, 1 reply; 20+ messages in thread
From: Sanjiv Gupta @ 2009-08-24 10:49 UTC (permalink / raw)
To: David Aguilar; +Cc: Nanako Shiraishi, git
David Aguilar wrote:
> On Mon, Aug 24, 2009 at 11:52:07AM +0530, Sanjiv Gupta wrote:
>
>> Excellent description. Thanks for that. I want to merge commits one by
>> one because I want to run a regression suite on each commit and
>> therefore know if any one is causing failures.
>>
>
> 'git bisect' is your friend.
>
> If your developers are disciplined and test each change as they
> commit it then you're going to have fewer problems.
>
> If they aren't, then make 'em send you patches. Then you can
> at least 'git am' each one and run the tests at each step,
> including the critical steps where you merge various topics
> together.
>
> I'm not sure what exactly you're trying to accomplish, though.
> I'm just making guesses without you telling us more.
>
> Are you trying to do post-mortem change-that-introduced-bug
> finding (git bisect), commit-time bug prevention
> (patch-based workflows, using git commit hooks to disallow
> commits that fail the tests, etc), or is it something
> completely different?
>
>
> HTH,
>
>
Thanks everyone for the overwhelming response.
I was looking for post-mortem change-that-introduced-bug.
It's also called "buildbot" in other terms, which sends you an email
with the details of the "culprit" commit as soon as it introduces a bug.
- Sanjiv
-
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 10:49 ` Sanjiv Gupta
@ 2009-08-24 11:07 ` Matthieu Moy
0 siblings, 0 replies; 20+ messages in thread
From: Matthieu Moy @ 2009-08-24 11:07 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: David Aguilar, Nanako Shiraishi, git
Sanjiv Gupta <sanjiv.gupta@microchip.com> writes:
> I was looking for post-mortem change-that-introduced-bug.
If so, then you don't need to test every commit. As David mentionned,
"git bisect" is your friend, and will do a binary search, finding the
culprit commit much more efficiently (run the testsuite log(n) times
instead of n times).
OTOH, if you want some kind of quality insurance (i.e. check that
every commit is OK, including the case where a commit introduces a
bug, and the next one fixes it), bisect is rather helpless.
--
Matthieu
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 6:22 ` Sanjiv Gupta
2009-08-24 7:46 ` Kai Blin
2009-08-24 10:22 ` David Aguilar
@ 2009-08-24 18:19 ` Avery Pennarun
2009-08-24 19:08 ` Sanjiv Gupta
2 siblings, 1 reply; 20+ messages in thread
From: Avery Pennarun @ 2009-08-24 18:19 UTC (permalink / raw)
To: Sanjiv Gupta; +Cc: Nanako Shiraishi, git
On Mon, Aug 24, 2009 at 6:22 AM, Sanjiv Gupta<sanjiv.gupta@microchip.com> wrote:
> Excellent description. Thanks for that. I want to merge commits one by one
> because I want to run a regression suite on each commit and therefore know
> if any one is causing failures.
Hi Sanjiv,
'git bisect' is an even better way to do this, in my experience. I
wrote a program (http://github.com/apenwarr/gitbuilder/) that
automatically runs regression tests against all the new versions on
all the new branches. It then publishes the results on a web page and
via RSS.
gitbuilder does take a shortcut: if commit x passes and commit x+10
passes, it doesn't bother to test commit x+1..9. However, if x+10
fails, it bisects automatically to find the first commit that caused a
failure. You could disable this shortcut easily enough, however.
Have fun,
Avery
^ permalink raw reply [flat|nested] 20+ messages in thread
* Re: Pulling one commit at a time.
2009-08-24 18:19 ` Avery Pennarun
@ 2009-08-24 19:08 ` Sanjiv Gupta
0 siblings, 0 replies; 20+ messages in thread
From: Sanjiv Gupta @ 2009-08-24 19:08 UTC (permalink / raw)
To: Avery Pennarun; +Cc: Nanako Shiraishi, git
Avery Pennarun wrote:
> On Mon, Aug 24, 2009 at 6:22 AM, Sanjiv Gupta<sanjiv.gupta@microchip.com> wrote:
>
>> Excellent description. Thanks for that. I want to merge commits one by one
>> because I want to run a regression suite on each commit and therefore know
>> if any one is causing failures.
>>
>
> Hi Sanjiv,
>
> 'git bisect' is an even better way to do this, in my experience. I
> wrote a program (http://github.com/apenwarr/gitbuilder/) that
> automatically runs regression tests against all the new versions on
> all the new branches. It then publishes the results on a web page and
> via RSS.
>
> gitbuilder does take a shortcut: if commit x passes and commit x+10
> passes, it doesn't bother to test commit x+1..9.
Even, I won't need to run in between commits in that case.
What I wanted to do is to
1. off load this job to a script which sends an email to the developer
who broke something,
2. schedule that script
3. and sit back relaxed myself.
Looks like you already have the tool. Thanks.
BTW, git is not git, it's great.
thanks to everybody who replied.
- Sanjiv
> However, if x+10
> fails, it bisects automatically to find the first commit that caused a
> failure. You could disable this shortcut easily enough, however.
>
> Have fun,
>
> Avery
>
^ permalink raw reply [flat|nested] 20+ messages in thread
end of thread, other threads:[~2009-08-24 19:08 UTC | newest]
Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <F536B7C316F9474E9F7091239725AC9A02FA7F44@CHN-CL-MAIL01.mchp-main.com>
2009-08-23 16:48 ` Pulling one commit at a time Sanjiv Gupta
2009-08-23 20:11 ` Alex Riesen
2009-08-23 20:17 ` Adam Brewster
2009-08-23 20:19 ` Sam Vilain
2009-08-23 21:07 ` Nanako Shiraishi
2009-08-23 22:33 ` Junio C Hamano
2009-08-24 6:22 ` Sanjiv Gupta
2009-08-24 7:46 ` Kai Blin
2009-08-24 7:55 ` Sanjiv Gupta
2009-08-24 8:20 ` Sean Estabrooks
2009-08-24 8:20 ` Erik Faye-Lund
2009-08-24 8:22 ` Erik Faye-Lund
2009-08-24 8:28 ` Matthieu Moy
2009-08-24 8:33 ` skillzero
2009-08-24 8:41 ` Matthieu Moy
2009-08-24 10:22 ` David Aguilar
2009-08-24 10:49 ` Sanjiv Gupta
2009-08-24 11:07 ` Matthieu Moy
2009-08-24 18:19 ` Avery Pennarun
2009-08-24 19:08 ` Sanjiv Gupta
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).