Re: [fossil-users] An idea to make command line life easier

2012-01-31 Thread Jacek Cała
Hmm... Clearly, it can be scripted in perl (@James) and in bash/awk
(@Lluís) and using other tools but:

1. The use of, say, '-r 1-3' syntax is much more convenient than
piping to awk everytime I need a selective commit, diff or alike.
2. Writing/using a separate perl/bash/whatever script seems much not
like the fossil many-in-one approach.
3. I'm on a win box and don't {have/want} to install
perl/cygwin/whatever to get tools, to build scripts, to use such a
feature.
4. As Stephan suggested, it seems not too difficult to implement.
5. Perhaps it is even not too costly to run everytime we need a
selective command.

More opinions welcome.

  Cheers,
  Jacek


2012/1/31 Lluís Batlle i Rossell :
> On Tue, Jan 31, 2012 at 06:45:11PM +, Jacek Cała wrote:
>
> How would it be different than:
>  fossil changes | awk '{ print NR " " $0; }'
>
> or with your filter on lines:
>  fossil changes | awk '{ if(NR >= 3 && NR =< 4) print NR " " $0; }'
>
>
> Regards,
> Lluís.
> ___
> fossil-users mailing list
> fossil-users@lists.fossil-scm.org
> http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] An idea to make command line life easier

2012-01-31 Thread Lluís Batlle i Rossell
On Tue, Jan 31, 2012 at 06:45:11PM +, Jacek Cała wrote:
> I've just got an idea about how to improve the use of fossil command
> line a bit. The main thing is to add an additional index column when
> running 'fossil changes', so instead of:
> 
> > fossil cha
> 
> EDITEDsomefile.x
> EDITEDdir\anotherone.xx
> EDITEDdir\somefile.x
> ...
> 
> it would produce:
> 
> > fossil cha
> 
> 1  EDITED   somefile.x
> 2  EDITED   dir\anotherone.xx
> 3  EDITED   dir\somefile.x
> ...

How would it be different than:
 fossil changes | awk '{ print NR " " $0; }'

or with your filter on lines:
 fossil changes | awk '{ if(NR >= 3 && NR =< 4) print NR " " $0; }'


Regards,
Lluís.
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] An idea to make command line life easier

2012-01-31 Thread Stephan Beal
2012/1/31 Jacek Cała 

> > fossil commit -m "Some changes in dir" --filerange [2-3]
>
> or
>
> > fossil commit -m "Some changes in somefiles" --filerange 1,3
>

That's an interesting idea. The first syntax wouldn't be ideal because the
[ and ] operators actually mean something to unix shells, but the second
form, including 1-3 could be done. In fact i have some C code for parsing
ranges like that in another project of mine, and it would be easy enough to
port that in. The only problem i see at the moment is that such numbers are
transient - they potentially change with any given file-level change. e.g.

fossil changes
1 abc
2 def
3 xyz

then i edit file "lmn" and run:

fossil commit -m '...' 1-3

it "could be" (and likely will be) that file lmn is now #3 (assuming
lexical ordering).

Fossil "could", as part of "changes" or "status" record the last known
list, and check that list before allowing a commit to be performed, and
erroring out if (A) the list has changed since the last "changes"/"status"
and (B) the user supplied a numeric list on the CLI.

A secondary (but probably minor) problem is that this syntax prohibits
numerically named files (probably a rarity, but someone out there probably
has 1 or 2 of them (no pun intended).

useful. Also, could Richard, Stephan and others who spent more time on
>

i think that's the first time someone has accused me of being familiar with
the fossil innards ;).

i think the idea is interesting and quite possibly doable with relatively
little effort, but i also know that i tend to miss some of the "bigger
picture" pitfalls which others on this list historically point out for, so
i'd like to wait and see what some of the others say...

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


Re: [fossil-users] An idea to make command line life easier

2012-01-31 Thread James Turner
On Tue, Jan 31, 2012 at 06:45:11PM +, Jacek Ca??a wrote:
> Hi all,
> 
> I've just got an idea about how to improve the use of fossil command
> line a bit. The main thing is to add an additional index column when
> running 'fossil changes', so instead of:
> 
> > fossil cha
> 
> EDITEDsomefile.x
> EDITEDdir\anotherone.xx
> EDITEDdir\somefile.x
> ...
> 
> it would produce:
> 
> > fossil cha
> 
> 1  EDITED   somefile.x
> 2  EDITED   dir\anotherone.xx
> 3  EDITED   dir\somefile.x

Sounds like a perl script I recently came across for git.

https://github.com/holygeek/git-number

-- 
James Turner
ja...@calminferno.net
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] An idea to make command line life easier

2012-01-31 Thread Jacek Cała
Hi all,

I've just got an idea about how to improve the use of fossil command
line a bit. The main thing is to add an additional index column when
running 'fossil changes', so instead of:

> fossil cha

EDITEDsomefile.x
EDITEDdir\anotherone.xx
EDITEDdir\somefile.x
...

it would produce:

> fossil cha

1  EDITED   somefile.x
2  EDITED   dir\anotherone.xx
3  EDITED   dir\somefile.x
...

Given the index a number of commands, like commit, diff, delete, could
not only take file names as the input argument but also a number, a
list of numbers, a range, etc.
Then, to commit one could use sth like:

> fossil commit -m "Some changes in dir" --filerange [2-3]

or

> fossil commit -m "Some changes in somefiles" --filerange 1,3

or any combination of these.

I've looked into the source code and it seems that it would not be too
difficult to implement (at least for commit; I didn't look thoroughly)
but first would like to know your opinion if you would find that
useful. Also, could Richard, Stephan and others who spent more time on
fossil development say if this is really possible or rather I overlook
something and there is an inherent flaw in the idea.

  Many thanks,
  Jacek
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users