[fossil-users] How to save typing when checking out branches with long names?

2012-08-27 Thread vuk
I have a fossil repository where I keep my vim settings in different
branches. Here is an example output of branch listing:

$ fossil branch
* trunk
  vim-7.3.000-i486-1-custom
  vim-7.3.000-i486-1-default
  vim-7.3.154-x86_64-1-custom-big

Now, to checkout the last branch in this list, I have to copy paste the
whole name with the mouse and do:

$ fossil co vim-7.3.154-x86_64-1-custom-big

I'd be very happy if I could just type:

$ fossil co vim-7.3.154

I'd be even happier if I could just type:

$ fossil co 154

but I understand that technically this would be harder, since 154 can be a
part of an SHA1 checksum (maybe it could be escaped somehow to let fossil
know this is a substring of a tag?)

Is this just a missing feature or an intentional design choice?



___
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] How to save typing when checking out branches with long names?

2012-08-27 Thread Stephan Beal
On Mon, Aug 27, 2012 at 6:07 PM, v...@lavabit.com wrote:

 I'd be very happy if I could just type:

 $ fossil co vim-7.3.154

 I'd be even happier if I could just type:

 $ fossil co 154


Not to sound too pessimistic, but...

How is fossil supposed to be able to know that 154 is supposed to mean
abcdef154xyz or xyz154abcdef, as opposed to just being a typing mistake?
This is one of those cases where the software trying to be too clever is
likely to shoot the user in the foot at least 1 time in 20 (which is too
often, IMO).

Is this just a missing feature or an intentional design choice?


fossil places few restrictions on tag names. How long you make them is up
to you, not to fossil. What you would like to type doesn't interest
fossil - it has to be able to unambiguously determine that xyz is a
checkoutable name, and doing that becomes very difficult (or
philosophically impossible) if it has to account for every possible
_partial_ match. It can do this for commands/subcommands because the set of
commands is finite and hard-coded into the app (and it only partially
matches at the start of a string). Branch names come from the user, and
fossil does not pretend to know what the user _intends_ (and software which
presumes to know what was intended often screws it up - google for
auto-correction mistakes).

What if, using your example, i actually have branches named:

abc-def-ghi
abc-def
abc

Now abc is 3x ambiguous and abc-def is 2x ambiguous. That's MY fault, not
fossil's, and ignores partial matches at any position other than the start
of the name:

def-abc

now abc is 4x ambiguous and we have no heuristic for disambiguation other
than having the user tell fossil explicitly what is desired. If we added a
fuzzy chcekout feature it could actually break cases which currently work:

fossil co abc-def
fossil: abc-def is ambiguous: abc-def, abc-def-ghi

(doh!)

IMO the only thing fossil could reasonably be expected to do to help me
here is:

fossil branch ls

which it already does. Pair that with grep and a custom perl/awk/shell
script and it could provide such disambiguation, but i'm willing to bet
that any attempts to do so would disambiguate differently depending on the
developer's personal tastes and might even differ depending on
project-level conventions, e.g. using PLATFORM-VERSION, where checkout
PLATFORM would prefer the highest-numbered version for that platform
(which of course introduces the problem of sorting version numbers, which
is not always trivial in and of itself).

Just my 0.02 Euros.

PS: don't take my response too seriously: often i denounce proposals only
moments before someone else commits a patch for them ;).

-- 
- 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] How to save typing when checking out branches with long names?

2012-08-27 Thread Richard Hipp
On Mon, Aug 27, 2012 at 12:35 PM, Stephan Beal sgb...@googlemail.comwrote:

 On Mon, Aug 27, 2012 at 6:07 PM, v...@lavabit.com wrote:

 I'd be very happy if I could just type:

 $ fossil co vim-7.3.154

 I'd be even happier if I could just type:

 $ fossil co 154


 Not to sound too pessimistic, but...


Yeah.  I can't quite put my finger on why, but something just feels wrong
about doing prefix matching against tag names.  I wouldn't be that hard to
implement, actually (thanks to having SQLite with a GLOB operator as the
storage engine) but I'm questioning the wisdom of doing so.  You're really
going to need to sell this proposal if you want it to get into the tree.


-- 
D. Richard Hipp
d...@sqlite.org
___
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] How to save typing when checking out branches with long names?

2012-08-27 Thread Bill Burdick
This sounds like something you could put in a shell script wrapper -- just
use fossil sqlite3.


On Mon, Aug 27, 2012 at 11:07 AM, v...@lavabit.com wrote:

 I have a fossil repository where I keep my vim settings in different
 branches. Here is an example output of branch listing:

 $ fossil branch
 * trunk
   vim-7.3.000-i486-1-custom
   vim-7.3.000-i486-1-default
   vim-7.3.154-x86_64-1-custom-big

 Now, to checkout the last branch in this list, I have to copy paste the
 whole name with the mouse and do:

 $ fossil co vim-7.3.154-x86_64-1-custom-big

 I'd be very happy if I could just type:

 $ fossil co vim-7.3.154

 I'd be even happier if I could just type:

 $ fossil co 154

 but I understand that technically this would be harder, since 154 can be a
 part of an SHA1 checksum (maybe it could be escaped somehow to let fossil
 know this is a substring of a tag?)

 Is this just a missing feature or an intentional design choice?



 ___
 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] How to save typing when checking out branches with long names?

2012-08-27 Thread Scott Robison
Just throwing out a couple of ideas:

fossil globco 154

Or perhaps slightly less bad:

fossil co --glob 154

Though I'm not personally looking for this functionality myself so not
having it as an official feature doesn't bother me.

SDR

On Mon, Aug 27, 2012 at 11:00 AM, Richard Hipp d...@sqlite.org wrote:



 On Mon, Aug 27, 2012 at 12:35 PM, Stephan Beal sgb...@googlemail.comwrote:

 On Mon, Aug 27, 2012 at 6:07 PM, v...@lavabit.com wrote:

 I'd be very happy if I could just type:

 $ fossil co vim-7.3.154

 I'd be even happier if I could just type:

 $ fossil co 154


 Not to sound too pessimistic, but...


 Yeah.  I can't quite put my finger on why, but something just feels wrong
 about doing prefix matching against tag names.  I wouldn't be that hard to
 implement, actually (thanks to having SQLite with a GLOB operator as the
 storage engine) but I'm questioning the wisdom of doing so.  You're really
 going to need to sell this proposal if you want it to get into the tree.


 --
 D. Richard Hipp
 d...@sqlite.org

 ___
 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] How to save typing when checking out branches with long names?

2012-08-27 Thread Stephan Beal
On Mon, Aug 27, 2012 at 7:18 PM, Scott Robison sc...@scottrobison.uswrote:

 fossil co --glob 154

 Though I'm not personally looking for this functionality myself so not
 having it as an official feature doesn't bother me.



FWIW: as Richard said, it's _technically_ easy, but brings with it both
philosophical and usability concerns. Fossil would need a way of allowing
the user to disambiguate, e.g.:

possible matches:
1) ...
2) ...
type number to continue...

and that type of feature would then arguably need to be added to other
commands which deal with branches/tags.

IMO a custom shell-based solution is the proper place for this. If it can
be demonstrated that this is feasible, i'll stop being pessimistic about it
;). i suspect, however, that any attempt at doing so would reveal worms
which haven't yet been mentioned.

-- 
- 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] How to save typing when checking out branches with long names?

2012-08-27 Thread Scott Robison
The essence of my suggestion was to not do it by default but to provide a
simple way for the user to say yes, I really want you to search for this
substring anywhere rather than forcing it on everyone.

SDR

On Mon, Aug 27, 2012 at 11:24 AM, Stephan Beal sgb...@googlemail.comwrote:

 On Mon, Aug 27, 2012 at 7:18 PM, Scott Robison sc...@scottrobison.uswrote:

 fossil co --glob 154

 Though I'm not personally looking for this functionality myself so not
 having it as an official feature doesn't bother me.



 FWIW: as Richard said, it's _technically_ easy, but brings with it both
 philosophical and usability concerns. Fossil would need a way of allowing
 the user to disambiguate, e.g.:

 possible matches:
 1) ...
 2) ...
 type number to continue...

 and that type of feature would then arguably need to be added to other
 commands which deal with branches/tags.

 IMO a custom shell-based solution is the proper place for this. If it can
 be demonstrated that this is feasible, i'll stop being pessimistic about it
 ;). i suspect, however, that any attempt at doing so would reveal worms
 which haven't yet been mentioned.

 --
 - 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


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


[fossil-users] Is there a way to make the web server follow symlinks?

2012-08-27 Thread Stuart Rackham

Hi

I'm displaying documentation using the Embedded Documentation feature,
the web server returns the contents of symlinks, is there a way to
make the web server follow symlinks?

Cheers, Stuart
___
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] How to save typing when checking out branches with long names?

2012-08-27 Thread Peter Spjuth
On Mon, Aug 27, 2012 at 6:07 PM,  v...@lavabit.com wrote:
 I have a fossil repository where I keep my vim settings in different
 branches. Here is an example output of branch listing:

 $ fossil branch
 * trunk
   vim-7.3.000-i486-1-custom
   vim-7.3.000-i486-1-default
   vim-7.3.154-x86_64-1-custom-big

 Now, to checkout the last branch in this list, I have to copy paste the
 whole name with the mouse and do:

 $ fossil co vim-7.3.154-x86_64-1-custom-big

 I'd be very happy if I could just type:

 $ fossil co vim-7.3.154

Expanding on the bash completion script previously published in this list
by Stuart Rackham, this would give you tab completion on branch names:

# Command name completion for Fossil.
function _fossil() {
local cur commands branches
cur=${COMP_WORDS[COMP_CWORD]}
if [ $COMP_CWORD -eq 1 ] || [ ${COMP_WORDS[1]} = help ]; then
# Command name completion for 1st argument or 2nd if help command.
commands=$(fossil help --all)
COMPREPLY=( $(compgen -W $commands $cur) )
elif [ ${COMP_WORDS[1]} = update ] || [ ${COMP_WORDS[1]} = co ] ||
[ ${COMP_WORDS[1]} = checkout ]; then
branches=$(fossil branch ls | cut -c2-)
COMPREPLY=( $(compgen -W $branches $cur) )
else
# File name completion for other arguments.
COMPREPLY=( $(compgen -f $cur) )
fi
}
complete -o default -F _fossil fossil f
alias f='fossil'

/Peter
___
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] How to save typing when checking out branches with long names?

2012-08-27 Thread vuk
 On Mon, Aug 27, 2012 at 12:35 PM, Stephan Beal
 sgb...@googlemail.comwrote:

 On Mon, Aug 27, 2012 at 6:07 PM, v...@lavabit.com wrote:

 I'd be very happy if I could just type:

 $ fossil co vim-7.3.154

 I'd be even happier if I could just type:

 $ fossil co 154


 Not to sound too pessimistic, but...


 Yeah.  I can't quite put my finger on why, but something just feels wrong
 about doing prefix matching against tag names.  I wouldn't be that hard to
 implement, actually (thanks to having SQLite with a GLOB operator as the
 storage engine) but I'm questioning the wisdom of doing so.  You're really
 going to need to sell this proposal if you want it to get into the tree.


 --
 D. Richard Hipp
 d...@sqlite.org

Please don't take my initial question as lobby attempt, I rather asked to
make sure that fossil already may provide such functionality which I could
overlook when I was reading the docs.

I completely agree with points raised in this thread, perhaps the most
important one is that having such a feature wouldn't yield any significant
benefits in all scenarios. When the development is linear and happens in
the same branch for many commits, explicitly typing the full branch name
once isn't a problem of course. In a scenario that involves switching
between branches often, this could come handy, but it wouldn't be a
problem for me to have a bash script named 154 that would do 'fossil co
thatwholebranchname'. I just wanted to make sure I'm not missing a
simple way of accomplishing it using only functionality that's already
provided by fossil.



___
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] How to save typing when checking out branches with long names?

2012-08-27 Thread Stephan Beal
On Mon, Aug 27, 2012 at 10:19 PM, Peter Spjuth peter.spj...@gmail.comwrote:

 Expanding on the bash completion script previously published in this list
 by Stuart Rackham, this would give you tab completion on branch names:


+1!

Very cool :).

-- 
- 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