Ticket Change Details
Not logged in
Overview

Artifact ID: 5a7c868ff645e4f7e6f2b90d9c7aec21cf088e66
Ticket: 5cc33a6aa0621be8936f7b34b8c8e0e8f16f9ce7
Committing one file while another is pending delete will commit both files.
User & Date: drh 2010-11-24 15:06:03
Changes

  1. comment changed to:
    It seems that I have found a bug in fossil.  I found this as I was trying to add a file but a diff of my commit shows that I removed one as well.  However when I committed, I only specified the file that I wanted to add:
    
    # fossil commit path/to/file_to_add -m "Added file."
    
    I performed the following operations to test and reproduce the bug:
    
    <pre>
    # mkdir /tmp/fossilbug
    # cd /tmp/fossilbug
    # fossil new my.fossil
    project-id: 2b1773e0efaf0a28844f51226f4dcf88ff7ed73b
    server-id:  1b7807e55a0d9c863b0e47063d59ef700d7f03cc
    admin-user: admin (initial password is "15b831")
    # fossil open my.fossil
    # date > file1
    # date > file2
    # date > file3
    # date > file4
    # fossil add file*
    ADDED  file1
    ADDED  file2
    ADDED  file3
    ADDED  file4
    # fossil commit -m "Added 4 test files"
    New_Version: 181cd0b02dfd84476e804eb9230e87c7ff26bdcb
    # fossil delete file1
    DELETED  file1
    # date > file4
    # fossil changes
    DELETED    file1
    EDITED     file4
    # fossil commit file4 -m "committing ONLY the modified while a file is pending deleted"
    New_Version: 98de35d30e35a6a206c943b7b34afbe4744db2cf
    # fossil changes
    DELETED    file1
    </pre>
    
    As you can see, I created a new fossil repo for my test.  Added 4 files with random content and committed.
    
    Then I removed one file and I modified another.  I commit the file that I modified but not the file that I removed.  In my local folder, the deleted file is still pending.  However... if you use finfo or diff.. you will see that the file WAS deleted on my commit.
    
    <pre>
    # fossil finfo file1
    History of file1
    2010-11-23 [98de35d30e] DELETED test modified while a file is pending deleted
               (user: roychri)
    2010-11-23 [181cd0b02d] test 1 (user: roychri, artifact: [99d7a1f973])
    # fossil diff --from 181cd0b02dfd84476e804eb9230e87c7ff26bdcb --to 98de35d30e35a6a206c943b7b34afbe4744db2cf
    DELETED file1
    CHANGED file4
    Index: file4
    ===================================================================
    --- file4
    +++ file4
    @@ -1,1 +1,1 @@
    -Tue 23 Nov 2010 10:14:01 EST
    +Tue 23 Nov 2010 10:14:32 EST
    </pre>
    
    Then when I commit the deleted file, it creates an empty commit (diff empty and not files in list).
    
    CONCLUSION:
    
    I cannot perform a partial commit (where I specify each file on the command line) when I have pending deleted files that I am NOT ready to commit.
    
    <hr /><i>anonymous added on 2010-11-24 14:06:58:</i><br />
    It seemed that fossil is not formatting my entry the way I expected.  Sorry about that.
    
    You can view source to see it well.  The admins of this site can put a "pre" HTML tag around my text so the formatting is better.
    
    I cannot seem to be able to edit my previous entry.