Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

How to do equivalent of 'git fetch --prune' #624

Closed
blacksails opened this issue Oct 22, 2017 · 6 comments · Fixed by #1165
Closed

How to do equivalent of 'git fetch --prune' #624

blacksails opened this issue Oct 22, 2017 · 6 comments · Fixed by #1165

Comments

@blacksails
Copy link
Contributor

I would like to be able to run something equivalent of fetch prune, but I cannot figure out how to do that, or if it is even possible. I read through issue #490 but that didn't help me much.

I would gladly help to implement this, if there isen't a way to do git fetch --prune already

@orirawlings
Copy link
Contributor

Hey @blacksails,

This isn't currently supported, but PRs are welcome!

Cheers

@blacksails
Copy link
Contributor Author

I would like to take a stab at this. Should i add a Prune method on the Remote type?

Do you have anything else that I should be aware of before i start implementing it?

@orirawlings
Copy link
Contributor

orirawlings commented Dec 4, 2017

That's awesome @blacksails, thanks!

For supporting the equivalent of git fetch --prune, I think it makes sense to add a bool field to the FetchOptions struct.

I think it would also be nice to add a Prune() method like you mentioned to Remote to support the equivalent of git remote prune.

@blacksails
Copy link
Contributor Author

blacksails commented Jan 10, 2018

I looked into this but I ran into som problems, I need some of the refspec methods, but where they go in the opposite direction eg. from dst to src. There is already a Src method, but it has different semantics compared to the Dst method.

I would propose that we make the refspec methodnames consistent in both directions. Maybe something like

Src() string,
Dst() string,
SrcName(plumbing.ReferenceName) plumbing.ReferenceName and
DstName(plumbing.ReferenceName) plumbing.ReferenceName.

Samething goes for the Match methods. This is of cause backwards incompatible API changes. So maybe those changes should be targeted a new major version.

In the mean time we could introduce some temporary method names. Does that sound good to you?

@orirawlings
Copy link
Contributor

Hey @blacksails,

Sorry for the delay on this.

Can you elaborate a little bit more on why those changes would be necessary? Refspecs are inherently a uni-directional concept so I'm not quite sure I understand why changing the API so that it has this symmetry is useful.

@DWiechert
Copy link

Have there been any updates to this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants