threads / discuss / 17158

How can I restrict git-diff to a specific set of directories?

Subject: How can I restrict git-diff to a specific set of directories?

## tl;dr

4 messages between Jan 13, 2009 and Jan 14, 2009.

replies: 3people: 3as markdown or json

Alan· Jan 13, 2009, 23:49 UTC · lore

I have a repository that I need to build a set of patches for a single directory path. (I just want the diffs on the one driver.)

Is there a clean non-hacky way to do this?

It is not cross repository or anything. I just need to generate a diff between one commit and another, but only for the contents of a specific directory.

I am not finding a real straightforward way to do that. (Unless I am missing something, which is quite possible.)

Thanks!
Björn Steinbrink· Jan 14, 2009, 00:02 UTC · re: Alan · lore

Re: How can I restrict git-diff to a specific set of directories?

On 2009.01.13 15:49:03 -0800, Alan wrote:
Show 11 quoted lines
> I have a repository that I need to build a set of patches for a single
> directory path.  (I just want the diffs on the one driver.)
> 
> Is there a clean non-hacky way to do this?
> 
> It is not cross repository or anything. I just need to generate a diff
> between one commit and another, but only for the contents of a specific
> directory.
> 
> I am not finding a real straightforward way to do that.  (Unless I am
> missing something, which is quite possible.)
git diff commitA commitB -- some/paths/here some/more/here and/then/some
That limits the diff to the paths after the dashes.
Björn
Alan· Jan 14, 2009, 00:33 UTC · re: Björn Steinbrink · lore

Re: How can I restrict git-diff to a specific set of directories?

On Wed, 2009-01-14 at 01:02 +0100, Björn Steinbrink wrote:
Show 16 quoted lines
> On 2009.01.13 15:49:03 -0800, Alan wrote:
> > I have a repository that I need to build a set of patches for a single
> > directory path.  (I just want the diffs on the one driver.)
> > 
> > Is there a clean non-hacky way to do this?
> > 
> > It is not cross repository or anything. I just need to generate a diff
> > between one commit and another, but only for the contents of a specific
> > directory.
> > 
> > I am not finding a real straightforward way to do that.  (Unless I am
> > missing something, which is quite possible.)
> 
> git diff commitA commitB -- some/paths/here some/more/here and/then/some
> 
> That limits the diff to the paths after the dashes.
Thanks! That is EXACTLY what I need.
Boyd Stephen Smith Jr.· Jan 14, 2009, 00:02 UTC · re: Alan · lore

Re: How can I restrict git-diff to a specific set of directories?

On Tuesday 2009 January 13 17:49:03 Alan wrote:
Show 5 quoted lines
>I need to generate a diff
>between one commit and another, but only for the contents of a specific
>directory.
>
>I am not finding a real straightforward way to do that.

I think: git diff one_commit another -- specific/directory is supposed to do what you want. However, I've never used it myself.

-- 
Boyd Stephen Smith Jr.                     ,= ,-_-. =. 
bss@iguanasuicide.net                     ((_/)o o(\_))
ICQ: 514984 YM/AIM: DaTwinkDaddy           `-'(. .)`-' 
http://iguanasuicide.net/                      \_/     

← back to recent threads