Re: [fossil-users] fossil CLI tricks: interrupting a commit message

2014-06-17 Thread Stephan Beal
On Tue, Jun 17, 2014 at 6:49 AM, B Harder brad.har...@gmail.com wrote:

 Remember that the buffer is only one level deep, though. A subsequent ^W,
 ^K , etc will clobber the previous contents.


Almost: try 2x (NON-consecutively) ctrl-k (or ctrl-w, or whatever), then 1x
ctrl-y, then Esc-y. Esc-y acts upon the previous Ctrl-Y, and subsequent
Esc-y's pull back one proceeding entry further from the yank buffer.

Nonetheless, it is easy to lose text this way, so i recommend the comment
method over the yank buffer.

($ is shell prompt).

 : is a command that consumes it's arguments and returns true.


Another nice one. At times i've seen in-script docs done that way:

: EOF
docs go here...
EOF

Not sure why one would do it that way, though.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
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] fossil CLI tricks: interrupting a commit message

2014-06-17 Thread Sergei Gavrikov
On Tue, 17 Jun 2014, Nico Williams wrote:

 On Mon, Jun 16, 2014 at 11:49 PM, B Harder wrote:
  Remember that the buffer is only one level deep, though. A subsequent ^W, ^K
  , etc will clobber the previous contents.
 
  Along lines of Stephan Beals method, I use : preceding the fossil command.
  So:
 
  $ : fossil ci -m 'some msg'
 
  ($ is shell prompt).

 While we're on stupid shell tricks...  If you setup your $PS1 and PS2
 just so you can make your commands safe to cut-n-pase.

 Set $PS1 to something that starts with : and ends with ;, and set
 $PS2 to just whitespace.  I do something similar with the sqlite3
 shell...

And if you setup $EDITOR or $VISUAL :-) make a habit, 'f ci'Enter.

For example, interrupt in VIM is just ':cq'. I'm sure the same exit(1)
is possible in other editors. If you wanted your text will be saved in
ci-comment-.txt.

Advantages:

1) No noise in shell history. Really, f ci -m ... fills the history by
a painful noise, ^R (reverse-i-search) for illegal check-in and hit Enter
causes ... Edit check-in comment.

2) $EDITOR is a place to think a bit more about check-in text and check-in
itself.

3) Good $EDITOR lets to automate some things, e.g. spelling, formatting,
etc.

No Editor War here. I just believe that at least $EDITOR is CLI. Excuse
my 2-3 cents.

Happy Fossiling!

Sergei
___
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] fossil CLI tricks: interrupting a commit message

2014-06-17 Thread Eric Rubin-Smith
This thread is hilarious.  I thought I was pretty old-school -- I use 
vi, xterm, fvwm2, and other tools written by my forebears around the 
time when I was born.  I get made fun of by people twice my age for my 
dev toolkit.  

But even *I* will have two terminals up concurrently -- so that I can 
write my check-in comment in terminal 1 while looking at my diff in 
terminal 2.  

I must be one of those millennials with their newfangled contraptions 
and their damn music.  

-- 
Eric A. Rubin-Smith

___
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] fossil CLI tricks: interrupting a commit message

2014-06-17 Thread Scott Robison
On Jun 17, 2014 8:42 AM, Eric Rubin-Smith eas@gmail.com wrote:

 This thread is hilarious.  I thought I was pretty old-school -- I use
 vi, xterm, fvwm2, and other tools written by my forebears around the
 time when I was born.  I get made fun of by people twice my age for my
 dev toolkit.

 But even *I* will have two terminals up concurrently -- so that I can
 write my check-in comment in terminal 1 while looking at my diff in
 terminal 2.

 I must be one of those millennials with their newfangled contraptions
 and their damn music.

Excellent point, though sometimes (occasionally) multiple terminal windows
are less practical than stashing the command line. :)
___
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] fossil CLI tricks: interrupting a commit message

2014-06-17 Thread B Harder
On 6/17/14, Stephan Beal sgb...@googlemail.com wrote:
 On Tue, Jun 17, 2014 at 6:49 AM, B Harder brad.har...@gmail.com wrote:

 Remember that the buffer is only one level deep, though. A subsequent ^W,
 ^K , etc will clobber the previous contents.


 Almost: try 2x (NON-consecutively) ctrl-k (or ctrl-w, or whatever), then 1x
 ctrl-y, then Esc-y. Esc-y acts upon the previous Ctrl-Y, and subsequent
 Esc-y's pull back one proceeding entry further from the yank buffer.

Nice! As a BSD user though, I feel compelled to point out this looks
like a readline[1] feature, and not an editline[2] feature. So it
works with bash (and likely other readline linked progs), it doesn't
work w/ (e.g.) NetBSDs /bin/sh.


Good tip though.


[1] http://en.wikipedia.org/wiki/GNU_Readline
[2] http://thrysoee.dk/editline/

 Nonetheless, it is easy to lose text this way, so i recommend the comment
 method over the yank buffer.

 ($ is shell prompt).

 : is a command that consumes it's arguments and returns true.


 Another nice one. At times i've seen in-script docs done that way:

 : EOF
 docs go here...
 EOF

 Not sure why one would do it that way, though.

 --
 - stephan beal
 http://wanderinghorse.net/home/stephan/
 http://gplus.to/sgbeal
 Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
 those who insist on a perfect world, freedom will have to do. -- Bigby
 Wolf

___
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] fossil CLI tricks: interrupting a commit message

2014-06-17 Thread Stephan Beal
On Tue, Jun 17, 2014 at 7:24 PM, B Harder brad.har...@gmail.com wrote:

 Nice! As a BSD user though, I feel compelled to point out this looks
 like a readline[1] feature, and not an editline[2] feature. So it
 works with bash (and likely other readline linked progs), it doesn't
 work w/ (e.g.) NetBSDs /bin/sh.


i've always assumed it came from emacs (where i learned it), but it's very
possibly a readline feature emacs adopted. Then again, what _hasn't_ emacs
adopted somewhere in some add-on?

Caveat: when you Esc-y you lose the top-most item in the yank buffer (the
one Ctrl-y yanked). i don't know of any way to restore them once you Esc-y
past them.

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
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] fossil CLI tricks: interrupting a commit message

2014-06-17 Thread B Harder
On Jun 17, 2014 10:47 AM, Stephan Beal sgb...@googlemail.com wrote:

 On Tue, Jun 17, 2014 at 7:24 PM, B Harder brad.har...@gmail.com wrote:

 Nice! As a BSD user though, I feel compelled to point out this looks
 like a readline[1] feature, and not an editline[2] feature. So it
 works with bash (and likely other readline linked progs), it doesn't
 work w/ (e.g.) NetBSDs /bin/sh.


 i've always assumed it came from emacs (where i learned it), but it's
very possibly a readline feature emacs adopted. Then again, what _hasn't_
emacs adopted somewhere in some add-on?

Well, it's readlines (editlines) emacs editor emulation. You can also set
it up to be vi-like:

In ~/.inputrc:

set editing-mode vi

---

...so, you're not incorrect to think of it as an emacs feature (it is), but
this is readlines emacs-inspired implementation.

 Caveat: when you Esc-y you lose the top-most item in the yank buffer (the
one Ctrl-y yanked). i don't know of any way to restore them once you Esc-y
past them.

 --
 - stephan beal
 http://wanderinghorse.net/home/stephan/
 http://gplus.to/sgbeal
 Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf

 ___
 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


[fossil-users] fossil CLI tricks: interrupting a commit message

2014-06-17 Thread Andy Goth
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 6/16/2014 3:24 PM, Stephan Beal wrote:
 1) Move your cursor to the beginning of the line. In Bash-like
 shells that's normally Ctrl-A, but many terminals support the Home
 key as well.
 
 2) Type the '#' character (shift-3 on a US keyboard). That's the
 shell's comment-to-end-of-line marker.
 
 3) Tap ENTER

I do this a lot in bash.

This almost works in csh (which I am regrettably forced to use).  Yes,
the command is not executed but is still stuffed in the history buffer,
so the requirement is met.  But it also generates an annoying error
message about # not being found.  csh doesn't understand comments when
typed interactively.

yukonbob's trick with : does work in csh without complaint.  Thanks!  I
will definitely keep it in mind.

 Or, in the Bash shell, simply:
 
 1) Tap Escape, then type the # character. That does all 3 of the
 above at once.

Neat, I didn't know about this.

- -- 
Andy Goth | andrew.m.goth/at/gmail/dot/com
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJToPLTAAoJELtYwrrr47Y43Y0H/jJLBWMy+XATUgUDa+K585sp
DcYC3QooXTuDwtX+45AmT3BbaNARDs0rBYK+85+7GgoUA1yAeAsV55tAyxK/JHZR
/psym9LX0S4q7ggvbymOqSCZ+QuzWpMSYEmSaIXGinvn8/o7eHj6YNAvF4A9wsNx
lopqK5AlrhQebc8DxDk6paVHYIzxwShAp1kMmRpkCjegT2PnkfxbqfqhxMYZLz0o
2gqXUrRunofwmyNOi2kPjPoi9DMAmGQuwSGUp0+FDrrVs/qhAKIZpH8JKdgWNe0z
cll7jDjLhU0Z2MR9rECVqvCj+AOzKBoptnttepgbHTEHblJNELUoTgkoJUp+k4g=
=+8vk
-END PGP SIGNATURE-
___
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] fossil CLI tricks: interrupting a commit message

2014-06-17 Thread Doug Franklin

On 2014-06-17 22:00, Andy Goth wrote:


This almost works in csh (which I am regrettably forced to use).  Yes,
the command is not executed but is still stuffed in the history buffer,


Maybe I'm OCD or something, but if I have to do it more than twice, it 
gets embodied as a script. :)


--
Thanks,
DougF (KG4LMZ)
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] fossil CLI tricks: interrupting a commit message

2014-06-17 Thread Andy Goth
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 6/17/2014 9:40 PM, Doug Franklin wrote:
 On 2014-06-17 22:00, Andy Goth wrote:
 
 This almost works in csh (which I am regrettably forced to use).
 Yes, the command is not executed but is still stuffed in the
 history buffer,
 
 Maybe I'm OCD or something, but if I have to do it more than twice,
 it gets embodied as a script. :)

The purpose of the exercise was to interrupt a command being typed,
stash it somewhere handy (the history buffer works well), then be able
to come back to it a short time later when the information needed to
finish typing the command is in hand.

I don't see any role for scripts in this operation, not unless someone
wants to make a script to collect half-typed commands, thereby
duplicating the (perhaps unintentional) shell feature discussed in
this thread.

- -- 
Andy Goth | andrew.m.goth/at/gmail/dot/com
-BEGIN PGP SIGNATURE-
Version: GnuPG v2.0.22 (MingW32)
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBAgAGBQJToR+MAAoJELtYwrrr47Y4YgsH/3Hp9+4FgNtBpS56QHfSOD7h
yA3XbD2MP1tTiiUlbkWlFsEWkGeljShcewIhWxG5h4zzpw5bvb5axH3gni26Z1dJ
6lgW9+iOynyGbsdouFyYTJHtT8YKRJhq10vhiMMpII26n+MrgDhEJBFBDXkab1K5
85oxvgNM70xVHGccja2gfcBvSutcD7W8k2rvfQOaAM8+odhdXLL+Xs9X2GVAf5gs
RMtpGT4g2qKgpNtT8RDS9+H6tHNcyT1Bj/NIjlNNcnWfjIRJsXXG2OWj/LhbVvNZ
NWiDXC/qdxaGFOmKYrJoLzYJBJ+F40MiXxTHAl1QLjxYckvLl7gTl/EIJpXV47E=
=IcYY
-END PGP SIGNATURE-
___
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users


[fossil-users] fossil CLI tricks: interrupting a commit message

2014-06-16 Thread Stephan Beal
Hi, all,

This is for Unix-shell users only (including workalikes on Windows)...

Here's a time-saving tip which i use very often myself, but most CLI users
i know don't seem to know about:

It often happens that i'm typing a commit message when i decide i need to
stop and go check if what i'm typing in really reflects reality (or needs
to be tested). So:

fossil commit -m .INTERRUPT POINT

You can stick that line in your command history without executing it by
doing the following:

1) Move your cursor to the beginning of the line. In Bash-like shells
that's normally Ctrl-A, but many terminals support the Home key as well.

2) Type the '#' character (shift-3 on a US keyboard). That's the shell's
comment-to-end-of-line marker.

3) Tap ENTER

Or, in the Bash shell, simply:

1) Tap Escape, then type the # character. That does all 3 of the above at
once.


Happy Fossiling!

-- 
- stephan beal
http://wanderinghorse.net/home/stephan/
http://gplus.to/sgbeal
Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
those who insist on a perfect world, freedom will have to do. -- Bigby Wolf
___
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] fossil CLI tricks: interrupting a commit message

2014-06-16 Thread Scott Robison
On Mon, Jun 16, 2014 at 2:24 PM, Stephan Beal sgb...@googlemail.com wrote:

 Hi, all,

 This is for Unix-shell users only (including workalikes on Windows)...

 Here's a time-saving tip which i use very often myself, but most CLI users
 i know don't seem to know about:

 It often happens that i'm typing a commit message when i decide i need to
 stop and go check if what i'm typing in really reflects reality (or needs
 to be tested). So:

 fossil commit -m .INTERRUPT POINT

 You can stick that line in your command history without executing it by
 doing the following:

 1) Move your cursor to the beginning of the line. In Bash-like shells
 that's normally Ctrl-A, but many terminals support the Home key as well.

 2) Type the '#' character (shift-3 on a US keyboard). That's the shell's
 comment-to-end-of-line marker.

 3) Tap ENTER

 Or, in the Bash shell, simply:

 1) Tap Escape, then type the # character. That does all 3 of the above at
 once.


On Windows when using cmd.exe, you can do something very similar. Hit home
and type remspace to remark (comment) out the line. The space part
is a literal space character (ascii 32), not the characters '', 's', etc.
Then hit enter. Now you can scroll back up to it later. rem is a legacy
of command.com. :)

SDR
___
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] fossil CLI tricks: interrupting a commit message

2014-06-16 Thread Matt Welland
Under bash another way to achieve the goal of temporarily putting your
partially written commit command aside is to do: ^a ^k
This puts your command in the cut buffer. To retrieve it (after having run
fossil gdiff to figure out what you did!) just do: ^y




On Mon, Jun 16, 2014 at 1:24 PM, Stephan Beal sgb...@googlemail.com wrote:

 Hi, all,

 This is for Unix-shell users only (including workalikes on Windows)...

 Here's a time-saving tip which i use very often myself, but most CLI users
 i know don't seem to know about:

 It often happens that i'm typing a commit message when i decide i need to
 stop and go check if what i'm typing in really reflects reality (or needs
 to be tested). So:

 fossil commit -m .INTERRUPT POINT

 You can stick that line in your command history without executing it by
 doing the following:

 1) Move your cursor to the beginning of the line. In Bash-like shells
 that's normally Ctrl-A, but many terminals support the Home key as well.

 2) Type the '#' character (shift-3 on a US keyboard). That's the shell's
 comment-to-end-of-line marker.

 3) Tap ENTER

 Or, in the Bash shell, simply:

 1) Tap Escape, then type the # character. That does all 3 of the above at
 once.


 Happy Fossiling!

 --
 - stephan beal
 http://wanderinghorse.net/home/stephan/
 http://gplus.to/sgbeal
 Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
 those who insist on a perfect world, freedom will have to do. -- Bigby Wolf

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




-- 
Matt
-=-
90% of the nations wealth is held by 2% of the people. Bummer to be in the
majority...
___
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] fossil CLI tricks: interrupting a commit message

2014-06-16 Thread B Harder
Remember that the buffer is only one level deep, though. A subsequent ^W,
^K , etc will clobber the previous contents.

Along lines of Stephan Beals method, I use : preceding the fossil
command. So:

$ : fossil ci -m 'some msg'

($ is shell prompt).

: is a command that consumes it's arguments and returns true.
On Jun 16, 2014 3:34 PM, Matt Welland estifo...@gmail.com wrote:

 Under bash another way to achieve the goal of temporarily putting your
 partially written commit command aside is to do: ^a ^k
 This puts your command in the cut buffer. To retrieve it (after having run
 fossil gdiff to figure out what you did!) just do: ^y




 On Mon, Jun 16, 2014 at 1:24 PM, Stephan Beal sgb...@googlemail.com
 wrote:

 Hi, all,

 This is for Unix-shell users only (including workalikes on Windows)...

 Here's a time-saving tip which i use very often myself, but most CLI
 users i know don't seem to know about:

 It often happens that i'm typing a commit message when i decide i need to
 stop and go check if what i'm typing in really reflects reality (or needs
 to be tested). So:

 fossil commit -m .INTERRUPT POINT

 You can stick that line in your command history without executing it by
 doing the following:

 1) Move your cursor to the beginning of the line. In Bash-like shells
 that's normally Ctrl-A, but many terminals support the Home key as well.

 2) Type the '#' character (shift-3 on a US keyboard). That's the shell's
 comment-to-end-of-line marker.

 3) Tap ENTER

 Or, in the Bash shell, simply:

 1) Tap Escape, then type the # character. That does all 3 of the above at
 once.


 Happy Fossiling!

 --
 - stephan beal
 http://wanderinghorse.net/home/stephan/
 http://gplus.to/sgbeal
 Freedom is sloppy. But since tyranny's the only guaranteed byproduct of
 those who insist on a perfect world, freedom will have to do. -- Bigby Wolf

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




 --
 Matt
 -=-
 90% of the nations wealth is held by 2% of the people. Bummer to be in the
 majority...

 ___
 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] fossil CLI tricks: interrupting a commit message

2014-06-16 Thread Nico Williams
On Mon, Jun 16, 2014 at 11:49 PM, B Harder brad.har...@gmail.com wrote:
 Remember that the buffer is only one level deep, though. A subsequent ^W, ^K
 , etc will clobber the previous contents.

 Along lines of Stephan Beals method, I use : preceding the fossil command.
 So:

 $ : fossil ci -m 'some msg'

 ($ is shell prompt).

While we're on stupid shell tricks...  If you setup your $PS1 and PS2
just so you can make your commands safe to cut-n-pase.

Set $PS1 to something that starts with : and ends with ;, and set
$PS2 to just whitespace.  I do something similar with the sqlite3
shell...

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