Comments (7)
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.
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.
@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.
+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.
@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.
- 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.
@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)
- Redirect to Git for Windows 2.x HOT 10
- Why I am not able to use curl commands ? HOT 1
- "Entrust Root Certification Authority - G2" is not trusted HOT 5
- .git subdirectory is created in the wrong place on checkout when using relative directory HOT 16
- umeng123
- Windows installer not cryptographically signed. HOT 3
- Using mingw-perl HOT 5
- git rev-list crashes when --show-notes and --grep are specified HOT 2
- Git SVN crash HOT 3
- Git daemon and TortoiseGit HOT 2
- fox
- Git Blame - file.dot is not a Word Document HOT 3
- Missing patch tool for release candidate of Git for Windows. HOT 1
- Custom mergetool cmd support in git GUI HOT 1
- Git.exe is stuck if I run a wrong command. HOT 1
- Not able to clone gerrit repo over https via gitbash(windows client) HOT 5
- please add a release to announce the move of release downloads to the git-for-windows repo HOT 7
- <invalid>
- Filename too long when cloning a repo HOT 3
- Cannot Create Shortcut, Cannot Find App, Cannot Open App HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from git.