git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: finding similar blobs (was: Re: $Revision$ keyword replacement?

From
SBSanti Bejar <sbejar@gmail.com>
Date
Nov 22, 2005, 23:10 UTC
Message-ID
<8aa486160511221510v667dbfd5y@mail.gmail.com>
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:
>
Show 9 quoted lines
>
> > 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?

Show 18 quoted lines
>
> > 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
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 4 in “$Revision$ keyword replacement?”
  1. Santi BéjarNov 22, 2005
  2. finding similar blobs (was: Re: $Revision$ keyword replacement?Junio C Hamano, Nov 22, 2005
  3. Santi BejarNov 22, 2005
  4. Junio C HamanoNov 22, 2005

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.