views:

43

answers:

1

So I have a Git project, and we (a mostly typical Rails project) have a pretty deep directory structure.

When I do git merge I see results like:

app/views/shared/exception_report.erb              |    6 +
app/views/ui/sample.html.erb                       |   11 +-
app/views/verifications/new.html.erb               |   10 +-
config/deploy.rb                                   |    2 +-
.../20100825132200_thing_pane.rb                   |   27 ++---
.../20100826210000_another_thing_pane.rb           |   21 +++
lib/semantic_form_builder_plus.rb                  |    5 +

The problem is that I want to see the directory .../20100825132200_thing_pane.rb is in. Is there a git setting that controls the number of columns these lines take?

tl;dr : git merge lists path names added/changed, but crops the filepath off too soon for my purposes. Can I control how many columns git uses when it prints this filename list?

Edit for posterity's/future Googlers sake: I took this answer and created a slick Rake task to make this really easy: incoming_migration_check.rake.

+2  A: 

I don't know how to do that for a merge's built-in diffstat.

However, you could do this a merge with --no-commit followed by a diff --stat=width,name-width to get a wider diffstat before committing. Alternatively you could do the diff above with a HEAD^ argument after the merge is complete to see a wider listing of the results.

Walter Mundt
I tried various commands to get this to work, and Git (1.7.2.3) always complained: ` git diff --stat=width,name-width HEAD^`, `git diff --stat=width,96 HEAD^`, and ` git diff "--stat[=width,96]" HEAD^ `. They all gave me the usage command. What am I doing wrong here? (On the good hand, `git diff --numstat POINTA..POINTB` does work for my purposes...
RyanWilcox
You want two numbers, e.g. `git diff --stat=96,80 HEAD^` -- one to specify total width, and optionally one for the width of the name column.
Walter Mundt