Re: [fossil-users] Reading file list from file instead of command line (response file)

2013-05-25 Thread Stephan Beal
On Sat, May 25, 2013 at 6:17 PM, Stefan Bellon  wrote:

> There's a small "bug" in the --args implementation though. If the
> response file "foo" does not end with a newline, then the last byte of
> the last line is missing.
>

No there's not ;)

http://fossil-scm.org/index.html/info/ee990ebb99

Thanks for the report!

-- 
- 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] Reading file list from file instead of command line (response file)

2013-05-25 Thread Stefan Bellon
On Sat, 25 May, Stephan Beal wrote:

> fossil commit -m '...' --args foo

There's a small "bug" in the --args implementation though. If the
response file "foo" does not end with a newline, then the last byte of
the last line is missing.

-- 
Stefan Bellon
___
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] Reading file list from file instead of command line (response file)

2013-05-25 Thread Stefan Bellon
On Sat, 25 May, Stephan Beal wrote:

> You can now:
[...]
> That's in the trunk.

Cool, thanks. :-)

Greetings,
Stefan

-- 
Stefan Bellon
___
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] Reading file list from file instead of command line (response file)

2013-05-25 Thread Stephan Beal
> On Sat, May 25, 2013 at 3:00 PM, Stefan Bellon  wrote:
>
>> Anyway I could have found this myself using the command line help or in
>>
> the Wiki?
>>
>
>
You can now:

[stephan@host:~/cvs/fossil/fossil/src]$ f
Usage: f COMMAND ...
   or: f help   -- for a list of common commands
   or: f help COMMMAND  -- for help with the named command

Commands and filenames may be passed on to fossil from a file
by using:

f --args FILENAME ...

Each line of the file is assumed to be a filename unles it starts
with '-' and contains a space, in which case it is assumed to be
another flag and is treated as such. --args FILENAME may be used
in conjunction with any other flags.


That's in the trunk.

-- 
- 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] Reading file list from file instead of command line (response file)

2013-05-25 Thread Stephan Beal
On Sat, May 25, 2013 at 3:00 PM, Stefan Bellon  wrote:

> I find the name "args" of the option a bit confusing,
>

Me, too, but no better name was suggested at the time we implemented it.



> and I am not sure
> what the purpose of 3c) is. I assume it is some trivial heuristic to
> allow for
>
> -t ci
>
> in one line of the response file.
>

That's exactly that 3c is for. During the initial implementation it became
clear that we had a problem for filenames with spaces. Richard suggested
that we do the above as a workaround, so that files with spaces will work.


> Anyway I could have found this myself using the command line help or in
> the Wiki?
>

...checking... not anywhere that i can find. i'll get it added to the main
'fossil help'.

-- 
- 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] Reading file list from file instead of command line (response file)

2013-05-25 Thread Stefan Bellon
On Sat, 25 May, Stephan Beal wrote:

> Kind of:
> 
> create a file (we'll call it foo) with your list of files and then
> try:
> 
> fossil commit -m '...' --args foo
> 
> that will replace the "--args foo" part with the contents of the file,
> basically.

Exactly like this. Thanks a lot. :-)

> Here are the soure code comments about that feature:
> 
> ** Convert all arguments from mbcs (or unicode) to UTF-8. Then
> ** search g.argv for arguments "--args FILENAME". If found, then
> ** (1) remove the two arguments from g.argv
> ** (2) Read the file FILENAME
> ** (3) Use the contents of FILE to replace the two removed arguments:
> ** (a) Ignore blank lines in the file
> ** (b) Each non-empty line of the file is an argument, except
> ** (c) If the line begins with "-" and contains a space, it is
> broken
> ** into two arguments at the space.

I find the name "args" of the option a bit confusing, and I am not sure
what the purpose of 3c) is. I assume it is some trivial heuristic to
allow for

-t ci

in one line of the response file.

But apart from that it looks exactly like what I need. Again, thanks
for the pointer.

Anyway I could have found this myself using the command line help or in
the Wiki?

Greetings,
Stefan

-- 
Stefan Bellon
___
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] Reading file list from file instead of command line (response file)

2013-05-25 Thread Stephan Beal
On Sat, May 25, 2013 at 10:53 AM, Stefan Bellon  wrote:

> is it possible to read long lists of files from another file (or stdin)
> instead of the command line?
>

Kind of:

create a file (we'll call it foo) with your list of files and then try:

fossil commit -m '...' --args foo

that will replace the "--args foo" part with the contents of the file,
basically.

Here are the soure code comments about that feature:

** Convert all arguments from mbcs (or unicode) to UTF-8. Then
** search g.argv for arguments "--args FILENAME". If found, then
** (1) remove the two arguments from g.argv
** (2) Read the file FILENAME
** (3) Use the contents of FILE to replace the two removed arguments:
** (a) Ignore blank lines in the file
** (b) Each non-empty line of the file is an argument, except
** (c) If the line begins with "-" and contains a space, it is broken
** into two arguments at the space.


-- 
- 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] Reading file list from file instead of command line (response file)

2013-05-25 Thread Stefan Bellon
On Sat, 25 May, Martin Gagnon wrote:

> You can use xargs (if you are in a posix system)
> 
> Example:
>   cat file_list.txt | xargs fossil add
> 
> If you have space on some file names.. it could cause some problem, if
> you have a few you can add them separately...

Thanks for all your help. Yes, I know all about this.

While this works for some commands (like your "fossil add" example,
because it does not matter how often "fossil add" is being called), it
does not work so good with other commands, e.g. "fossil commit": It
would produce several commits if the file list exceeds the threshold
limit set by xargs (see its man page).

If you'd want to avoid this, you could also just do

fossil commit -m "message" `cat file_list.txt`

but then again having the problem with the command line length limit.

The other point is, that I'm looking for an OS independent way of doing
it, because it has to work in a mixed-OS environment.

That's why I specifically asked for the possibility to let fossil
handle this. Compilers call it "compiler response file". Go, google it
up, if you don't know what I'm talking about.

Greetings,
Stefan

-- 
Stefan Bellon
___
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] Reading file list from file instead of command line (response file)

2013-05-25 Thread Martin Gagnon
On Sat, May 25, 2013 at 10:53:22AM +0200, Stefan Bellon wrote:
> Hi all,
> 
> is it possible to read long lists of files from another file (or stdin)
> instead of the command line?
> 
> Imagine having to commit hundreds of files (but not the complete current
> working copy!) and reaching the command line length limit of the
> underlying OS.
> 

You can use xargs (if you are in a posix system)

Example:
cat file_list.txt | xargs fossil add

If you have space on some file names.. it could cause some problem, if
you have a few you can add them separately...

-- 
Martin G.
___
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] Reading file list from file instead of command line (response file)

2013-05-25 Thread Stefan Bellon
On Sat, 25 May, Goyo wrote:

> Isn't that why we invented pipes? Something like this should work in
> unix and the like (not tested):
> 
> $ cat filenames.txt | fossil commit -m "Some stuff"

That would require "fossil commit" to read the list of files to commit
from stdin, otherwise piping data into fossil's stdin is just
meaningless.

-- 
Stefan Bellon
___
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] Reading file list from file instead of command line (response file)

2013-05-25 Thread Goyo
2013/5/25 Stefan Bellon :
> Hi all,
>
> is it possible to read long lists of files from another file (or stdin)
> instead of the command line?
>
> Imagine having to commit hundreds of files (but not the complete current
> working copy!) and reaching the command line length limit of the
> underlying OS.

Isn't that why we invented pipes? Something like this should work in
unix and the like (not tested):

$ cat filenames.txt | fossil commit -m "Some stuff"

Goyo
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] Reading file list from file instead of command line (response file)

2013-05-25 Thread Stefan Bellon
Hi all,

is it possible to read long lists of files from another file (or stdin)
instead of the command line?

Imagine having to commit hundreds of files (but not the complete current
working copy!) and reaching the command line length limit of the
underlying OS.

Greetings,
Stefan

-- 
Stefan Bellon
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users