git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cvs diff -l equivalent?
@ 2008-07-30  8:20 Stephen R. van den Berg
  2008-07-30 13:53 ` Johannes Schindelin
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Stephen R. van den Berg @ 2008-07-30  8:20 UTC (permalink / raw)
  To: git

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?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvs diff -l equivalent?
  2008-07-30  8:20 cvs diff -l equivalent? Stephen R. van den Berg
@ 2008-07-30 13:53 ` Johannes Schindelin
  2008-07-30 15:58   ` Stephen R. van den Berg
  2008-07-30 14:00 ` Thomas Rast
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Johannes Schindelin @ 2008-07-30 13:53 UTC (permalink / raw)
  To: Stephen R. van den Berg; +Cc: git

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvs diff -l equivalent?
  2008-07-30  8:20 cvs diff -l equivalent? Stephen R. van den Berg
  2008-07-30 13:53 ` Johannes Schindelin
@ 2008-07-30 14:00 ` Thomas Rast
  2008-07-30 16:17   ` Stephen R. van den Berg
  2008-07-30 20:57 ` Mikael Magnusson
  2008-07-30 21:25 ` Linus Torvalds
  3 siblings, 1 reply; 8+ messages in thread
From: Thomas Rast @ 2008-07-30 14:00 UTC (permalink / raw)
  To: Stephen R. van den Berg; +Cc: git

[-- Attachment #1: Type: text/plain, Size: 581 bytes --]

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


[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvs diff -l equivalent?
  2008-07-30 13:53 ` Johannes Schindelin
@ 2008-07-30 15:58   ` Stephen R. van den Berg
  2008-07-30 18:18     ` Johannes Schindelin
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen R. van den Berg @ 2008-07-30 15:58 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: git

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.

>> 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.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvs diff -l equivalent?
  2008-07-30 14:00 ` Thomas Rast
@ 2008-07-30 16:17   ` Stephen R. van den Berg
  0 siblings, 0 replies; 8+ messages in thread
From: Stephen R. van den Berg @ 2008-07-30 16:17 UTC (permalink / raw)
  To: Thomas Rast; +Cc: git

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?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvs diff -l equivalent?
  2008-07-30 15:58   ` Stephen R. van den Berg
@ 2008-07-30 18:18     ` Johannes Schindelin
  0 siblings, 0 replies; 8+ messages in thread
From: Johannes Schindelin @ 2008-07-30 18:18 UTC (permalink / raw)
  To: Stephen R. van den Berg; +Cc: git

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvs diff -l equivalent?
  2008-07-30  8:20 cvs diff -l equivalent? Stephen R. van den Berg
  2008-07-30 13:53 ` Johannes Schindelin
  2008-07-30 14:00 ` Thomas Rast
@ 2008-07-30 20:57 ` Mikael Magnusson
  2008-07-30 21:25 ` Linus Torvalds
  3 siblings, 0 replies; 8+ messages in thread
From: Mikael Magnusson @ 2008-07-30 20:57 UTC (permalink / raw)
  To: Stephen R. van den Berg; +Cc: git

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: cvs diff -l equivalent?
  2008-07-30  8:20 cvs diff -l equivalent? Stephen R. van den Berg
                   ` (2 preceding siblings ...)
  2008-07-30 20:57 ` Mikael Magnusson
@ 2008-07-30 21:25 ` Linus Torvalds
  3 siblings, 0 replies; 8+ messages in thread
From: Linus Torvalds @ 2008-07-30 21:25 UTC (permalink / raw)
  To: Stephen R. van den Berg; +Cc: git



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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-07-30 21:29 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-30  8:20 cvs diff -l equivalent? Stephen R. van den Berg
2008-07-30 13:53 ` Johannes Schindelin
2008-07-30 15:58   ` Stephen R. van den Berg
2008-07-30 18:18     ` Johannes Schindelin
2008-07-30 14:00 ` Thomas Rast
2008-07-30 16:17   ` Stephen R. van den Berg
2008-07-30 20:57 ` Mikael Magnusson
2008-07-30 21:25 ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).