Re: [fossil-users] how to branch

2013-05-14 Thread Konstantin Khomoutov
On 13 May 2013 23:42:46 -0600
Andy Bradford amb-fos...@bradfords.org wrote:

  That is, it's backwards: you first do some work, then decide to
  commit and  decide  this commit  should  start  its  own branch
  rather  than continuing  the current  one,  so  you create  that
  new branch  while committing.
 
 Not  exactly backwards,  but  more  of a  convenience.  If you
 suddenly discover that  your changes should  not yet go  into the
 trunk,  you can branch at the moment of the  commit. This makes
 branching extremely easy to accomplish and less of a  hassle to get
 the changes committed without breaking the rest  of the sources.
 With  other VCS you would  have to go through a few  more girations
 to get your newly  changed files committed at the *right* location.

Changing a branch under a dirty work tree is achieved with a single
command in Git and two commands in Subversion; not sure about less
mainstream VCSes.  But I digress.  If memory serves me right, initially
Fossil only supported creation of a branch when committing, and
explicit branch creation has been added afterwards, per user requests.

I would say this is not about convenience but rather about different
mindsets: some people just don't feel right when they can't start a
new line of by *first* creating a branch to work on.  People with
a different mindset are fine with first coding something and then
deciding where this should go.  There definitely was at least one
thread on this list which discussed this matter, with Richard Hipp
chiming in and explaining he has the mindert of the latter kind ;-)
Of course, the convenience argument still holds, just not when it comes
to history of implementation of these features.

And if, again, memory serves me right, explicit creation of a branch
works by creating an empty commit on that newborn branch -- specifically
for the purpose of attaching the necessary tags to it, which are to
designate the branch.  I'm inclined to think this hints at that such a
mode of operation wasn't initially envisioned.
___
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 branch

2013-05-14 Thread Stephan Beal
On Tue, May 14, 2013 at 11:17 PM, Stephan Beal sgb...@googlemail.comwrote:

 Poking around a little in the repo i just randomly selected a really old
 version of checkin.c which does not contain the --branch option to the ci
 command:


 http://www.fossil-scm.org/index.html/artifact/4a866358e30844ec8501e980dbe2d87f02c34406

 But here's from from 2009 which does have it, so it's been around a while:


 http://www.fossil-scm.org/index.html/artifact/43b7742fd68d09627b40cf44bbeb83ab9fc6c384


Here we go:

http://www.fossil-scm.org/index.html/info/4ac75b9107

--branch was added there (Jan. 24th 2009). That was about 13 months after i
started using fossil, so the checkout-then-edit must have come first.

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

2013-05-13 Thread Konstantin Khomoutov
On Tue, May 14, 2013 at 01:55:56AM +, varro wrote:

 I've been experimenting with fossil for some private projects of mine
 and now want to use the 'branch' facility.  According to the 'help'
 text for 'branch', the syntax to create a new branch is:
 
   fossil branch new BRANCH-NAME BASIS ?OPTIONS?
 
 but it doesn't explain what BASIS is.
 
 Looking at the Jim Schimpf book, I see he gives as an example:
 
   fossil branch new VER_1.0 trunk -bgcolor 0xFFC0FF
 
 Trying this on one of my own repositories, I tried:
 
   % ls -l recepsum.fossil
   -rw-r--r--  1 william  william  129024 Apr 30 21:17 recepsum.fossil
 
   % fossil branch new UI trunk -R recepsum.fossil
   fossil: use --repository or -R to specify the repository database
 
 Excuse me if I've missed something obvious here, but I've been staring
 at this and don't see what I'm doing wrong.

You seem to confuse branching with checking out a branch (to a working
directory).

You first need to open your repository:

% mkdir recepsum; cd $_
% fossil open ../recepsum.fossil

(So now you have your working directory initialized and linked to that
repository, which you can verify by running `fossil status`.)

And now you can do branching at will using `fossil branch`.

Note though that while Fossil does allow you to create a branch before
starting to work on it, it's standard mode of operation (as envisioned
by its creator) is to use the --branch command-line option when
recording the first commit on the branch which is about to be created.
That is, it's backwards: you first do some work, then decide to commit
and decide this commit should start its own branch rather than
continuing the current one, so you create that new branch while
committing.

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

2013-05-13 Thread Andy Bradford
Thus said Konstantin Khomoutov on Tue, 14 May 2013 07:40:41 +0400:

 That is, it's backwards: you first do some work, then decide to commit
 and  decide  this commit  should  start  its  own branch  rather  than
 continuing  the current  one,  so  you create  that  new branch  while
 committing.

Not  exactly backwards,  but  more  of a  convenience.  If you  suddenly
discover that  your changes should  not yet go  into the trunk,  you can
branch at the moment of the  commit. This makes branching extremely easy
to accomplish and less of a  hassle to get the changes committed without
breaking the rest  of the sources. With  other VCS you would  have to go
through a few  more girations to get your newly  changed files committed
at the *right* location.

However, it is  also just as easy  to pick a particular node  in the DAG
and branch from that too which  is what the fossil branch command allows
for.

Andy
-- 
TAI64 timestamp: 40005191cef9


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