2

I would like to see commits touching specific directory but in the commits must be listed changes outside of the directory.

For example I have:

repo/src/moduleA > gitk .

So I will see commits touching this moduleA:

commit1 commit13 commit45

If in commit1 there are changes in moduleB I want to see them.

Is it possible in gitk? or in any other tool?

nayana
  • 3,077
  • 3
  • 16
  • 48

2 Answers2

2

For gitk I don't know, but with git log:

git log --full-diff -p src/moduleA

--full-diff Without this flag, git log -p ... shows commits that touch the specified paths, and diffs about the same specified paths. With this, the full diff is shown for commits that touch the specified paths; this means that "..." limits only commits, and doesn’t limit diff for those commits.

Julien Lopez
  • 1,599
  • 5
  • 15
  • 23
  • this looks good, I tried to use --full-diff in gitk View > Edit View > Additional arguments to git log .. but its not working :-/ for now I will use the git log cmd line thanks – nayana Jun 16 '16 at 10:00
  • 1
    hm I found duplicate .. its doable in preferences of gitk :) check [this](http://stackoverflow.com/a/20065720/3876138) – nayana Jun 16 '16 at 10:17
  • @otopolsky Good job finding the duplicate. I saw that solution for `gitk` but I couldn't make it work. :-( Oh well. – Julien Lopez Jun 16 '16 at 10:41
1

Using git log (and possible gitk), you can have multiple paths as parameters:

cd repo
git log -- src/moduleA src/moduleB

However, that would show commits with modification in A *or B or (A and B).

VonC
  • 1,042,979
  • 435
  • 3,649
  • 4,283
  • `gitk` runs `git rev-list` (which shares the code with `git log`) to select commits, so yes, this should work in `gitk` as well. – torek Jun 16 '16 at 07:57
  • @torek that is what I thought indeed, but that still might select too many commits compared to what the OP expects. – VonC Jun 16 '16 at 07:58