You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Eli Barzilay <el...@barzilay.org> on 2005/06/02 16:58:55 UTC

Re: [Issue 2319] Showing missing properties

On Jun  2, kfogel@tigris.org wrote:
> http://subversion.tigris.org/issues/show_bug.cgi?id=2319
> [...]
> Closing as invalid.  elibarzilay, would you mind bringing this up on
> the users@ list first, and then on the dev@ list if you sense
> general demand for a feature like this from users?
> 
> I think discussing it first on the lists would help narrow down, or
> even eliminate, the problem.  For example, a script that combined
> the outputs of 'svn proplist' and 'svn ls' in the obvious way could
> accomplish this pretty easily.  (This sort of brainstorming is why
> we have the prominent yellow notice on the top of
> http://subversion.tigris.org/project_issues.html; if you haven't
> seen that notice, take a look.)

There was a discussion that indirectly lead me to post that.  SOrry
for not making a direct connection.
I posted something a short while ago:

  http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=32649

It has the script I had to write because of that problem.  It works
but it is requires invoking svn two times for each file, so it's very
slow.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [svn] Re: [Issue 2319] Showing missing properties

Posted by Eli Barzilay <el...@barzilay.org>.
On Jun  2, Thomas Moschny wrote:
> On Thursday 02 June 2005 20:20, Eli Barzilay wrote:
> > On Jun  2, kfogel@collab.net wrote:
> > > Well, the full-list comparison script is the idea I was suggesting
> > >
> > > :-).
> >
> > It will be difficult to bundle this up in a robust script.  OTOH, it
> > would probably be trivial to change proplist.
> 
> Here's a script that might to what you want, and it's rather short
> :-) Maybe the sed part can be made more robust.
> 
> #! /bin/bash
> 
> comm -2 -3 \
>  <( svn ls -R . | sort ) \
>  <( ( svn propget -R svn:eol-style . ;
>       svn propget -R svn:mime-type . ) |
>     sed 's,^\(.*\) - [^ ]*$,\1,' |
>     sort -u )

