Skip to content

Despite hard reset, local checkout shows file changes in other libraries #3792

Closed

Description

@terrymun

I am experiencing a peculiar problem here: even after cleaning up my cdnjs fork and restarting it from upstream using the following code:

git remote add upstream https://github.com/cdnjs/cdnjs
git fetch upstream
git checkout master
git reset --hard upstream/master  
git push origin master --force 

I am still getting the following when checking out master (I am the author of Fluidbox and I am updating the files, mostly fixing outdated version numbers in JS files):

D   ajax/libs/fluidbox/1.2.2/jquery.fluidbox.css
M   ajax/libs/fluidbox/1.2.2/jquery.fluidbox.js
M   ajax/libs/fluidbox/1.2.2/jquery.fluidbox.min.js
D   ajax/libs/fluidbox/1.2.3/jquery.fluidbox.css
M   ajax/libs/fluidbox/1.2.3/jquery.fluidbox.js
M   ajax/libs/fluidbox/1.2.3/jquery.fluidbox.min.js
D   ajax/libs/fluidbox/1.2.4/jquery.fluidbox.css
D   ajax/libs/fluidbox/1.2.5/jquery.fluidbox.css
D   ajax/libs/fluidbox/1.2.6/jquery.fluidbox.css
D   ajax/libs/fluidbox/1.2.7/jquery.fluidbox.css
D   ajax/libs/fluidbox/1.3.1/jquery.fluidbox.css
D   ajax/libs/fluidbox/1.3.2/jquery.fluidbox.css
D   ajax/libs/fluidbox/1.3.3/jquery.fluidbox.css
M   ajax/libs/sortable/package.json

You can see that the last file from /sortable/ has been modified, but I checked the file and it is precisely identical to the one on the original upstream repo (master). May I know how should I work around this issue so that my pull request will not modify other libraries?

Activity

  1. PeterDaveHello commented on Sep 2, 2014

    @PeterDaveHello
    Contributor

    Seems you just reset upstream/master, not your local master. What about just delete your local master, and refork a local master from upstream/master? I think it should be easy.

  2. rmorrin commented on Sep 3, 2014

    @rmorrin

    @PeterDaveHello Could be wrong, but pretty sure git reset --hard upstream/master will reset the current branch to the state of upstream/master. More info here.

    @terrymun I had this exact same issue (even the same file) are you on Windows? It looks to be related to the capitalization of the 'sortable' folder; the following solved the issue for me:

    git mv --force ajax/libs/sortable/package.json ajax/libs/Sortable/package.json
    git commit
    

    Will submit a PR to address this.

  3. rmorrin commented on Sep 3, 2014

    @rmorrin

    After a bit more digging, it looks like the repository contains two (different) libraries named sortable:

    $  git ls-tree --full-tree -r HEAD | grep -i ajax/libs/sortable
    
    100644 blob d56ff751cc269a78e39ee0e0c15ef2f587b8901f    ajax/libs/Sortable/0.3.0/Sortable.js
    100644 blob 832600070dcf7992f31c0f09519f8feea8135c95    ajax/libs/Sortable/0.3.0/Sortable.min.js
    100644 blob 8763fd7b71b9d46cda881a3ed317a8408fc44b88    ajax/libs/Sortable/package.json
    100644 blob 7d816681c9cb6cd51adccff034f114925f65f65f    ajax/libs/sortable/0.6.0/css/sortable-theme-bootstrap.css
    100644 blob f37b1be82e9ecf3dd3cc9a5bd0e2e24e03faa393    ajax/libs/sortable/0.6.0/css/sortable-theme-dark.css
    100644 blob cc727c84761c37dca88d1d4571031c5f06b44774    ajax/libs/sortable/0.6.0/css/sortable-theme-finder.css
    100644 blob 839e1178a2a7cb8a5f558b53d77a571335ddbdb7    ajax/libs/sortable/0.6.0/css/sortable-theme-light.css
    100644 blob 96db3140fd0e61ff7c1f1e81d3d553d589d9eba2    ajax/libs/sortable/0.6.0/css/sortable-theme-minimal.css
    100644 blob 459ddb7d0a287f0fb257bf3b8fcb4a9015f62f88    ajax/libs/sortable/0.6.0/css/sortable-theme-slick.css
    100644 blob f4becd7b8173cfa1b58e29718afbbaaaf27e341c    ajax/libs/sortable/0.6.0/js/sortable.js
    100644 blob fcc7cadf176baebbfae488f6c7659e85753e0793    ajax/libs/sortable/0.6.0/js/sortable.min.js
    100644 blob 1137eaa56dfc23620045a7ae8ebf68dc0029f69d    ajax/libs/sortable/package.json
    

    https://github.com/HubSpot/sortable Lowercase 's'
    https://github.com/rubaxa/Sortable Uppercase 'S'

    Because both libraries contain a package.json file, this is causing a conflict on case-insensitive file systems found on Windows/OSX.

    @PeterDaveHello How are naming conflicts usually handled?

  4. PeterDaveHello commented on Sep 3, 2014

    @PeterDaveHello
    Contributor

    Oops, I misread the comment.

    I know there exist workaround for Sortable/sortable issue under OSX, not sure what to do under windows yet.

  5. rmorrin commented on Sep 3, 2014

    @rmorrin

    When files are checked out under Windows, git will write them at the same location.

    What is actually happening is the first sortable/package.json file is being overwritten by the second. Because they both have different contents, git will always think the file has been modified.

    I guess the easiest workaround is to rename one of the sortable libraries (sortable.js maybe?). Then git mv the files as suggested above. What do you think?

  6. PeterDaveHello commented on Sep 3, 2014

    @PeterDaveHello
    Contributor

    No, it's impossible, one of the most important policies in cdnjs is do not brake the already exist library, renaming will make the old urls be broken, so this method should not be consider to use. Anyway, I'm still looking for a solution, for more detail discussion, please move to #3650, there is already a opened issue about this problem, and thanks for your comments.

  7. terrymun commented on Sep 3, 2014

    @terrymun
    ContributorAuthor

    @rmorrin Thanks for the comment. I was close to pulling my hair out because I honestly thought I wasn't resetting my local clone properly. It seems like a rather innocent naming clash.

    @PeterDaveHello What would the solution be for OS X? That would be nice so I can start making pull requests again without meddling with the sortable library.

  8. rmorrin commented on Sep 3, 2014

    @rmorrin

    @PeterDaveHello Of course, that makes sense - I'll keep an eye on the discussion in #3650. Thanks!

    @terrymun No problem. As a short-term measure, you can try the following:
    git update-index --assume-unchanged ajax/libs/Sortable/package.json
    which tells git to ignore any changes to the fille.

  9. PeterDaveHello commented on Sep 4, 2014

    @PeterDaveHello
    Contributor

    @terrymun You can create a disk image with a case-sensitive file system (MAC OS Extended), and clone the repo on it.

  10. stefanneculai commented on Sep 8, 2014

    @stefanneculai
    Contributor

    @rmorrin the git update-index --assume-unchanged ajax/libs/Sortable/package.json workaround works on Mac. Very helpful. 👍

  11. terrymun commented on Sep 8, 2014

    @terrymun
    ContributorAuthor

    Yup, got to say that this worked for me, too. However, I am using the lowercase sortable, i.e. git update-index --assume-unchanged ajax/libs/sortable/package.json. Even better, simply ignore both.

    I hope this issue get fixed soon because expecting cdnjs contributors who are not using a case-sensitive file system to specifically create a partition for the purpose of participating in the project is a little bit excessive. The common OSes (OS X and Windows) are not case-sensitive, and we run the risk of excluding many possible contributors based on this requirement.

    Perhaps we should be more careful to ensure that clashes in namespace does not occur in the future?

  12. thomasdavis commented on Sep 9, 2014

    @thomasdavis
    Member

    @terinjokes any good ideas how we could fix the naming for Sortable and
    sortable without breaking the CDN.

    On Tue, Sep 9, 2014 at 3:14 AM, Terry [email protected] wrote:

    Yup, got to say that this worked for me, too. However, I am using the
    lowercase sortable, i.e. git update-index --assume-unchanged
    ajax/libs/sortable/package.json. Even better, simply ignore both.

    I hope this issue get fixed soon because expecting cdnjs contributors who
    are not using a case-sensitive file system to specifically create a
    partition for the purpose of participating in the project is a little bit
    excessive. The common OSes (OS X and Windows) are not case-sensitive, and
    we run the risk of excluding many possible contributors based on this
    requirement.

    Perhaps we should be more careful to ensure that clashes in namespace does
    not occur in the future?

    —
    Reply to this email directly or view it on GitHub
    #3792 (comment).

    Thomas Davis
    http://thomasdav.is

    VP of Tech - Earbits - http://earbits.com
    Co-founder - Cdnjs - http://cdnjs.com
    Founder - Backbone Tutorials - http://backbonetutorials.com

  13. terinjokes commented on Sep 9, 2014

    @terinjokes
    Contributor

    @thomasdavis email me the affected URLs and a general gist of the problem, and I'll see what I can do.

  14. PeterDaveHello commented on May 30, 2015

    @PeterDaveHello
    Contributor

    Let's discuss here #3650.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions