* Make git-rev-tree obsolete
@ 2005-08-09 0:23 Johannes Schindelin
2005-08-09 2:09 ` Linus Torvalds
2005-08-09 2:49 ` Junio C Hamano
0 siblings, 2 replies; 6+ messages in thread
From: Johannes Schindelin @ 2005-08-09 0:23 UTC (permalink / raw)
To: git
Hi,
Junio remarked that Jeff's git-changes-script still uses git-rev-tree, and
therefore it should not be removed. This patch changes git-changes-script
over to git-rev-list:
--- git-changes-script.orig Tue Aug 9 02:21:36 2005
+++ git-changes-script Tue Aug 9 02:20:53 2005
@@ -85,14 +85,14 @@
base=$(cat .git/HEAD) || exit 1
fi
-git-rev-tree $base | sort -rn > ${tmpfile}.base
+git-rev-list $base > ${tmpfile}.base
if [ -n "$remote" ]; then
[ -d $remote/.git ] || exit 1
if [ -z "$tobase" ]; then
tobase=$(cat $remote/.git/HEAD) || exit 1
fi
pushd $remote > /dev/null
- git-rev-tree $tobase | sort -rn > ${tmpfile}.remote
+ git-rev-list $tobase > ${tmpfile}.remote
diff -u ${tmpfile}.base ${tmpfile}.remote | grep "^${diffsearch}[^${diffsearch}]" | cut -c 1- > ${tmpfile}.diff
rm -f ${tmpfile}.base ${tmpfile}.remote
mv ${tmpfile}.diff ${tmpfile}.base
@@ -103,7 +103,7 @@
[ -s "${tmpfile}.base" ] || exit 0
-cat ${tmpfile}.base | while read time commit parents; do
+cat ${tmpfile}.base | while read commit; do
showcommit $commit
echo -e "\n--------------------------"
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Make git-rev-tree obsolete
2005-08-09 0:23 Make git-rev-tree obsolete Johannes Schindelin
@ 2005-08-09 2:09 ` Linus Torvalds
2005-08-09 2:49 ` Junio C Hamano
1 sibling, 0 replies; 6+ messages in thread
From: Linus Torvalds @ 2005-08-09 2:09 UTC (permalink / raw)
To: Johannes Schindelin, Jeff Garzik; +Cc: Git Mailing List
On Tue, 9 Aug 2005, Johannes Schindelin wrote:
>
> Junio remarked that Jeff's git-changes-script still uses git-rev-tree, and
> therefore it should not be removed. This patch changes git-changes-script
> over to git-rev-list:
It really should be totally rewritten, to take advantage of git-rev-list
being able to terminate early. As it is, your conversion may work, and it
may give the right results, but it will suck performance-wise for all the
same reasons that git-rev-tree sucked: it will walk all the way down to
the root of the tree(s).
> --- git-changes-script.orig Tue Aug 9 02:21:36 2005
> +++ git-changes-script Tue Aug 9 02:20:53 2005
> @@ -85,14 +85,14 @@
> base=$(cat .git/HEAD) || exit 1
> fi
>
> -git-rev-tree $base | sort -rn > ${tmpfile}.base
> +git-rev-list $base > ${tmpfile}.base
> if [ -n "$remote" ]; then
> [ -d $remote/.git ] || exit 1
> if [ -z "$tobase" ]; then
> tobase=$(cat $remote/.git/HEAD) || exit 1
> fi
> pushd $remote > /dev/null
> - git-rev-tree $tobase | sort -rn > ${tmpfile}.remote
> + git-rev-list $tobase > ${tmpfile}.remote
> diff -u ${tmpfile}.base ${tmpfile}.remote | grep "^${diffsearch}[^${diffsearch}]" | cut -c 1- > ${tmpfile}.diff
> rm -f ${tmpfile}.base ${tmpfile}.remote
> mv ${tmpfile}.diff ${tmpfile}.base
It really should do something like
#
# Make sure we see objects in the remote directory
#
export GIT_ALTERNATE_OBJECT_DIRECTORIES=$remote/.git/objects
#
# Get the local SHA1
#
local_ref=$(git-rev-parse --verify $base^0) || exit
#
# Get the remote SHA1
#
remote_ref=$(GIT_DIR="$remote/.git" git-rev-parse --verify $tobase^0) || exit
#
# Ok, let it rip..
#
git log $remote_ref..$local_ref
to do a proper search of objects that are in $local but not in $remote,
without having to traverse all the way down to the root for both.
Linus
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Make git-rev-tree obsolete
2005-08-09 0:23 Make git-rev-tree obsolete Johannes Schindelin
2005-08-09 2:09 ` Linus Torvalds
@ 2005-08-09 2:49 ` Junio C Hamano
2005-08-09 4:48 ` Jeff Garzik
` (2 more replies)
1 sibling, 3 replies; 6+ messages in thread
From: Junio C Hamano @ 2005-08-09 2:49 UTC (permalink / raw)
To: Johannes Schindelin; +Cc: git
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
> Junio remarked that Jeff's git-changes-script still uses git-rev-tree, and
> therefore it should not be removed. This patch changes git-changes-script
> over to git-rev-list:
Just to make things clear, "Junio remarked" that Cogito also
seems to use it as well, so git-rev-tree is not going away.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: Make git-rev-tree obsolete
2005-08-09 2:49 ` Junio C Hamano
@ 2005-08-09 4:48 ` Jeff Garzik
2005-08-09 10:18 ` Johannes Schindelin
2005-08-11 22:22 ` Petr Baudis
2 siblings, 0 replies; 6+ messages in thread
From: Jeff Garzik @ 2005-08-09 4:48 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Schindelin, git
On Mon, Aug 08, 2005 at 07:49:26PM -0700, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Junio remarked that Jeff's git-changes-script still uses git-rev-tree, and
> > therefore it should not be removed. This patch changes git-changes-script
> > over to git-rev-list:
>
> Just to make things clear, "Junio remarked" that Cogito also
> seems to use it as well, so git-rev-tree is not going away.
git-changes-script is basically an old Cogito script, as you can see
from looking at the source code.
I only use it for
cd /repos/misc-2.6
git-changes-script -L ../linux-2.6
i.e. where there are two separate trees, rather than separate branches
that I normally work with.
Jeff
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Make git-rev-tree obsolete
2005-08-09 2:49 ` Junio C Hamano
2005-08-09 4:48 ` Jeff Garzik
@ 2005-08-09 10:18 ` Johannes Schindelin
2005-08-11 22:22 ` Petr Baudis
2 siblings, 0 replies; 6+ messages in thread
From: Johannes Schindelin @ 2005-08-09 10:18 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git
Hi,
On Mon, 8 Aug 2005, Junio C Hamano wrote:
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Junio remarked that Jeff's git-changes-script still uses git-rev-tree, and
> > therefore it should not be removed. This patch changes git-changes-script
> > over to git-rev-list:
>
> Just to make things clear, "Junio remarked" that Cogito also
> seems to use it as well, so git-rev-tree is not going away.
Oops! My bad.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: Make git-rev-tree obsolete
2005-08-09 2:49 ` Junio C Hamano
2005-08-09 4:48 ` Jeff Garzik
2005-08-09 10:18 ` Johannes Schindelin
@ 2005-08-11 22:22 ` Petr Baudis
2 siblings, 0 replies; 6+ messages in thread
From: Petr Baudis @ 2005-08-11 22:22 UTC (permalink / raw)
To: Junio C Hamano; +Cc: Johannes Schindelin, git
Dear diary, on Tue, Aug 09, 2005 at 04:49:26AM CEST, I got a letter
where Junio C Hamano <junkio@cox.net> told me that...
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
>
> > Junio remarked that Jeff's git-changes-script still uses git-rev-tree, and
> > therefore it should not be removed. This patch changes git-changes-script
> > over to git-rev-list:
>
> Just to make things clear, "Junio remarked" that Cogito also
> seems to use it as well, so git-rev-tree is not going away.
Please note
41283a6ed1924c7b3963c5455ba39911f1069682
cg-mkpatch: Ditch git-rev-tree in favour of git-rev-list
7136aa4337334a28e55c8853018423d4b780214c
cg-commit: Use git-rev-list instead of git-rev-tree
from 2005-08-05, which should remove any traces of git-rev-tree usage
from Cogito. Unfortunately, I did that only after releasing Cogito-0.13,
so you would break that particular version (first to depend on git
externally) by removing git-rev-tree now. But I think it's safe to kill
after a while (and another Cogito release, which shouldn't be far away).
--
Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
If you want the holes in your knowledge showing up try teaching
someone. -- Alan Cox
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-08-11 22:22 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-09 0:23 Make git-rev-tree obsolete Johannes Schindelin
2005-08-09 2:09 ` Linus Torvalds
2005-08-09 2:49 ` Junio C Hamano
2005-08-09 4:48 ` Jeff Garzik
2005-08-09 10:18 ` Johannes Schindelin
2005-08-11 22:22 ` Petr Baudis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox