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

Unclear parsing of skip worktree #11011

Merged

Conversation

gerhardol
Copy link
Member

Proposed changes

Parse of 'S' was done by a git-status parser not
related to skip-worktree or assume-unchanged status.

No functionality changed.
(Well a file can be both assume-unchanged and skip-worktree simultaneously now, I do not think that is possible in Git.)

Test methodology

  • Manual

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@ghost ghost assigned gerhardol May 31, 2023
Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some approval tests fail. (Note that Igor has a conflicting PR if they need to be adapted.)

GitCommands/Git/GitItemStatusConverter.cs Show resolved Hide resolved
@gerhardol gerhardol marked this pull request as draft May 31, 2023 20:18
@RussKie
Copy link
Member

RussKie commented Jun 1, 2023

(Note that Igor has a conflicting PR if they need to be adapted.)

#10993 is merged now 🎉

Parse of 'S' was done by a git-status parser not
related to skip-worktree or assume-unchanged status.
@gerhardol gerhardol force-pushed the feature/parse-skip-worktree branch from 6671c0a to 18b2267 Compare June 1, 2023 22:58
@gerhardol gerhardol marked this pull request as ready for review June 1, 2023 23:00
@RussKie RussKie added the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Jun 2, 2023
@ghost ghost removed the 📭 needs: author feedback More info/confirmation awaited from OP; issues typically get closed after 30 days of inactivity label Jun 2, 2023
@gerhardol gerhardol merged commit 4aff645 into gitextensions:master Jun 4, 2023
3 of 4 checks passed
@gerhardol gerhardol deleted the feature/parse-skip-worktree branch June 4, 2023 18:34
@ghost ghost added this to the vNext milestone Jun 4, 2023
if (gitItemStatus.IsSkipWorktree)
const char SkippedStatus = 'S';
const char SkippedStatusAssumeUnchanged = 's';
if (statusCharacter is not SkippedStatus or SkippedStatusAssumeUnchanged)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, sorry for commenting on a closed PR but I just noticed that this condition does not look correct.

I assume the intention is to continue if statusCharacter is not one of 'S' or 's'? If so, then the condition should be:
statusCharacter is not SkippedStatus and not SkippedStatusAssumeUnchanged

As it is now, the loop will continue if statusCharacter is 's'.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parens missing?

Suggested change
if (statusCharacter is not SkippedStatus or SkippedStatusAssumeUnchanged)
if (statusCharacter is not (SkippedStatus or SkippedStatusAssumeUnchanged))

Copy link
Member Author

@gerhardol gerhardol Oct 4, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, parens should be added
But it only affects files that are both assumed unchanged and skip worktree (is that possible?)
Should be changed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, it is intentional. AssumeUnchanged are already added to the filelist.
There should be a comment though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I didn't know you could use or in that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants