Skip to content

Fix fallback to unshallowing shallow clone#70252

Open
elmeriniemela wants to merge 1 commit into
ansible:develfrom
elmeriniemela:patch-1
Open

Fix fallback to unshallowing shallow clone#70252
elmeriniemela wants to merge 1 commit into
ansible:develfrom
elmeriniemela:patch-1

Conversation

@elmeriniemela

@elmeriniemela elmeriniemela commented Jun 24, 2020

Copy link
Copy Markdown

Currently git may not find the correct commit with depth=1000000 and a shallow clone, caused by an error in the final fall back if clause. The comment in the if clause is correct, just missing a 'not' operator for the comment / behavior to work.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

git

ADDITIONAL INFORMATION

Reproduce steps:

  • Clone repo with 2 commits and depth=1 (shallow clone)
  • Try updating the repo using ansible to the initial commit with depth=2
  • error: pathspec 'initial commit hash' did not match any file(s) known to git.

@ansibot ansibot added affects_2.11 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. small_patch source_control Source-control category support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Jun 24, 2020
@relrod relrod self-assigned this Jun 25, 2020
@relrod relrod added P3 Priority 3 - Approved, No Time Limitation and removed needs_triage Needs a first human triage before being processed. labels Jun 25, 2020
@relrod

relrod commented Jun 25, 2020

Copy link
Copy Markdown
Contributor

Can you add a test to show what this is solving, and a changelog fragment?

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jul 6, 2020
@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. pre_azp This PR was last tested before migration to Azure Pipelines. and removed core_review In order to be merged, this PR must follow the core review workflow. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Dec 6, 2020
@Akasurde

Copy link
Copy Markdown
Member

@elmeriniemela Are you still working on this? Thanks.

needs_info

@ansibot ansibot added the needs_info This issue requires further information. Please answer any outstanding questions. label May 28, 2021
@elmeriniemela

Copy link
Copy Markdown
Author

@Akasurde Not really, unfortunately I don't have the resources to develop the tests related to this. Feel free to take this issue further.

@ansibot ansibot removed the needs_info This issue requires further information. Please answer any outstanding questions. label May 29, 2021
@mattclay

This comment was marked as resolved.

@azure-pipelines

This comment was marked as resolved.

@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. pre_azp This PR was last tested before migration to Azure Pipelines. labels Jun 22, 2022
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jun 30, 2022
@sivel sivel unassigned relrod Dec 1, 2022
@webknjaz

This comment was marked as resolved.

@azure-pipelines

This comment was marked as resolved.

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Oct 11, 2023
@webknjaz

Copy link
Copy Markdown
Member

This needs a rebase for the CI to pick up the branch.

@webknjaz webknjaz added the ci_verified Changes made in this PR are causing tests to fail. label Oct 11, 2023
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Oct 11, 2023
@webknjaz webknjaz added the ci_verified Changes made in this PR are causing tests to fail. label Oct 11, 2023
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Oct 25, 2023
@Akasurde Akasurde added the needs_info This issue requires further information. Please answer any outstanding questions. label Oct 22, 2024
@ansibot

ansibot commented Nov 12, 2024

Copy link
Copy Markdown
Contributor

@elmeriniemela This PR is waiting for your response. Please respond or the PR will be closed.

click here for bot help

@elmeriniemela

Copy link
Copy Markdown
Author

image

Hi, the comment in the code explains why depth argument is needed when 'refspecs' variable is empty. However the condition adds it only when "if refspecs" when it should be "if not refspecs". So there is clearly a contradiction with the intention of the developer (expressed in comment) and the actual code.

And this causes an error as explained in the PR description.

Currently git may not find the correct commit with depth=1000000 and shallow clone, caused by an error in the final fall back if clause. The comment in the if clause is correct, just missing a 'not' operator for the comment / behavior to work.
@ansibot ansibot removed needs_info This issue requires further information. Please answer any outstanding questions. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. ci_verified Changes made in this PR are causing tests to fail. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. labels Nov 16, 2024
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Dec 2, 2024
@ansibot ansibot added the stale_pr This PR has not been pushed to for more than one year. label Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

affects_2.11 bug This issue/PR relates to a bug. core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. new_contributor This PR is the first contribution by a new community member. P3 Priority 3 - Approved, No Time Limitation small_patch source_control Source-control category stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. stale_pr This PR has not been pushed to for more than one year. support:core This issue/PR relates to code supported by the Ansible Engineering Team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants