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
sparse checkout: fix a few bugs and check argument validity for set/add #1118
sparse checkout: fix a few bugs and check argument validity for set/add #1118
Conversation
16baea5
to
888cfe5
Compare
888cfe5
to
31d62da
Compare
31d62da
to
e30119b
Compare
/submit |
Submitted as pull.1118.git.1644712797.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
User |
On the Git mailing list, Derrick Stolee wrote (reply to this):
|
On the Git mailing list, Elijah Newren wrote (reply to this):
|
User |
e30119b
to
286c22e
Compare
/submit |
Error: git fetch https://github.com/gitgitgadget/git -- +refs/notes/gitgitgadget:refs/notes/gitgitgadget refs/heads/maint:refs/remotes/upstream/maint refs/heads/seen:refs/remotes/upstream/seen refs/heads/master:refs/remotes/upstream/master refs/heads/next:refs/remotes/upstream/next +refs/tags/pr-1118/newren/sparse-checkout-default-and-arg-validity-v1:refs/tags/pr-1118/newren/sparse-checkout-default-and-arg-validity-v1 +refs/pull/1118/head:refs/pull/1118/head +refs/pull/1118/merge:refs/pull/1118/merge failed: 1,
|
/submit |
Error: git fetch https://github.com/gitgitgadget/git -- +refs/notes/gitgitgadget:refs/notes/gitgitgadget refs/heads/maint:refs/remotes/upstream/maint refs/heads/seen:refs/remotes/upstream/seen refs/heads/master:refs/remotes/upstream/master refs/heads/next:refs/remotes/upstream/next +refs/tags/pr-1118/newren/sparse-checkout-default-and-arg-validity-v1:refs/tags/pr-1118/newren/sparse-checkout-default-and-arg-validity-v1 +refs/pull/1118/head:refs/pull/1118/head +refs/pull/1118/merge:refs/pull/1118/merge failed: 1, |
@dscho: Any idea why it's failing to submit? (Is it upset with the fact that I rebased and modified the target branch?) |
Huh. Let me have a look. |
Oh, I think I know what it is... a recent refactoring seems to have introduced a bug. |
In 2c0a435 (extensible: introduce product-config feature, 2022-02-06), we refactored the code to make the names of upstream branches configurable. By mistake, we omitted the `+` that forces updates to the corresponding remote-tracking branches in case of non-fast-forwards. But we do have to expect that e.g. `seen` (and occasionally, `next`) need to be force-fetched. Noticed in gitgitgadget/git#1118 (comment) Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The set and add subcommands accept multiple positional arguments. The meaning of these arguments differs slightly in the two modes: Cone mode only accepts directories. If given a file, it would previously treat it as a directory, causing not just the file itself to be included but all sibling files as well -- likely against users' expectations. Throw an error if the specified path is a file in the index. Provide a --skip-checks argument to allow users to override (e.g. for the case when the given path IS a directory on another branch). Non-cone mode accepts general gitignore patterns. There are many reasons to avoid this mode, but one possible reason to use it instead of cone mode: to be able to select individual files within a directory. However, if a file is passed to set/add in non-cone mode, you won't be selecting a single file, you'll be selecting a file with the same name in any directory. Thus users will likely want to prefix any paths they specify with a leading '/' character; warn users if the patterns they specify exactly name a file because it means they are likely missing such a leading slash. Reviewed-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Elijah Newren <newren@gmail.com>
In sparse-checkout add/set under cone mode, the arguments passed are supposed to be directories rather than gitignore-style patterns. However, given the amount of effort spent in the manual discussing patterns, it is easy for users to assume they need to pass patterns such as /foo/* or !/bar/*/ or perhaps they really do ignore the directory rule and specify a random gitignore-style pattern like *.c To help catch such mistakes, throw an error if any of the positional arguments: * starts with any of '/!' * contains any of '*?[]' Inform users they can pass --skip-checks if they have a directory that really does have such special characters in its name. (We exclude '\' because of sparse-checkout's special handling of backslashes; see the MINGW test in t1091.46.) Reviewed-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Elijah Newren <newren@gmail.com>
ff0eb2c
to
53183d0
Compare
This patch series was integrated into seen via git@3991b9d. |
/submit |
Submitted as pull.1118.v5.git.1645289086.gitgitgadget@gmail.com To fetch this version into
To fetch this version to local tag
|
On the Git mailing list, Derrick Stolee wrote (reply to this):
|
This patch series was integrated into seen via git@20bf310. |
This patch series was integrated into seen via git@41dd20f. |
This patch series was integrated into seen via git@105bb4d. |
There was a status update in the "Cooking" section about the branch Further polishing of "git sparse-checkout". Will merge to 'next'. source: <pull.1118.v5.git.1645289086.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@bdf35d8. |
There was a status update in the "Cooking" section about the branch Further polishing of "git sparse-checkout". Will merge to 'next'. source: <pull.1118.v5.git.1645289086.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@5fa832e. |
This patch series was integrated into seen via git@6c95082. |
This patch series was integrated into next via git@7307431. |
There was a status update in the "Cooking" section about the branch Further polishing of "git sparse-checkout". Will merge to 'master'. source: <pull.1118.v5.git.1645289086.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@7b4ce0c. |
This patch series was integrated into seen via git@dac150e. |
This patch series was integrated into seen via git@b4bee80. |
There was a status update in the "Cooking" section about the branch Further polishing of "git sparse-checkout". Will merge to 'master'. source: <pull.1118.v5.git.1645289086.gitgitgadget@gmail.com> |
This patch series was integrated into seen via git@8f9c673. |
This patch series was integrated into seen via git@9671764. |
This patch series was integrated into master via git@9671764. |
This patch series was integrated into next via git@9671764. |
Closed via 9671764. |
== Maintainer notes ==
Note: There is a small textual and small semantic conflict with ds/sparse-checkout-requires-per-worktree-config in seen. I included the diff with the correct resolution near the end of this cover letter. If you'd prefer I rebased on top of ds/sparse-chckout-requires-per-worktree-config, let me know.
== Overview ==
This series continues attempts to make sparse-checkouts more user friendly. A quick overview:
== Update history ==
Changes since v4:
Changes since v3:
Changes since v2:
Changes since v1:
== Conflict resolution ==
Patch to resolve textual and semantic conflict with ds/sparse-checkout-requires-per-worktree-config:
== CCs ==
cc: Victoria Dye vdye@github.com
cc: Derrick Stolee stolee@gmail.com
cc: Lessley Dennington lessleydennington@gmail.com
cc: Derrick Stolee derrickstolee@github.com
cc: Elijah Newren newren@gmail.com
cc: Ævar Arnfjörð Bjarmason avarab@gmail.com