Fossil

Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: ed91c9bd479498d57dff7616fbf2cb487623152f540987f86120117cc20ee57b
Ticket: 58339f7b10de7c67e09ef41ba9d90c7dc4c972f1
The excellent branching wiki, needs a similar "how to merge" page...
User & Date: stephan 2023-01-17 17:01:16
Changes

  1. comment changed to:
    I found the branching page very useful:
    <pre>
    http://www.fossil-scm.org/index.html/doc/tip/www/branching.wiki
    </pre>
    thank you for writing that.
    
    One bit needs expanding for those of us who are new to version control as well as fossil (just above figure 3):
    
    <blockquote>
    To resolve this situation, Alice can use the fossil <b>merge</b> command to merge in Bob's changes in her local copy of check-in 3. Then she can commit the results as check-in 5. This results in a tree as shown in figure 3.
    </blockquote>
    
    ...but how?!!!
    
    I created a fork in the manner described, but it seems that Alice has no indication that Bob has made a fork and would happily carry on on her own making more and more changes... Is there some indicator I'm missing?
    
    If she does a <kbd>fossil update</kbd>, I can see that <kbd>fossil diff</kbd> notices a change, and <kbd>fossil merge</kbd> says bad things have happened, but I have no idea what to do about it...
    
    Here is what I've been up to:
    <verbatim>
    C:\tmp\fossil>dir
     Volume in drive C has no label.
     Volume Serial Number is 4C8C-4143
    
     Directory of C:\tmp\fossil
    
    22/05/2010  08:42 PM    <DIR>          .
    22/05/2010  08:42 PM    <DIR>          ..
    22/05/2010  08:38 PM           864,768 fossil.exe
    22/05/2010  08:41 PM               209 manifest
    22/05/2010  08:41 PM                41 manifest.uuid
    22/05/2010  08:41 PM            52,224 Test.fossil
    22/05/2010  08:40 PM                32 Test.txt
                   5 File(s)        917,274 bytes
                   2 Dir(s)  61,822,676,992 bytes free
    
    C:\tmp\fossil>type test.txt
    Line 1
    Line 2
    Line 3
    Line 4
    C:\tmp\fossil>fossil open Test.fossil
    Test.txt
    project-name: <unnamed>
    repository:   C:/tmp/fossil/Test.fossil
    local-root:   C:/tmp/fossil/
    user-home:    C:/Users/Alice/AppData/Local
    project-code: cd278cccb1fe96312af904be9d2fac0e942a777c
    server-code:  2b9fde97a0fdf6a42774b4417e325d201b783491
    checkout:     6b297dec4f5a51d94e53e416b8926ce84e7f79e2 2010-05-22 19:41:29 UTC
    parent:       5b5b6a6cc6ab0069b7c5edc3894a01f323ddf651 2010-05-22 19:18:34 UTC
    tags:         trunk
    
    C:\tmp\fossil>type test.txt
    Line 1
    Line 2
    Line 3
    Line 4
    C:\tmp\fossil>fossil checkout --latest
    
    C:\tmp\fossil>type test.txt
    Line 1
    Line 2
    Line 3
    Line 4
    C:\tmp\fossil>fossil update
    Autosync:  http://Ross@mesh-elite-d805:8080/Test.fossil
                    Bytes      Cards  Artifacts     Deltas
    Send:             130          1          0          0
    Received:        1012         22          0          0
    Total network traffic: 330 bytes sent, 737 bytes received
    
    C:\tmp\fossil>type test.txt
    Line 1
    Line 2
    Line 3
    Line 4
    C:\tmp\fossil>fossil merge e6fb455f91
    MERGE Test.txt
    ***** 1 merge conflicts in Test.txt
    
    C:\tmp\fossil>fossil diff
    Index: Test.txt
    ===================================================================
    --- Test.txt
    +++ Test.txt
    @@ -1,4 +1,6 @@
     Line 1
     Line 2
     Line 3
    -Line 4
    +>>>>>>> BEGIN MERGE CONFLICT
    +Line 5============================
    +Line 4<<<<<<< END MERGE CONFLICT
    
    
    C:\tmp\fossil>fossil merge --cherrypick e6fb455f91
    MERGE Test.txt
    ***** 1 merge conflicts in Test.txt
    </pre>
    
    What does --cherrypick do?
    
    Oh, and Bob's Test.txt looks like this:
    <pre>
    Line 1 
    Line 2 
    Line 3
    Line 5
    </verbatim>
    
    So how is Alice to know Bob made a fork (without having to look on the web page for Branches before editing every file)?
    
    She presumably has to use the Branches page to find out the version of her prong of the fork to do the merge, but how does she actually do the merge?
    
    <hr><i>anonymous claiming to be Arnel added on 2010-05-23 17:00:51:</i><br>
    Alice needs to do a <tt>fossil pull</tt> to update her repo with the changes, then she can do a <tt>fossil merge</tt>.
    
    If there are conflicts that Fossil cannot resolve on its own (like changes made on the same line), you may need to step in and resolve the conflicts yourself.
    
    <hr><i>anonymous added on 2010-05-23 19:47:41:</i><br>
    That's so cool! It definitely needs explaining and showing off!
    
    I expected Alice to have to notice that a fork had happened, somehow, then copy her local Test.txt elsewhere so it didn't get overwritten, then pull, then use some diff app like kdiff3 to compare the two versions...
    
    but all that happens is that fossil adds MERGE CONFLICT to the file in the problem areas, so she can search for those and edit in just the one file.
    
    Checked-in binaries are, I guess, a whole different problem?
    
    I need to try it again to make sure I've got it: I merged before pulling, which may have made it so Alice didn't need to realise there was a fork...
    
  2. icomment:
    Closing because the documentation has been significantly overhauled since this ticket was opened.
    
  3. login: "stephan"
  4. mimetype: "text/x-fossil-wiki"
  5. resolution changed to: "Overcome_By_Events"
  6. status changed to: "Closed"