Skip to Content.
Sympa Menu

sm-discuss - Re: [SM-Discuss] git: cherry-pick whole directories

sm-discuss AT lists.ibiblio.org

Subject: Public SourceMage Discussion List

List archive

Chronological Thread  
  • From: Jeremy Blosser <jblosser-smgl AT firinn.org>
  • To: sm-discuss AT lists.ibiblio.org
  • Subject: Re: [SM-Discuss] git: cherry-pick whole directories
  • Date: Sun, 21 Jan 2007 18:13:19 -0600

On Jan 21, Jeremy Blosser [jblosser-smgl AT firinn.org] wrote:
> On Jan 22, Jaka Kranjc [lynx AT mages.ath.cx] wrote:
> > Today I needed this p4 integration functionality too (and someone was
> > bickering again), so after many git resets, here it is, a wrapper
> > script that does just that in git. It takes a path argument and
> > optionally an "upstream" branch. It is not interactive, but there is a
> > slightly more powerful interactive version cat at the end, double
> > commented.
> >
> > I'll add it to the wiki tommorow. Comments?
>
> There actually are potentially ways to have git do the diffing for you but
> your approach is probably better since it's readable by bash gurus (instead
> of just git gurus) and it's very clear what it is doing.

Actually I'm not sure about this... observe:

$ git log --pretty=one-line -- smgl/init.d
ef2ef4c4f71bae44e01f87480bf7ed492d86f51b init.d: Try to fix bug 9177 some
more;
f55dbdb052a0cb237eb2f0c5df04ec2e28451332 Revert "init.d: fix #7311, proc not
sho

$ git log --pretty=one-line master -- smgl/init.d
d799c9f7d0863829c5fb7c701be785216314090c init.d: Try to fix bug 9177 some
more;
ecc1547d4dcc9fb9052d4ddd07e6999cf0989bd5 Revert "init.d: fix #7311, proc not
sho

Comparing the sha1s may not suffice.

git-log's man page suggests:
git log -r --name-status release..test
Show the commits that are in the "test" branch but not yet in
the "release" branch, along with the list of paths each commit
modifies.

But I'm not sure how hard it tries.

Another thing about this approach is it only works if we assume each commit
only affected the directory in question...

Attachment: pgpQVnN8ogQLI.pgp
Description: PGP signature




Archive powered by MHonArc 2.6.24.

Top of Page