Well...  That does work, and it's better than my version (I just added
a "| grep -v '/$'" to the `svn ls' part), but I'd say that a script
that uses two stdin redirections, and a two levels of nested subshells
is only short in its physical size...  (BTW, I don't think that there
is a way to make the sed expression better -- you want the first .* to
be non-greedy, but IIRC sed is pretty limited...)

Now the real exercise would be to make that into something that can be
put on a FAQ, with instructions that are sufficient for random people
to copy, use, and modify for other situations and other properties.
This is, IMO, the impossible part.

So I still think that there is a point in adding a command line flag.
For my own usage such hacks are enough so I'll shut up now.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [Issue 2319] Showing missing properties

Posted by Thomas Moschny <mo...@ipd.uni-karlsruhe.de>.
On Thursday 02 June 2005 20:20, Eli Barzilay wrote:
> On Jun  2, kfogel@collab.net wrote:
> > Well, the full-list comparison script is the idea I was suggesting
> >
> > :-).
>
> It will be difficult to bundle this up in a robust script.  OTOH, it
> would probably be trivial to change proplist.

Here's a script that might to what you want, and it's rather short :-)
Maybe the sed part can be made more robust.

#! /bin/bash

comm -2 -3 \
 <( svn ls -R . | sort ) \
 <( ( svn propget -R svn:eol-style . ;
      svn propget -R svn:mime-type . ) |
    sed 's,^\(.*\) - [^ ]*$,\1,' |
    sort -u )

Regards,
Thomas

Re: [Issue 2319] Showing missing properties

Posted by Norbert Unterberg <nu...@gmail.com>.
02 Jun 2005 12:26:12 -0500, kfogel@collab.net <kf...@collab.net>:

> > My suggestion was to add a flag to proplist that will list everything,
> > just not showing the properties for paths that lack them, and a
> > similar flag to propget.  
> 
> We try not to add flags for every conceivable use case.  We'd grow a
> lot of flags, most of which would not be used by most users, and
> they'd take up a lot of space in the documentation and help output.

I also think this is a common case. I too once wanted to set the
svn:eol-style property on all *.c and *.h files in a working copy
folder, and I found that very hard. The problem was that the folder
contained some ignored *.h files that were not under version control:

* The simple "svn propset svn:eol-style native *.h" did fail on the
first unversioned *.h and stopped. [note: I have seen some discussion
on the list about this one, so I do not know if this changed already
in 1.2]
* The check what files did not have the propery failed, because "svn
proplist svn:ignore *.h" did not show the files that did not have the
property. I ended up in printing a list of both file lists and
compared the manually :-(

I believe svn has a very small list of available flags (if you do not
count the standard flags that work for basically every command, like
--username --password --recursive etc). I think it would not do much
harm to add another, though I fully understand your defensive policy
about adding new flags.

On the other hand, maybe we do not need a new flag but a modified
default behaviour? When I do a "attrib *.h" in my windows command
shell, I expect to see a list of _all_ *.h files and their attributes,
including the files that don't have any attribute set. Why not make
subversion behave that way? Or is there a "more typical" use case that
requires subversion to omit the files that lack that property?

Norbert

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org


Re: [Issue 2319] Showing missing properties

Posted by Eli Barzilay <el...@barzilay.org>.
On Jun  2, kfogel@collab.net wrote:
> Eli Barzilay <el...@barzilay.org> writes:
> > That's exactly the issue...  The thing that I wanted was to catch
> > all files that don't have either svn:mime-type or svn:eol-style.
> > Running:
> > 
> >   svn propget -R <prop> .
> > 
> > will not show files that *don't* have the property, and running
> > 
> >   svn proplist -Rv .
> > 
> > will not show files that have no properties.  One solution would
> > be to use one of these, then compare that to the list of existing
> > files.  Another solution would be the script I wrote.  The first
> > is faster, but requires more work, and I was in my normal
> > lazy-hacker mood.
> 
> Well, the full-list comparison script is the idea I was suggesting
> :-).

It will be difficult to bundle this up in a robust script.  OTOH, it
would probably be trivial to change proplist.


> > My suggestion was to add a flag to proplist that will list
> > everything, just not showing the properties for paths that lack
> > them, and a similar flag to propget.  propget is trickier, since
> > you don't want to see
> > 
> >   > propget svn:mime-type foo
> >   foo - 
> > 
> > or
> > 
> >   > propget svn:mime-type foo
> >   foo - no value
> 
> We try not to add flags for every conceivable use case.  We'd grow a
> lot of flags, most of which would not be used by most users, and
> they'd take up a lot of space in the documentation and help output.

1. This particular case (svn:eol-style and svn:mime-type) seem like
   they are common problems.  It seems reasonable therefore to add
   some flag that will make it possible to write some short entry in
   the FAQ or in the book, which tells people how to run it to detect
   potential problems.

2. Since this seems to be a common problem, and if you add it to a FAQ
   or to the book, then I don't think it will be a feature that gets
   used by three people.

3. I consider this on the same convenience level as --stop-on-copy.
   It is possible to get by without it, but soon enough you write a
   script to help you.  Later on when you want to make it available
   for others, things get much more complicated since you actually
   have to parse the output instead of relying on log messages that
   don't have confusing content.  Adding a flag is natural in this
   case since no hacking is done, and the addition to the source is
   minimal.

4. I did say that propget is trickier.  For the purpose of such scan,
   I'd be happy with just a proplist thing.

5. Obviously, YYMV...

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [Issue 2319] Showing missing properties

Posted by kf...@collab.net.
Eli Barzilay <el...@barzilay.org> writes:
> That's exactly the issue...  The thing that I wanted was to catch all
> files that don't have either svn:mime-type or svn:eol-style.  Running:
> 
>   svn propget -R <prop> .
> 
> will not show files that *don't* have the property, and running
> 
>   svn proplist -Rv .
> 
> will not show files that have no properties.  One solution would be to
> use one of these, then compare that to the list of existing files.
> Another solution would be the script I wrote.  The first is faster,
> but requires more work, and I was in my normal lazy-hacker mood.

Well, the full-list comparison script is the idea I was suggesting :-).

> My suggestion was to add a flag to proplist that will list everything,
> just not showing the properties for paths that lack them, and a
> similar flag to propget.  propget is trickier, since you don't want
> to see
> 
>   > propget svn:mime-type foo
>   foo - 
> 
> or
> 
>   > propget svn:mime-type foo
>   foo - no value

We try not to add flags for every conceivable use case.  We'd grow a
lot of flags, most of which would not be used by most users, and
they'd take up a lot of space in the documentation and help output.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [Issue 2319] Showing missing properties

Posted by Eli Barzilay <el...@barzilay.org>.
On Jun  2, kfogel@collab.net wrote:
> Eli Barzilay <el...@barzilay.org> writes:
> > There was a discussion that indirectly lead me to post that.  SOrry
> > for not making a direct connection.
> > I posted something a short while ago:
> > 
> >   http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=32649
> > 
> > It has the script I had to write because of that problem.  It
> > works but it is requires invoking svn two times for each file, so
> > it's very slow.
> 
> Why not invoke Subversion on entire trees of files, instead of on one
> file at a time?

That's exactly the issue...  The thing that I wanted was to catch all
files that don't have either svn:mime-type or svn:eol-style.  Running:

  svn propget -R <prop> .

will not show files that *don't* have the property, and running

  svn proplist -Rv .

will not show files that have no properties.  One solution would be to
use one of these, then compare that to the list of existing files.
Another solution would be the script I wrote.  The first is faster,
but requires more work, and I was in my normal lazy-hacker mood.

My suggestion was to add a flag to proplist that will list everything,
just not showing the properties for paths that lack them, and a
similar flag to propget.  propget is trickier, since you don't want
to see

  > propget svn:mime-type foo
  foo - 

or

  > propget svn:mime-type foo
  foo - no value

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                  http://www.barzilay.org/                 Maze is Life!

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: [Issue 2319] Showing missing properties

Posted by kf...@collab.net.
Eli Barzilay <el...@barzilay.org> writes:
> There was a discussion that indirectly lead me to post that.  SOrry
> for not making a direct connection.
> I posted something a short while ago:
> 
>   http://subversion.tigris.org/servlets/ReadMsg?list=users&msgNo=32649
> 
> It has the script I had to write because of that problem.  It works
> but it is requires invoking svn two times for each file, so it's very
> slow.

Why not invoke Subversion on entire trees of files, instead of on one
file at a time?


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org