Giter Club home page Giter Club logo

Comments (4)

mih avatar mih commented on July 29, 2024

Here is another one, seem the issues is "fixed" by an intermediate call to git diff (which reports an empty diff).

❯ git st
 modified: src/linkml/schemas/datalad-dataset-components.yaml (file)
untracked: src/examples/datalad-dataset.jsonld
❯ git st
 modified: src/linkml/schemas/datalad-dataset-components.yaml (file)
untracked: src/examples/datalad-dataset.jsonld
❯ git diff
❯ git st
untracked: src/examples/datalad-dataset.jsonld

from datalad-next.

mih avatar mih commented on July 29, 2024

I have a situation now, where I have a file open in vim. The file is in a plain Git repo, tracked, and has no modifications wrt to the committed state.

After I save the file in vim, no modifications, just :write, I see this "wrong" report.

❯ datalad next-status
 modified: src/examples/dataset-version/DatasetVersionObject-penguins.yaml (file)

The cause for this report is that git diff-index shows it too!

❯ git diff-index HEAD
:100644 100644 03657a3bf83d09a48060228feed6a70237ef4600 0000000000000000000000000000000000000000 M      src/examples/dataset-version/DatasetVersionObject-penguins.yaml

As soon as I run git diff or git status it is gone, as soon as I save the file in vim again, it is back:

❯ git diff
❯ git diff-index HEAD
❯ git diff-index HEAD
:100644 100644 03657a3bf83d09a48060228feed6a70237ef4600 0000000000000000000000000000000000000000 M      src/examples/dataset-version/DatasetVersionObject-penguins.yaml

from datalad-next.

mih avatar mih commented on July 29, 2024

https://stackoverflow.com/questions/34807971/why-does-git-diff-index-head-result-change-for-touched-files-after-git-diff-or-g has an explanation and possible mitigation strategy.

from datalad-next.

mih avatar mih commented on July 29, 2024

But there is more to this issue. I can do the exact same action (open README.md file in vim, make no change, but write it out again) in two different repos. I get the modification report on one repo (clone of https://github.com/psychoinformatics-de/datalad-concepts), but not another (clone of https://github.com/datalad/datalad-next).

from datalad-next.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.