-
Notifications
You must be signed in to change notification settings - Fork 67
stg refresh
errors out when index contains added files and path limiting is given
#85
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
stg refresh
crashed when index contains added files and path limiting is givenstg refresh
crashes when index contains added files and path limiting is given
…les and path limiting
@jpgrayson I will brainstorm on how to fix this and wrap this in tests. But there are more esoteric situations when this does not help. Ref: https://github.com/stacked-git/stgit/blob/master/stgit/lib/git/iw.py#L310 Illustration of my esoteric situation example:
|
stg refresh
crashes when index contains added files and path limiting is givenstg refresh
errors out when index contains added files and path limiting is given
Thank you for this thorough issue report @NonLogicalDev. Adding Regarding the second "esoteric" scenario where you want to refresh with path limits specifying untracked files that should be added, I'm not sure that
I.e., we have a subdirectory with some tracked files and some untracked files. Then consider the following
With current StGit, the patch would only be refreshed with changes from the tracked file(s). This seems like sensible behavior. But under the proposed semantics, I think We could potentially say that only files specified as path limits should be auto-added, but not directories. But that would be inconsistent with how path limits work in other contexts. I'm inclined to take the conservative approach and require files to be explicitly added and not implicitly add files based on path limits. |
@jpgrayson I was thinking of that scenario, but you are bringing a good point. Ideally we should make it very clear to the user that untracked files are not considered when path limiting is enabled. It is also really weird assymetry.
So if you want to path limit certain files in refresh you are better off adding everything to the index, and use path limiting. Not saying this is a bad idea, but it is a substantial cognitive burden remembering this when working with Stg, which is fine for you and me who understand the ins and outs of how git index works, but might be a red flag for someone with a more surface level git understanding. So I would suggest either erroring out, or warning the user / documenting this behavior in examples. |
Any changes you can think of that would help convey StGit's semantics to users would be appreciated.
Or use |
…les and path limiting
…les and path limiting Signed-off-by: Oleg Utkin <[email protected]>
@jpgrayson Likewise I feel like just adding files to the index is a more robust way of dealing with changes. |
…h limiting Signed-off-by: Oleg Utkin <[email protected]>
To reproduce:
I narrowed down the problem to the following function:
https://github.com/stacked-git/stgit/blob/master/stgit/lib/git/iw.py#L332
The text was updated successfully, but these errors were encountered: