Re: [git pull] drm-next

2009-03-29 Thread Linus Torvalds


On Sun, 29 Mar 2009, Dave Airlie wrote:
 
 This branch has a merge in it, due to conflicts with the Intel drm tree 
 you already pulled. I've asked Eric to not send you direct pulls, he 
 mentioned you said he should, but it really screws over my tree. I don't 
 mind direct pulls outside the merge window as it usually smaller bug 
 fixes, but during the merge window the chances of it getting messy like 
 this tree has become just increase.

Qutie frankly, I don't like how you always rebased patches, so I'd _much_ 
rather see direct pulls than the alternative. And I can handle most merge 
issues, and will ask submaintainers to merge for me only if it gets really 
complicated.

If this encourages people to keep DRI drivers more modular and 
independent, that's all good.

Linus

--
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [git pull] drm-next

2009-03-29 Thread Dave Airlie

  This branch has a merge in it, due to conflicts with the Intel drm tree 
  you already pulled. I've asked Eric to not send you direct pulls, he 
  mentioned you said he should, but it really screws over my tree. I don't 
  mind direct pulls outside the merge window as it usually smaller bug 
  fixes, but during the merge window the chances of it getting messy like 
  this tree has become just increase.
 
 Qutie frankly, I don't like how you always rebased patches, so I'd _much_ 
 rather see direct pulls than the alternative. And I can handle most merge 
 issues, and will ask submaintainers to merge for me only if it gets really 
 complicated.
 
 If this encourages people to keep DRI drivers more modular and 
 independent, that's all good.

That's fine you only requested I stop rebasing Eric's tree since the last 
merge window, I haven't had to pull it since then to send to you. This 
merge there was 3 conflicts, I think they were mostly trivial, however 
there was also a warning fix in i915 for a return type not checked that 
no-one else picked up on.

I'm still awaiting Documentation/linus-rules-for-git-trees.txt. I'm sure 
every other maintainer who is just guessing what the rules are would 
appreciate it as well. We don't all have the time of Ingo to do a branch 
per patch with a scary octopus merge every few weeks.

My plans from now on are just to send you non-linear trees, whenever I 
merge a patch into my next tree thats when it stays in there, I'll pull 
Eric's tree directly into my tree and then I'll send the results, I 
thought we cared about a clean merge history but as I said without some 
document in the kernel tree I've up until now had no real idea what you 
wanted.

Dave.

--
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [git pull] drm-next

2009-03-29 Thread Linus Torvalds


On Sun, 29 Mar 2009, Dave Airlie wrote:

 My plans from now on are just to send you non-linear trees, whenever I 
 merge a patch into my next tree thats when it stays in there, I'll pull 
 Eric's tree directly into my tree and then I'll send the results, I 
 thought we cared about a clean merge history but as I said without some 
 document in the kernel tree I've up until now had no real idea what you 
 wanted.

I want clean history, but that really means (a) clean and (b) history.

People can (and probably should) rebase their _private_ trees (their own 
work). That's a _cleanup_. But never other peoples code. That's a destroy 
history

So the history part is fairly easy. There's only one major rule, and one 
minor clarification:

 - You must never EVER destroy other peoples history. You must not rebase 
   commits other people did. Basically, if it doesn't have your sign-off 
   on it, it's off limits: you can't rebase it, because it's not yours.

   Notice that this really is about other peoples _history_, not about 
   other peoples _code_. If they sent stuff to you as an emailed patch, 
   and you applied it with git am -s, then it's their code, but it's 
   _your_ history.

   So you can go wild on the git rebase thing on it, even though you 
   didn't write the code, as long as the commit itself is your private 
   one.

 - Minor clarification to the rule: once you've published your history in 
   some public site, other people may be using it, and so now it's clearly 
   not your _private_ history any more.

   So the minor clarification really is that it's not just about your 
   commit, it's also about it being private to your tree, and you haven't 
   pushed it out and announced it yet.

That's fairly straightforward, no?

Now the clean part is a bit more subtle, although the first rules are 
pretty obvious and easy:

 - Keep your own history readable

   Some people do this by just working things out in their head first, and 
   not making mistakes. but that's very rare, and for the rest of us, we 
   use git rebase etc while we work on our problems. 

   So git rebase is not wrong. But it's right only if it's YOUR VERY OWN 
   PRIVATE git tree.

 - Don't expose your crap.

   This means: if you're still in the git rebase phase, you don't push 
   it out. If it's not ready, you send patches around, or use private git 
   trees (just as a patch series replacement) that you don't tell the 
   public at large about.

It may also be worth noting that excessive git rebase will not make 
things any cleaner: if you do too many rebases, it will just mean that all 
your old pre-rebase testing is now of dubious value. So by all means 
rebase your own work, but use _some_ judgement in it.

NOTE! The combination of the above rules (clean your own stuff vs don't 
clean other peoples stuff) have a secondary indirect effect. And this is 
where it starts getting subtle: since you most not rebase other peoples 
work, that means that you must never pull into a branch that isn't already 
in good shape. Because after you've done a merge, you can no longer rebase 
you commits.

Notice? Doing a git pull ends up being a synchronization point. But it's 
all pretty easy, if you follow these two rules about pulling:

 - Don't merge upstream code at random points. 

   You should _never_ pull my tree at random points (this was my biggest 
   issue with early git users - many developers would just pull my current 
   random tree-of-the-day into their development trees). It makes your 
   tree just a random mess of random development. Don't do it!

   And, in fact, preferably you don't pull my tree at ALL, since nothing 
   in my tree should be relevant to the development work _you_ do. 
   Sometimes you have to (in order to solve some particularly nasty 
   dependency issue), but it should be a very rare and special thing, and 
   you should think very hard about it.

   But if you want to sync up with major releases, do a

git pull linus-repo v2.6.29

   or similar to synchronize with that kind of _non_random_ point. That 
   all makes sense. A Merge v2.6.29 into devel branch makes complete 
   sense as a merge message, no? That's not a problem.

   But if I see a lot of Merge branch 'linus' in your logs, I'm not 
   going to pull from you, because your tree has obviously had random crap 
   in it that shouldn't be there. You also lose a lot of testability, 
   since now all your tests are going to be about all my random code.

 - Don't merge _downstream_ code at random points either.

   Here the random points comment is a dual thing. You should not mege 
   random points as far as downstream is concerned (they should tell you 
   what to merge, and why), but also not random points as far as your tree 
   is concerned.

   Simple version: Don't merge unrelated downstream stuff into your own 
   topic branches.

   Slightly more complex version: Always have a _reason_ for merging 
   downstream stuff. That 

Re: [git pull] drm-next

2009-03-29 Thread Dave Airlie
 
 I want clean history, but that really means (a) clean and (b) history.
 
 People can (and probably should) rebase their _private_ trees (their own 
 work). That's a _cleanup_. But never other peoples code. That's a destroy 
 history
 
 So the history part is fairly easy. There's only one major rule, and one 
 minor clarification:
 
  - You must never EVER destroy other peoples history. You must not rebase 
commits other people did. Basically, if it doesn't have your sign-off 
on it, it's off limits: you can't rebase it, because it's not yours.
 
Notice that this really is about other peoples _history_, not about 
other peoples _code_. If they sent stuff to you as an emailed patch, 
and you applied it with git am -s, then it's their code, but it's 
_your_ history.
 
So you can go wild on the git rebase thing on it, even though you 
didn't write the code, as long as the commit itself is your private 
one.
 
  - Minor clarification to the rule: once you've published your history in 
some public site, other people may be using it, and so now it's clearly 
not your _private_ history any more.
 
So the minor clarification really is that it's not just about your 
commit, it's also about it being private to your tree, and you haven't 
pushed it out and announced it yet.
 
 That's fairly straightforward, no?
 
 Now the clean part is a bit more subtle, although the first rules are 
 pretty obvious and easy:
 
  - Keep your own history readable
 
Some people do this by just working things out in their head first, and 
not making mistakes. but that's very rare, and for the rest of us, we 
use git rebase etc while we work on our problems. 
 
So git rebase is not wrong. But it's right only if it's YOUR VERY OWN 
PRIVATE git tree.
 
  - Don't expose your crap.
 
This means: if you're still in the git rebase phase, you don't push 
it out. If it's not ready, you send patches around, or use private git 
trees (just as a patch series replacement) that you don't tell the 
public at large about.
 
 It may also be worth noting that excessive git rebase will not make 
 things any cleaner: if you do too many rebases, it will just mean that all 
 your old pre-rebase testing is now of dubious value. So by all means 
 rebase your own work, but use _some_ judgement in it.
 
 NOTE! The combination of the above rules (clean your own stuff vs don't 
 clean other peoples stuff) have a secondary indirect effect. And this is 
 where it starts getting subtle: since you most not rebase other peoples 
 work, that means that you must never pull into a branch that isn't already 
 in good shape. Because after you've done a merge, you can no longer rebase 
 you commits.
 
 Notice? Doing a git pull ends up being a synchronization point. But it's 
 all pretty easy, if you follow these two rules about pulling:
 
  - Don't merge upstream code at random points. 
 
You should _never_ pull my tree at random points (this was my biggest 
issue with early git users - many developers would just pull my current 
random tree-of-the-day into their development trees). It makes your 
tree just a random mess of random development. Don't do it!
 
And, in fact, preferably you don't pull my tree at ALL, since nothing 
in my tree should be relevant to the development work _you_ do. 
Sometimes you have to (in order to solve some particularly nasty 
dependency issue), but it should be a very rare and special thing, and 
you should think very hard about it.

The only case I can think off here, is when I send a tree of bug fixes to 
your tree during -rc and I want to make sure the drm-next tree is tested 
with those fixes applied to it. Is that an acceptable time to pull in your 
tree? Normally I rebase the drm-next tree on top of the drm-fixes tree so 
I know the testing is done with all known fixes in it, however it seems I 
should merge your tree at that point instead into drm-next.

Thanks for all this, its quite clear now, I should clean this mail up and 
put it into the kernel documentation.


Dave.

--
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel


Re: [git pull] drm-next

2009-03-29 Thread Linus Torvalds


On Mon, 30 Mar 2009, Dave Airlie wrote:
  
   - Don't merge upstream code at random points. 
  
 You should _never_ pull my tree at random points (this was my biggest 
 issue with early git users - many developers would just pull my current 
 random tree-of-the-day into their development trees). It makes your 
 tree just a random mess of random development. Don't do it!
  
 And, in fact, preferably you don't pull my tree at ALL, since nothing 
 in my tree should be relevant to the development work _you_ do. 
 Sometimes you have to (in order to solve some particularly nasty 
 dependency issue), but it should be a very rare and special thing, and 
 you should think very hard about it.
 
 The only case I can think off here, is when I send a tree of bug fixes to 
 your tree during -rc and I want to make sure the drm-next tree is tested 
 with those fixes applied to it.

I would actually prefer that in this case - especially if things merge 
cleanly and automatically - you still aim to not merge with me in your 
development branch.

But the test teh merged state is obviously a real issue, and it happens 
at other times than just during the -rc time. In fact, it happens most 
commonly long before you even want to send me any pull requests, simply 
because the merge window hasn't even opened yet.

So what's the solution? You want to merge for testing, yet I don't want to 
see random merges of the day in the development tree when I pull?

I suspect you can already see the solution coming when I put it that way: 
the best way is to simply create a test-branch, and do the merge there, 
and use _that_ branch for testing and for (for example) sending off to the 
linux-next repository which will combine it with yet other test branches.

But note: none of these rules should be absolutely black-and-white. 
Nothing in life ever is. Sometimes merging with my tree is simply the best 
option. If it's not your normal mode of operation, but an option in your 
toolbox that you end up using when everything else is just too painful, go 
ahead. 

Git does allow people to do many different things, and solve problems 
different ways. I just want all the regular workflows to be good 
practice, but then if you have to occasionally break the rules to solve 
some odd problem, go ahead and break the rules (and tell people why you 
did it that way this time).

 Thanks for all this, its quite clear now, I should clean this mail up and 
 put it into the kernel documentation.

Hey, good idea. We have some of that, but if you found the email useful, 
do feel free to turn it into real documentation.

Linus

--
--
___
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel