Code Monkey home page Code Monkey logo

Comments (7)

wiggin15 avatar wiggin15 commented on June 16, 2024

I was able to reproduces this on multiple Windows systems (Windows 2003, Windows 2008, Windows 7) and multiple versions of msysgit (1.7.4, 1.8.0, 1.8.3)

from git.

dscho avatar dscho commented on June 16, 2024

This is intended. The --raw option is meant to be used in scripts or other programs, and the developers of said scripts or programs are expected to know that --raw does not update the index.

from git.

grzn avatar grzn commented on June 16, 2024

@dscho, I can't find any reference in the Git man pages that --raw does not update the index, and as @wiggin15 showed we don't see the same behaviour on Linux. why is that?

from git.

vmalloc avatar vmalloc commented on June 16, 2024

+1. AFAIK --raw only controls formatting of the data and should not have other side effects as opposed to just "git diff". I also couldn't find a mention of this in the docs. Any specific pointers?

from git.

dscho avatar dscho commented on June 16, 2024

@grzn Here you are: https://github.com/msysgit/git/blob/master/Documentation/gitcore-tutorial.txt#L149 (since --raw is distinctly not for human consumption, you only use it when developing scripts for use with Git, and the gitcore-tutorial is a must read in that case).

@vmalloc exactly. You hit the nail on the head. --raw is not supposed to update the index. But you missed that it looks at the index. So if the index is not up-to-date, you get other results than one might expect naively.

So: the verdict stands: pilot error, easily fixed by studying the gitcore-tutorial.

In any case, not a Windows-specific problem, therefore an issue better reported (and getting pretty much the same explanation I crafted) on the Git mailing list: [email protected]

from git.

wiggin15 avatar wiggin15 commented on June 16, 2024

@dscho:

  • This is a Windows-specific problem, as I mentioned... I can not reproduce it on any Unix machine... Can you please explain this?
  • In your answer to vmalloc, you tried to explain why git diff --raw does not update the index, but you did not explain why this is any different from the "regular" git diff. According to your explanation, git diff should also return the same result - but it does not (perhaps you missed that part of the problem?).
  • I can't find any mention of "--raw" in the documentation you linked. The paragraph states that the index must be updated after changing files, but the documentation does not imply anywhere that "git diff" has the side effect of updating the index, while "git diff --raw" does not.

(by the way, of course we do use this command in automated scripts, which subsequently fail when trying to call git commit with "nothing to commit").

from git.

kusma avatar kusma commented on June 16, 2024

@wiggin15 I'm running "git version 1.8.4.msysgit.0.dirty", and I cannot reproduce the behavior you describe... "git diff --raw" still doesn't output anything after I touch the source. That is, as long as I disable core.autocrlf... without it'll warn about LF being replaced by CRLF.

from git.

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.