monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Re: How to determine if a file is version controlle


From: Justin Patrin
Subject: Re: [Monotone-devel] Re: How to determine if a file is version controlled?
Date: Fri, 14 Apr 2006 12:46:08 -0700

On 4/14/06, Lapo Luchini <address@hidden> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Justin Patrin wrote:
> > On 4/12/06, Lapo Luchini <address@hidden> wrote: Wim Oudshoorn wrote:
> >
> >>>> Question -------- Is there an efficient way to find this out?
> >>>>
> > "mtn cat filename" gives status 1 on error, else the file content.
> > But gettin' the whole content may be a bit overkill (exp. in cases
> > of big files) just to know if it is tracked or not.
> >
> >> "mtn cat filename | head" perhaps? ;-)
> I doubt that simply avoiding reading the output tells monotone not to
> extract it altogether ;-)
> Anyway if even "mtn ls known filename" (that use, btw, is not quite
> documented in "mtn help ls", I didn't think about it ^_^) is too long
> a "cat" can only be worse...
>
> Well, no! In fact no!
>
> % time mtn ls known work.hh >/dev/null
> 0.41s user 0.00s system 100% cpu 0.405 total
> % time mtn cat work.hh >/dev/null
> 0.14s user 0.00s system 70% cpu 0.199 total
> % time mtn cat figures/parent-child-names-hashes.pdf >/dev/null
> 0.15s user 0.00s system 78% cpu 0.197 total
>
> I guess "ls" does some extra checking that is even more "heavy" than
> readnig the file content itself.
> Even a "cat" on a 120KiB file such as the PDF, is shorter that a "ls
> known".
>

The reason I suggested piping to head is that I assumed that head
would close the pipe when it reaches the limit, thus causing the
program on the other end to stop. Then again, that would cause an
error condition, so I actually don't know for sure if this is the case
or not.

--
Justin Patrin




reply via email to

[Prev in Thread] Current Thread [Next in Thread]