Skip to content

[META] gitgitgadget/git is missing tags from git/git #319

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

Closed
dakotahawkins opened this issue Aug 23, 2019 · 8 comments
Closed

[META] gitgitgadget/git is missing tags from git/git #319

dakotahawkins opened this issue Aug 23, 2019 · 8 comments

Comments

@dakotahawkins
Copy link

dakotahawkins commented Aug 23, 2019

The latest version tag is v2.18.0, @dscho can you update whatever process you use to sync this fork?

Edit: Noticed this doing an initial make configure on my fork of this.

@dscho
Copy link
Member

dscho commented Aug 26, 2019

Let's script this. Would you have time to come up with that script? It would compare the tags of two remotes, obtained via ls-remote, in my mind, and construct a push command-line from that diff. I would then copy this script into the automation that already mirrors the branches.

@dakotahawkins
Copy link
Author

I can do that. I thought I would find the existing mirroring in gitgitgadget/gitgitgadget, but nothing there seemed to be doing it.

Is that something I missed, or that you have in a repo somewhere, or do you just want me to put a bash script that mirrors (or just finds a list of) missing tags in this issue?

This does more than tags, but maybe a stripped down version could do what you want.

@dakotahawkins
Copy link
Author

dakotahawkins commented Aug 26, 2019

@dscho The script in dakotahawkins/sync-tags should do exactly what you want. It should leave alone any tags you have that aren't in upstream, but will rewrite tags you have that are in upstream but are out of date.

@dscho
Copy link
Member

dscho commented Aug 27, 2019

I thought I would find the existing mirroring in gitgitgadget/gitgitgadget, but nothing there seemed to be doing it.

It is a non-YAML build: https://dev.azure.com/gitgitgadget/git/_build?definitionId=8

The script in dakotahawkins/sync-tags should do exactly what you want.

I took the liberty of coming up with a simpler solution:

die () {
    echo "$*" >&2
    exit 1
}

for d in git gitgitgadget
do
    git ls-remote --tags https://github.com/$d/git | grep -v '\^{}$' | sort >tags.$d ||
    die "Could not enumerate tags in $d"
done

refspec="$(comm -23 tags.git tags.gitgitgadget | tr '\t' :)" ||
die "Could figure out missing tags"

... and then pushing $refspec unless it is empty. See this run that synchronized the initial slur of tags: https://dev.azure.com/gitgitgadget/git/_build/results?buildId=15228

@dscho dscho closed this as completed Aug 27, 2019
@dscho
Copy link
Member

dscho commented Aug 27, 2019

(Of course, I realize that this will not synchronize tags unless a branch triggers the build, as tag updates can only trigger YAML builds, but that's better than not synchronizing the tags at all.)

@dakotahawkins
Copy link
Author

I was going to say that if I were doing it (for this case especially) I would probably just destructively fetch branches and tags from the upstream at the same time and push those. Probably would be fine as long as you didn't prune anything that was only ever in the fork.

A robust solution could probably identify and re-tag force-updated branches/tags for manual review or resurrection after the fact.

Automatic fork syncing is the one thing I really wish GitHub offered. We have it at work with BitBucket server and it's fine, though you have to manually resolve pending force-updates.

@dscho
Copy link
Member

dscho commented Aug 28, 2019

I would probably just destructively fetch branches and tags from the upstream at the same time and push those.

About tags: agree, branches, we already force-push. Pruning is a different matter: this would potentially fail (or close PRs), so I would like to avoid that.

@dakotahawkins
Copy link
Author

Yeah that's what I mean: You'd either want to prune nothing or maybe only prune things that you know originated in the upstream.

A "safe" but sync-no-matter-what approach could re-tag about-to-be-overwritten refs before the update.

Of course I think that's all unnecessary here, and I'm just glad to have the tags updating now :)

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

No branches or pull requests

2 participants