-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
simplify checkWorkingCopyClean to make backporting easier? #13719
Comments
I do this on build side, rather than locally. so you might want to tweak it if you want to ignore "explicitly git-added files" which I think is our use-case. |
Ok, I see what's wrong. The script doesn't fail on things that are in .gitignore - it fails on directories that are not empty and contain git-ignored things. For example:
Both We already use |
@dweiss yes that's the case i hit, it is just the "switching branches from main" use-case and it seems to trip on things such as buildSrc and benchmark-jmh, i end out manually rm -rf'ing them after switching. in my uses of git-status checks, I actually run the git-status in CI after all the build logic runs, to make sure no tasks/tests/etc modify the tree. It is a different concern maybe than what we might be doing with it (I'm not sure). e.g. I'm not trying to detect "you forgot to git-add" |
I think this logic is flawed:
we shouldn't do anything about untrackedFolders. Looking at jgit's implementation, I don't even see the reason it's there and I can't remember why I (or somebody else) added it. |
#13728 ? |
* Ignore any 'untracked folders' #13719 * Upgrade jgit to 6.10.0.202406032230-r.
(branch 9x backport) * Ignore any 'untracked folders' #13719 * Upgrade jgit to 6.10.0.202406032230-r.
Thanks. The purpose of this whole task was the following: We wanted to check on Jenkins that after starting with a clean checkout, running all tests,... the working copy is not dirty. This was introduced before we had security manager in tests. The check on a developers computer was not really wanted, so originally the task was only executed on CI runs. But anyways the check should have two modes:
We should really restore this old behaviour with the two modes: CI only after running tests and "gradlew validate" (only check sanity of checkout. |
I don't know about that - I think it's one of the original reasons I added it to precommit... But it's been a while. Also, both modes you mention are actually very similar: nothing in the code ever calls "git add" so anything touched will be either untracked or modified by definition. I'm not sure I understand the difference. A notable exception is if something created a directory (empty or with something that is in .gitignore) - then this change would go unnoticed. |
The check was previously done on Subversion, so it was just ported over long ago. If the current code works for detecting any changes after a clean checkout and running tests, we are fine. P.S.: Sorry for my ignorance: I never do "git add" manually, because Tortoise does it in a more "subversion-like" way which I prefer. You just click some checkboxes, enter a log message and cxommit. Very easy. I never understood the horrible git cli, I hate it because it is completely unintuitive (subversion was). Maybe its like with US showers at Mike's home. |
Come on, Uwe - you're brilliant, I don't think git is beyond your ability to grasp. You just want those shiny icons and buttons, don't you... :) |
I agree. latest version has 161 subcommands but you need to stick to your guns and restrict yourself to only 5 or 10 of its commands, then it is useful. and definitely only use commands from the ones listed as "common" in |
About right. These are my top three:
and these are used much, much more rarely:
This about covers my git knowledge. Anything else I have to go and RTFM.
Isn't it like TeX and LaTeX - that there is a very fundamental core and lots of other commands built around it? I remember this was amusing when I came across it a while ago: https://github.com/chrisdickinson/git-rs |
Description
I run into trouble when backporting, the
checkWorkingCopyClean
check always wants to fail on things that are actually in gitignore, from switching branches. IMO, working copy is clean as "git status" has no output.Should we implement this differently? at my dayjob, I use the following one-liner to implement this check, which will respect .gitignore:
The text was updated successfully, but these errors were encountered: