On Fri, 30 Jun 2006, Herbert Xu wrote:
>
> On Fri, Jun 30, 2006 at 01:18:24PM +1200, Michal Ludvig wrote:
> >
> > just a quick question: how can I create a patch with all changes in
> > cryptodev-2.6 tree against tag v2.6.16 in Linus tree? I've got
> > git://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
> > cloned here and want to extract all your commits in this tree since
> > 2.6.16. Is there a way to do it in Git/Cogito?
>
> OK, it's easier if you break this into three problems.
>
> You start by getting all the changes merged right after 2.6.16. This
> can be done by locating the merge changeset in Linus's tree. It looks
> like this:
Actually, there are certainly other, potentially easier, ways to do this.
It depends a bit on what Michal wants, though. Since the current trees
(both mine and the cryptodev tree) have been merging things back and
forth, it's _not_ as easy as just saying "pick all commits that exist in
one branch but not the other", but depending on what Michal wants to do,
git gives other ways to prune out just the info he wants.
The easiest by far is if you only care about a certain sub-directory.
Then, assuming the branch "crypto" is the top-most commit of the cryptodev
repo, just do
git diff v2.6.16..crypto -- crypto/
and that will give you a diff of all the changes since v2.6.16 inside that
subdirectory. That may or may not be sufficient and what Michal wants.
Now, the cryptodev-2.6.git tree doesn't even contain the v2.6.16 tags, but
you can fix that by just doing
git fetch --tags
git://git.kernel.org//pub/scm/linux/kernel/git/torvalds/linux-2.6
even if your clone is actually from just the cryptodev-2.6 archive.
Alternatively, if you want to see the individual changes, you can just do
git log -p --full-diff v2.6.16..crypto -- crypto/
which shows you all the commits that changed the crypto/ subdirectory, AND
it shows the other changes those same commits did to other subdirectories
too (which is usually something you want in a case like this).
Finally, what you can also do is that instead of matching for stuff that
changed the crypto/ subdirectory, you could try to match commits where the
committer is somebody special, eg Herbert Xu. We don't have that kind of
thing automated, but here's one way to do it:
git-rev-list --header v2.6.16..crypto |
grep -z 'committer Herbert Xu' |
tr '\0' '\n' |
sed -n '/^[a-f0-9][a-f0-9]*$/p' |
git diff-tree --pretty -p --stdin |
less -S
where the "git-rev-list --header | grep -z" part picks out any commits
committed by Herbert, the "tr '\0' '\n' | sed -n" part then picks up just
the commit ID's from those lines, and the "git-diff-tree" part then shows
those commits as diffs.
(The above should really be quite possible to shorten as
git log -p --committer="Herbert Xu"
but we don't actually support git-rev-list doing matching on
committer/author names - although it should be easy to do in case somebody
wants to have a small git project to get their toes wet, hint hint)
Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html