Skip to content
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

Missing push options #101

Closed
eelco opened this issue Jun 18, 2020 · 7 comments
Closed

Missing push options #101

eelco opened this issue Jun 18, 2020 · 7 comments
Labels
enhancement New feature or request help wanted Extra attention is needed stale Issues/PRs that are marked for closure due to inactivity

Comments

@eelco
Copy link

eelco commented Jun 18, 2020

I might be missing something, but there seem to be a lot of push options that are not available? In particular, I’m looking for the equivalents for:

  • --force-with-lease
  • --follow-tags
  • --atomic
@mcuadros mcuadros added enhancement New feature or request help wanted Extra attention is needed labels Jul 14, 2020
@shashwat-appdirect
Copy link

Hi @eelco,
I am also looking for the same options to be available so that I could push both local commits and tags in one Push operation. Could you please let me know if you find any solution?

Thanks.

asuffield added a commit to asuffield/go-git that referenced this issue Feb 18, 2021
The git protocol itself uses a compare-and-swap mechanism, where changes
send the old and new values and the change is only applied if the old
value matches. This is used to implement the --force-with-lease feature
in git push.

go-git populates the `old` field with the current value of the ref that
is read from the remote. We can implement a convenient (albeit more
limited) form of the --force-with-lease feature just by allowing the
caller to specify particular values for this ref.

Callers can then implement complex multi-step atomic operations by
reading the ref themselves at the start of the process, and passing to
in RequireRemoteRefs at the end. This is also a suitable building block
for implementing --force-with-lease (go-git#101), which is mostly an exercise
in computing the correct hash to require. Hence, this appears to be the
most reasonable API to expose.
mcuadros pushed a commit that referenced this issue Mar 25, 2021
The git protocol itself uses a compare-and-swap mechanism, where changes
send the old and new values and the change is only applied if the old
value matches. This is used to implement the --force-with-lease feature
in git push.

go-git populates the `old` field with the current value of the ref that
is read from the remote. We can implement a convenient (albeit more
limited) form of the --force-with-lease feature just by allowing the
caller to specify particular values for this ref.

Callers can then implement complex multi-step atomic operations by
reading the ref themselves at the start of the process, and passing to
in RequireRemoteRefs at the end. This is also a suitable building block
for implementing --force-with-lease (#101), which is mostly an exercise
in computing the correct hash to require. Hence, this appears to be the
most reasonable API to expose.
@john-cai
Copy link
Contributor

note: --follow-tags got merged #385

--force-with-lease and --atomic should probably be their own PRs as well

@john-cai
Copy link
Contributor

john-cai commented Nov 2, 2021

--force-with-lease: #404

@john-cai
Copy link
Contributor

john-cai commented Nov 3, 2021

--atomic: #406

@john-cai
Copy link
Contributor

john-cai commented Jan 3, 2022

@mcuadros I believe this issue can be closed, as we've added all of these push options

Copy link

github-actions bot commented Nov 4, 2023

To help us keep things tidy and focus on the active tasks, we've introduced a stale bot to spot issues/PRs that haven't had any activity in a while.

This particular issue hasn't had any updates or activity in the past 90 days, so it's been labeled as 'stale'. If it remains inactive for the next 30 days, it'll be automatically closed.

We understand everyone's busy, but if this issue is still important to you, please feel free to add a comment or make an update to keep it active.

Thanks for your understanding and cooperation!

@github-actions github-actions bot added the stale Issues/PRs that are marked for closure due to inactivity label Nov 4, 2023
@pjbgf
Copy link
Member

pjbgf commented Nov 4, 2023

Closing as per @john-cai message.

@pjbgf pjbgf closed this as completed Nov 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed stale Issues/PRs that are marked for closure due to inactivity
Projects
None yet
Development

No branches or pull requests

5 participants