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?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?Re: cvs diff -l equivalent?
Hi,
On Wed, 30 Jul 2008, Stephen R. van den Berg wrote:
> Someone popped this question on me.
I do not know cvs that well anymore. So I do not know what -l does. Care to explain?
> How many weeks are there in a lightyear?
That is easy. 52 light ones.
Ciao, Dscho
Re: cvs diff -l equivalent?
Johannes Schindelin wrote:
>On Wed, 30 Jul 2008, Stephen R. van den Berg wrote: >> Someone popped this question on me.
>I do not know cvs that well anymore. So I do not know what -l does. Care >to explain?
Usage: cvs diff [-lR] [-k kopt] [format_options]
[[-r rev1 | -D date1] [-r rev2 | -D date2]] [files...]
-l Local directory only, not recursiveIt shows the diff for all files in the current directory, nothing deeper, nothing higher.
>> How many weeks are there in a lightyear? >That is easy. 52 light ones.
I presume you mean "lightweeks", and yes, that would probably fit the bill :-).
--
Sincerely,
Stephen R. van den Berg.Re: cvs diff -l equivalent?
Hi,
On Wed, 30 Jul 2008, Stephen R. van den Berg wrote:
> Johannes Schindelin wrote: > >On Wed, 30 Jul 2008, Stephen R. van den Berg wrote: > >> Someone popped this question on me. > > >I do not know cvs that well anymore. So I do not know what -l does. Care > >to explain? > > 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 > deeper, nothing higher.
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
Re: cvs diff -l equivalent?
Stephen R. van den Berg wrote:
> Someone popped this question on me. The closest I got was: > > git diff . > > But that still recurses. Any solutions without patching?
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^ | cut -f2)
- Thomas
Re: cvs diff -l equivalent?
Thomas Rast wrote:
>Stephen R. van den Berg wrote: >> Someone popped this question on me. The closest I got was:
>> git diff .
>> But that still recurses. Any solutions without patching?
>Maybe a scripted version? For just 'git diff .', this should work:
> git diff $(git ls-files . | grep -v /)
git diff $(git ls-files --exclude-standard . | fgrep -v /)
comes the closest, so it seems.
>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^ | cut -f2)
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?Re: cvs diff -l equivalent?
2008/7/30 Stephen R. van den Berg <srb@cuci.nl>:
> Someone popped this question on me. The closest I got was: > > git diff . > > But that still recurses. Any solutions without patching?
Another option than the ones suggested: git diff|filterdiff -x '*/*/*'
filterdiff is available from the "patchutils" package.
-- Mikael Magnusson
Re: cvs diff -l equivalent?
On Wed, 30 Jul 2008, Stephen R. van den Berg wrote:
> Someone popped this question on me. The closest I got was: > > git diff . > > But that still recurses. Any solutions without patching?
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