Re: cvs diff -l equivalent?

Previous thread: [PATCH] Fix merge name generation in "merge in C" by Junio C Hamano on Wednesday, July 30, 2008 - 4:12 am. (4 messages)

Next thread: git blame not respecting --find-copies-harder ? by Stephen R. van den Berg on Wednesday, July 30, 2008 - 5:39 am. (17 messages)
To: <git@...>
Date: Wednesday, July 30, 2008 - 4:20 am

Someone popped this question on me. The closest I got was:

git diff .

But that still recurses. Any solutions without patching?
--
Sincerely,
Stephen R. van den Berg.

How many weeks are there in a lightyear?
--

To: Stephen R. van den Berg <srb@...>
Cc: <git@...>
Date: Wednesday, July 30, 2008 - 5:25 pm

Not without patching, no. When generating a patch, git diff always
recurses.

I suspect adding some kind of "-l" flag would be about five lines of code,
though, so if you really need it... Hint, hint.

Linus
--

To: Stephen R. van den Berg <srb@...>
Cc: <git@...>
Date: Wednesday, July 30, 2008 - 4:57 pm

Another option than the ones suggested:
git diff|filterdiff -x '*/*/*'

filterdiff is available from the "patchutils" package.

--
Mikael Magnusson
--

To: Stephen R. van den Berg <srb@...>
Cc: <git@...>
Date: Wednesday, July 30, 2008 - 10:00 am

Maybe a scripted version? For just 'git diff .', this should work:

git diff $(git ls-files . | grep -v /)

That will still do the wrong thing if you diff against an older commit
with a different list of files. In that case you need the list of
files in the other side of the diff too:

git diff HEAD^.. -- $(git ls-files . | grep -v /; git ls-tree HEAD^ | cu=
t -f2)

=2D Thomas

To: Thomas Rast <trast@...>
Cc: <git@...>
Date: Wednesday, July 30, 2008 - 12:17 pm

git diff $(git ls-files --exclude-standard . | fgrep -v /)

This doesn't seem to do the right thing, it messes up with which commit we
diff.
--
Sincerely,
Stephen R. van den Berg.

How many weeks are there in a lightyear?
--

To: Stephen R. van den Berg <srb@...>
Cc: <git@...>
Date: Wednesday, July 30, 2008 - 9:53 am

Hi,

I do not know cvs that well anymore. So I do not know what -l does. Care

That is easy. 52 light ones.

Ciao,
Dscho

--

To: Johannes Schindelin <Johannes.Schindelin@...>
Cc: <git@...>
Date: Wednesday, July 30, 2008 - 11:58 am

Usage: cvs diff [-lR] [-k kopt] [format_options]
[[-r rev1 | -D date1] [-r rev2 | -D date2]] [files...]
-l Local directory only, not recursive

It shows the diff for all files in the current directory, nothing

I presume you mean "lightweeks", and yes, that would probably fit the bill :-).
--
Sincerely,
Stephen R. van den Berg.
--

To: Stephen R. van den Berg <srb@...>
Cc: <git@...>
Date: Wednesday, July 30, 2008 - 2:18 pm

Hi,

Okay. This is my version of a solution:

$ find . -maxdepth 1 -type f -print0 | xargs -0 git diff

And no, there is not an easier way. Probably since Git has a snapshot
based idea of the contents, i.e. it does not think that the files in a
revision are decoupled. Not even the ones in different directories.

Ciao,
Dscho
--

Previous thread: [PATCH] Fix merge name generation in "merge in C" by Junio C Hamano on Wednesday, July 30, 2008 - 4:12 am. (4 messages)

Next thread: git blame not respecting --find-copies-harder ? by Stephen R. van den Berg on Wednesday, July 30, 2008 - 5:39 am. (17 messages)