Skip to content

fix(git): optimize fetch to selectively include tags and checkout exct#433

Open
corydolphin wants to merge 2 commits intocarvel-dev:developfrom
corydolphin:develop
Open

fix(git): optimize fetch to selectively include tags and checkout exct#433
corydolphin wants to merge 2 commits intocarvel-dev:developfrom
corydolphin:develop

Conversation

@corydolphin
Copy link

This is a continuation of #427 simply with an additional stacked diff to address lint failures.

Hello,

I've enjoyed using this tool and would benefit from @fpytloun's tag fetching changes. I've made a quick change to hopefully fix the lint errors, and it seems to pass all tests locally.

I don't seem to be able to more easily stack these changes with a PR on top of @fpytloun's work, so this is a new PR.

Thank you,
Cory

…ct refs

- Disabled unconditional addition of "remote.origin.tagOpt" config; only add if not fetching exact ref
- Introduced exactRef flag to detect when fetching a specific origin ref
- When fetching exact ref, checkout uses "FETCH_HEAD" instead of the ref name to avoid detached head advice
- Cleaned up commented-out code and improved fetch argument logic accordingly

Signed-off-by: Filip Pytloun <filip@pytloun.cz>
Signed-off-by: Cory Dolphin <cory@nextdoor.com>
@fpytloun
Copy link

Thank you @corydolphin, I did not have time to work on my PR further.

@corydolphin
Copy link
Author

Hey @joaopapereira are you open to taking a look at this change? It would be a great win for many of your git users. Regardless, thank you for the work!

Copy link
Member

@joaopapereira joaopapereira left a comment

Choose a reason for hiding this comment

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

I would love to have some tests for this to ensure that we are not breaking things in the future.
Do you think you can add them?

@github-project-automation github-project-automation bot moved this to In Progress in Carvel Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

3 participants