On Sep 11, 2015, at 2:34 PM, Noam Postavsky <npost...@users.sourceforge.net> 
wrote:
> 
> Okay, if you define branch that way…

It isn’t a question of philosophical semantics.  Stephan is telling you a fact 
about how Fossil behaves, not offering a fuzzy definition.

Maybe I’m being overly sensitive about your choice of words, but in my world, 
definitions are fluid, may change over time, and usually don’t capture the 
entire sense of a concept even while the definition is current.

This aspect of Fossil’s behavior, by contrast, is *highly* unlikely to change, 
since doing so would probably break any nontrivial existing repository.

> the problem is that both
> branches happen to have the same name.

Keep in mind that branch names and tags are secondary things in Fossil.  
They’re merely labels on the underlying truth: the artifacts, their 
relationships, etc. The only reason two branches with the same name is a 
problem is that we humans prefer to call things by name rather than by artifact 
ID.

But, cases like this are one situation where you really do need to know that 
ID, or “hash” as this thread calls it.

It isn’t really a hash since it isn’t computed from the contents of the 
artifact.  It’s just a random number, expressed as a long hex string.  It 
*looks* like a hash, but it isn’t.  Proof:

  cd ~/tmp
  f new ../x.fossil
  f new ../y.fossil
  f open ../x.fossil
  touch foo
  f add foo
  f ci -m .
  f close
  f open ../y.fossil 
  f add foo
  f ci -m .
  f close

Notice that the “hashes” change value in both identical cases: the project 
codes are different, the initial checkout ID is different, and the checkin ID 
for “foo” in both cases is different, even though it hasn’t changed in any way. 

When you create a fork, the proper way to heal it back into a single branch is 
to merge one of the two halves into the other.  After the fork is healed, “f up 
branch-name” will give you the tip of that branch, which is now unambiguous 
because there is only one branch tip again.

And to heal that branch, you will need the artifact ID at the tip of the other 
side of the fork.

So that’s why you need to know about artifact IDs. :)

> I guess that's not so bad if forking is rare.

I think the only time I’ve created a fork is when working offline, so that 
autosync can’t save me from creating accidental forks.
_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to