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

Branch links left dead after branch removal #302

Open
chrysn opened this issue Aug 31, 2021 · 3 comments
Open

Branch links left dead after branch removal #302

chrysn opened this issue Aug 31, 2021 · 3 comments

Comments

@chrysn
Copy link
Contributor

chrysn commented Aug 31, 2021

Working on https://github.com/anr-bmbf-pivot/draft-dns-over-coap I got complaints about dead links; it seems that when branches are removed after merging, parts are removed but the index stays.

I'll investigate later, and file a PR if I manage to find out the details.

@MikeBishop
Copy link
Contributor

Here's the code in question:

# Clean up obsolete directories (2592000 = 30 days)
@CUTOFF=$$(($$(date '+%s')-2592000)); \
MAYBE_OBSOLETE=`comm -13 <(git branch -a | sed -e 's,.*[ /],,' | sort | uniq) <(ls $(GHPAGES_ROOT) | sed -e 's,.*/,,')`; \
for item in $$MAYBE_OBSOLETE; do \
  if [ -d "$(GHPAGES_ROOT)/$$item" ] && \
     [ `git -C $(GHPAGES_ROOT) log -n 1 --format=%ct -- $$item` -lt $$CUTOFF ]; then \
    echo "Remove obsolete '$$item'"; \
    git -C $(GHPAGES_ROOT) rm -rfq -- $$item; \
  fi \
done

What it's supposed to do is remove artifacts from a branch when it no longer exists and they're more than 30 days old.

@martinthomson
Copy link
Owner

I'm looking at https://anr-bmbf-pivot.github.io/draft-dns-over-coap/ and not seeing any dead links.

The code that Mike points at finds directories that exist on the gh-pages branch, but don't have matching branches. It then removes the directory. There is a second step where the index is regenerated, which is based on the directories that remain.

The only thing that might have caused problems here is that this cleanup might have been committed without updating the index. Or if the index was generated before the cleanup happened. That seems like it might be the cause of the problem. (I am relying on dependency ordering here more than is appropriate; I'll see if a small update will fix that.)

@AkroutiHamza
Copy link

if you add more doc then will be ok

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

4 participants