From: linux@horizon.com
To: git@vger.kernel.org, jonsmirl@gmail.com, torvalds@linux-foundation.org
Cc: linux@horizon.com
Subject: Re: Digging through old vendor code
Date: 13 Jan 2008 11:28:06 -0500 [thread overview]
Message-ID: <20080113162806.13991.qmail@science.horizon.com> (raw)
> Heh. Maybe you could just use the rename logic?
>
> [How-to snipped]
Clever idea, but I think the real problem was to figure out what VERSION
of the file was the base; i.e. to look through history.
Still, it should be possible to adapt the technique...
#!/bin/sh
# List of files we are looking to copy from
SRC="drivers/serial/"
# Temporary work directory
DST=/tmp/work
git-clone -l -n -s . $DST
{ cd $DST; git-symbolic-ref HEAD refs/heads/DELETEME; }
for i in `git-rev-list v2.6.20..v2.6.24-rc6 -- $SRC`; do
j=`git-describe $i`
git-archive --prefix="$j/" $i -- $SRC | tar xf - -C $DST
# This is abusing the index, but it saves space...
{ cd $DST; git add $j; rm -rf $j; }
done
# And now proceed as per Linus's idea...
# Except we have it all in the index; no need
# to actually make a commit...
cd $DST
cp $target_file $DST
{ cd $DST; git-diff-files -M...; }
Maybe a real git wizard will show me how to insert the index entries
directly without ever doing anything as pedestrian as extracting, hashing,
and then deleting the files, but it's still not that bad.
And it's kind of a neat example of using the index as a staging area
for a commit.
(Exercise for the reader: the above gets a complete copy of every file in
the directory for every commit in qhich ANY file in the directory changed.
Better would be to do the git-rev-list per-file, so you only add unique
file versions. This requires an outer loop over file names and a more
careful pathname specification to git add in the inner loop.)
next reply other threads:[~2008-01-13 16:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-13 16:28 linux [this message]
2008-01-13 17:04 ` Digging through old vendor code Jon Smirl
2008-01-13 17:31 ` Jon Smirl
2008-01-14 12:08 ` Jeff King
2008-01-14 14:49 ` Jon Smirl
-- strict thread matches above, loose matches on Subject: below --
2008-01-13 4:09 Jon Smirl
2008-01-13 4:41 ` Linus Torvalds
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=20080113162806.13991.qmail@science.horizon.com \
--to=linux@horizon.com \
--cc=git@vger.kernel.org \
--cc=jonsmirl@gmail.com \
--cc=torvalds@linux-foundation.org \
/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).