Skip to content
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

findversion fails on branchless git checkouts #3836

Closed
DorpsGek opened this issue May 14, 2010 · 6 comments
Closed

findversion fails on branchless git checkouts #3836

DorpsGek opened this issue May 14, 2010 · 6 comments
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

fonsinchen opened the ticket and wrote:

If you checkout openttd via "git clone " and then build it the revision will contain an "M" for modified. This is because we're using "git diff-index HEAD src" to determine the changes. This doesn't seem to work in this case as it sees every file as modified. I propose "git status -u no --porcelain src" as a more robust alternative. You can find a patch implementing that at http://fickzoo.com/fonsinchen/patches/current/trunk-findversion.diff

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/3836
@DorpsGek
Copy link
Member Author

fonsinchen wrote:

There are two further problems:

  1. "git status" didn't accept those arguments until fairly recently
  2. The problem depends on something on the server you're pulling from. "git diff-index" fails only on some versions. I'm investigating that.

This comment was imported from FlySpray: https://bugs.openttd.org/task/3836#comment8033

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

"git diff-index" reports false positives if the modification dates in the working tree don't match those in the index. We could call call "git update-index --refresh" instead. This will update the index to the new timestamps. Additionally it will give a message "xy: needs update" if there are real modifications. Also update-index is a "plumbing command" and similarly old as diff-index. So it should work fine even with very old versions of git.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3836#comment8045

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

The same problem is of course in determineversion.vbs


This comment was imported from FlySpray: https://bugs.openttd.org/task/3836#comment8066

@DorpsGek
Copy link
Member Author

michi_cc wrote:

Can you check if the attached patch fixes the problem for you?

Attachments


This comment was imported from FlySpray: https://bugs.openttd.org/task/3836#comment8076

@DorpsGek
Copy link
Member Author

fonsinchen wrote:

The patch fixes the flaw with the modification dates. So if that was the reason for the 'M' it fixes the problem. In any case it's a good idea to not regard a file as modified just because of the modification date as git doesn't actually preserve the modification date. Unfortunately I cannot reproduce the original problem anymore, so I cannot say if it's fixed.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3836#comment8081

@DorpsGek
Copy link
Member Author

michi_cc closed the ticket.

Reason for closing: Fixed

In r19895.


This comment was imported from FlySpray: https://bugs.openttd.org/task/3836

@DorpsGek DorpsGek added flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) Build system labels Apr 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant