-
Notifications
You must be signed in to change notification settings - Fork 2.7k
orderfile syntax for git diff ... -O <orderfile> #2047
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
How about creating a tiny public repository for other people to reproduce the issue easily and quickly? |
Does the orderfile have Windows style line endings? For me orderfile works fine if the file has Unix line endings. I came here to report it when I saw this issue. Not sure what the expected behaviour is, but it make sense to me that if Git accepts CRLF in .gitignore and .gitattributes it should for the orderfile as well. |
@Osse absolutely. And even better: this makes for an excellent first Pull Request. The problemThe file The parser iterates over the file contents, and in each loop iteration it first tries to look for the end of line, and this is where the culprit lies: it looks only for Possible solutionsThe easy routeIn my mind, the easiest fix would be to introduce a function that collapses all CR/LF line endings in an void strbuf_crlf_to_lf(struct strbuf *buf)
{
char *src = buf->buf, *end = buf->buf + buf->len, *dest = src;
while (src != end)
if (src[0] != '\r' || src[1] != '\n')
*(src++) = *(dest++);
else
src++;
buf->len = dest - buf->buf;
} This would need to be called directly after reading the contents of the orderfile in Make
|
@jeanremacle I'm curious: how's it going? |
For the record, you do not need access to GitLab from your work laptop to work on this... Git for Windows' source code is hosted on GitHub... |
Setup
defaults?
to the issue you're seeing?
No
Details
Bash
Minimal, Complete, and Verifiable example
this will help us understand the issue.
Output of file names ordered according to order-file passed after the "-O" parameter
I tried multiple possible syntax for the order file and nothing appeared to have an impact.
I did not find the syntax for the orderfile anywhere.
--> What I'd like to fine is a working example of am orderfile under windows.
Here are a few of them:
URL to that repository to help us with testing?
Private repository
The text was updated successfully, but these errors were encountered: