git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Santi Bejar <sbejar@gmail.com>
To: Junio C Hamano <junkio@cox.net>
Cc: git@vger.kernel.org
Subject: Re: finding similar blobs (was: Re: $Revision$ keyword replacement?
Date: Wed, 23 Nov 2005 00:10:27 +0100	[thread overview]
Message-ID: <8aa486160511221510v667dbfd5y@mail.gmail.com> (raw)
In-Reply-To: <7vy83gb8zk.fsf@assigned-by-dhcp.cox.net>

2005/11/22, Junio C Hamano <junkio@cox.net>:
> Santi Béjar <sbejar@gmail.com> writes:
>

>
> > tmp=`mktemp -t -d git-find-sim.XXXXXXX`
> > ...
> > git update-index --add $file || exit 1
> > tree=`git-write-tree`
>
> Are you going through all this trouble just to avoid a blob and
> a tree object left dangling after you are done?  Or is there
> something else going on?

No, there is nothing else. These are "easy" avoided, so why have these
dangling {blob,tree,...}s?

>
> > rev_arg=`GIT_DIR=$GIT_DIR_ORIG git-rev-parse --default HEAD --revs-only "$@"`
> > revs=`GIT_DIR=$GIT_DIR_ORIG git-rev-list $rev_arg`
> > for i in $revs; do
> >     git diff-tree --name-status $i -C $tree | grep $file |
> >     sed "s/^/$i:/"
> > done
>
> Perhaps
>
>         GIT_DIR=$GIT_DIR_ORIG git-rev-list $rev_arg |
>         while read one
>             git diff-tree --name-status -r $one -C $tree | grep $file |
>             sed "s/^/$one:/"
>         done
>
> just in case the similar file you will discover is hidden in a
> subdirectory?

Oops :)

Santi

  reply	other threads:[~2005-11-22 23:10 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-22 17:36 $Revision$ keyword replacement? Santi Béjar
2005-11-22 22:42 ` finding similar blobs (was: " Junio C Hamano
2005-11-22 23:10   ` Santi Bejar [this message]
2005-11-22 23:40     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8aa486160511221510v667dbfd5y@mail.gmail.com \
    --to=sbejar@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).