git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* git-rev-tree
@ 2005-11-08  2:12 Dave Jones
  2005-11-08  2:33 ` git-rev-tree Linus Torvalds
  2005-11-08  4:55 ` git-rev-tree Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: Dave Jones @ 2005-11-08  2:12 UTC (permalink / raw)
  To: git

Can someone remind me what the deprecated git-rev-tree command did,
or how this should be fixed up to use newer git commands?

I'm trying to get git-changes-script working, but all the
variants I've found on the web use this deprecated tool.

Any clues ?

		Dave

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git-rev-tree
  2005-11-08  2:12 git-rev-tree Dave Jones
@ 2005-11-08  2:33 ` Linus Torvalds
  2005-11-08  2:57   ` git-rev-tree Dave Jones
  2005-11-08  4:55 ` git-rev-tree Junio C Hamano
  1 sibling, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2005-11-08  2:33 UTC (permalink / raw)
  To: Dave Jones; +Cc: git



On Mon, 7 Nov 2005, Dave Jones wrote:
>
> Can someone remind me what the deprecated git-rev-tree command did,
> or how this should be fixed up to use newer git commands?

It was basically the same as "git-rev-list", except:

 - it output the date (as a raw number) in front, so pretty much everybody 
   ended up using "cut" to remove it, sometimes after sorting the output 
   numerically.

   Sorting numerically is unnecessary with git-rev-list, since the output 
   is already sorted (not necessarily exactly by date, but by "recency" 
   and/or by other even stricter sorting rules)

 - it was limited to a certain number of heads maximum (I forget, but I 
   think it was 16).

 - it parsed the whole tree before outputting anything.

> I'm trying to get git-changes-script working, but all the
> variants I've found on the web use this deprecated tool.

The git-changes-script was pretty broken.

You're _much_ better off doing it by:

 - fetch the "remote" branch into the local repository. The 
   "git-changes-script" thing required that you fetch the remote branch 
   into _another_ repository, but still local. These days, just use a 
   local branch in the same repo.

   So, for example, tracking my tree

	export KERNEL=master.kernel.org:/pub/scm/linux/kernel/git/
	git fetch $KERNEL/torvalds/linux-2.6 master:linus

   which will just fetch my "master" branch into the local "linus" branch.

 - then just do

	git log linus..HEAD

   and you'll see exactly what you wanted: what exists in your HEAD but 
   not in mine.

No complex script required.

Now, I've told some people that the diffstat is just the same (ie using a 
simple "git diff linus..HEAD | git-apply --stat") but that was because 
I've been muching some really awesomely bad 'shrooms. Clearly that doesn't 
work well at all, since it will show all the stuff I have in my branch 
reversed (since your head doesn't have it). 

The way to get a diff is really to do a merge, and throw the merge away 
after creating the diff. Ie something like this should work:

	git checkout -b merge-branch
	git merge "dummy merge" master linus &&
		git-diff linus.. | git-apply --stat
	git checkout -f master
	git branch -D merge-branch

which will also tell you if the merge failed (in which case you might not 
want to send me a "please pull", but instead try the merge locally and fix 
it up, and then try again)

All of the above is obviously totally untested.

		Linus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git-rev-tree
  2005-11-08  2:33 ` git-rev-tree Linus Torvalds
@ 2005-11-08  2:57   ` Dave Jones
  2005-11-08  3:35     ` git-rev-tree Linus Torvalds
  0 siblings, 1 reply; 6+ messages in thread
From: Dave Jones @ 2005-11-08  2:57 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

On Mon, Nov 07, 2005 at 06:33:30PM -0800, Linus Torvalds wrote:

 > 	export KERNEL=master.kernel.org:/pub/scm/linux/kernel/git/
 > 	git fetch $KERNEL/torvalds/linux-2.6 master:linus
 > 
 >    which will just fetch my "master" branch into the local "linus" branch.
 > 
 >  - then just do
 > 
 > 	git log linus..HEAD
 > 
 >    and you'll see exactly what you wanted: what exists in your HEAD but 
 >    not in mine.
 > 
 > No complex script required.

Ok, I must be doing something totally bone-headed.  Because this is what
I tried to do before I headed down the path of making that script work.

Doing the above yields ...

(18:47:37:davej@hera:agp2)$ export KERNEL=master.kernel.org:/pub/scm/linux/kernel/git/
(18:47:43:davej@hera:agp2)$ git fetch $KERNEL/torvalds/linux-2.6 master:linus
davej@master.kernel.org's password:
Packing 35335 objects
Unpacking 35335 objects
 100% (35335/35335) done
* committish: d27ba47e7e8c466c18983a1779d611f82d6a354f
  branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git//torvalds/linux-2.6
* refs/heads/linus: storing branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git//torvalds/linux-2.6

which looks ok, but then when I do the git log linus..HEAD, I get no output at all.

Whatever I'm doing wrong, I'm doing it consistently, as this happens
in all my trees both locally, and on k.o

*click*, ahh wait, I didn't have a 'linus' branch before I did that fetch.
For the above to work, do I need there to be a 'linus' branch before
I start making changes ?  Or am I barking up the wrong tree ?

		Dave

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git-rev-tree
  2005-11-08  2:57   ` git-rev-tree Dave Jones
@ 2005-11-08  3:35     ` Linus Torvalds
  2005-11-08  3:43       ` git-rev-tree Dave Jones
  0 siblings, 1 reply; 6+ messages in thread
From: Linus Torvalds @ 2005-11-08  3:35 UTC (permalink / raw)
  To: Dave Jones; +Cc: git



On Mon, 7 Nov 2005, Dave Jones wrote:
> 
> (18:47:37:davej@hera:agp2)$ export KERNEL=master.kernel.org:/pub/scm/linux/kernel/git/
> (18:47:43:davej@hera:agp2)$ git fetch $KERNEL/torvalds/linux-2.6 master:linus
> davej@master.kernel.org's password:
> Packing 35335 objects
> Unpacking 35335 objects
>  100% (35335/35335) done
> * committish: d27ba47e7e8c466c18983a1779d611f82d6a354f
>   branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git//torvalds/linux-2.6
> * refs/heads/linus: storing branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git//torvalds/linux-2.6
> 
> which looks ok, but then when I do the git log linus..HEAD, I get no output at all.

You've got the right "linus" commit.

However, are you aware that I did pull from you? If you don't have 
anything new, "no output at all" is the right thing.

> *click*, ahh wait, I didn't have a 'linus' branch before I did that fetch.
> For the above to work, do I need there to be a 'linus' branch before
> I start making changes ?  Or am I barking up the wrong tree ?

No, the above will have created the "linus" branch as needed.

		Linus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git-rev-tree
  2005-11-08  3:35     ` git-rev-tree Linus Torvalds
@ 2005-11-08  3:43       ` Dave Jones
  0 siblings, 0 replies; 6+ messages in thread
From: Dave Jones @ 2005-11-08  3:43 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: git

On Mon, Nov 07, 2005 at 07:35:55PM -0800, Linus Torvalds wrote:
 > 
 > 
 > On Mon, 7 Nov 2005, Dave Jones wrote:
 > > 
 > > (18:47:37:davej@hera:agp2)$ export KERNEL=master.kernel.org:/pub/scm/linux/kernel/git/
 > > (18:47:43:davej@hera:agp2)$ git fetch $KERNEL/torvalds/linux-2.6 master:linus
 > > davej@master.kernel.org's password:
 > > Packing 35335 objects
 > > Unpacking 35335 objects
 > >  100% (35335/35335) done
 > > * committish: d27ba47e7e8c466c18983a1779d611f82d6a354f
 > >   branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git//torvalds/linux-2.6
 > > * refs/heads/linus: storing branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git//torvalds/linux-2.6
 > > 
 > > which looks ok, but then when I do the git log linus..HEAD, I get no output at all.
 > 
 > You've got the right "linus" commit.
 > 
 > However, are you aware that I did pull from you? If you don't have 
 > anything new, "no output at all" is the right thing.

I only just saw my changes turn up on the commits list, so I was
completely unaware until now.  Hohum.

I'll figure it out next time I have something for you to pull again :)

thanks,

		Dave

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: git-rev-tree
  2005-11-08  2:12 git-rev-tree Dave Jones
  2005-11-08  2:33 ` git-rev-tree Linus Torvalds
@ 2005-11-08  4:55 ` Junio C Hamano
  1 sibling, 0 replies; 6+ messages in thread
From: Junio C Hamano @ 2005-11-08  4:55 UTC (permalink / raw)
  To: Dave Jones; +Cc: git

Dave Jones <davej@redhat.com> writes:

> Can someone remind me what the deprecated git-rev-tree command did,
> or how this should be fixed up to use newer git commands?

Alternatively, can somebody comment on the git-changes in the
"pu" branch?

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-11-08  4:55 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-08  2:12 git-rev-tree Dave Jones
2005-11-08  2:33 ` git-rev-tree Linus Torvalds
2005-11-08  2:57   ` git-rev-tree Dave Jones
2005-11-08  3:35     ` git-rev-tree Linus Torvalds
2005-11-08  3:43       ` git-rev-tree Dave Jones
2005-11-08  4:55 ` git-rev-tree Junio C Hamano

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