Re: git-rev-tree

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Dave Jones <davej@...>
Cc: <git@...>
Date: Monday, November 7, 2005 - 10:33 pm

On Mon, 7 Nov 2005, Dave Jones wrote:

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.


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
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
git-rev-tree, Dave Jones, (Mon Nov 7, 10:12 pm)
Re: git-rev-tree, Junio C Hamano, (Tue Nov 8, 12:55 am)
Re: git-rev-tree, Linus Torvalds, (Mon Nov 7, 10:33 pm)
Re: git-rev-tree, Dave Jones, (Mon Nov 7, 10:57 pm)
Re: git-rev-tree, Linus Torvalds, (Mon Nov 7, 11:35 pm)
Re: git-rev-tree, Dave Jones, (Mon Nov 7, 11:43 pm)