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

Irregular "error: Failed to rebase gh-pages branch" with --no-history #97

Closed
Guts opened this issue Mar 25, 2021 · 2 comments · Fixed by #99
Closed

Irregular "error: Failed to rebase gh-pages branch" with --no-history #97

Guts opened this issue Mar 25, 2021 · 2 comments · Fixed by #99

Comments

@Guts
Copy link

Guts commented Mar 25, 2021

This issue follows #95 and #96.

I'm facing issues when using --no-history option.

Repository

Repo: https://github.com/geotribu/website/

GitHub Actions run: https://github.com/geotribu/website/runs/2161832176#step:8:12

Environment

sorry, my system is configured in French, so git messages are translated.

OS and Git

$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 20.04.2 LTS
Release:	20.04
Codename:	focal

$ git --version
git version 2.31.0

guts:~/Git/Geotribu/website$ git status
Sur la branche master
Votre branche est à jour avec 'origin/master'.

rien à valider, la copie de travail est propre

Tool

(.venv) guts:~/Git/Geotribu/website$ ghp-import --version
Usage: ghp-import [OPTIONS] DIRECTORY

ghp-import: error: no such option: --version
(.venv) guts:~/Git/Geotribu/website$ ghp-import --help
Usage: ghp-import [OPTIONS] DIRECTORY

Options:
  -n, --no-jekyll       Include a .nojekyll file in the branch.
  -c CNAME, --cname=CNAME
                        Write a CNAME file with the given CNAME.
  -m MESG, --message=MESG
                        The commit message to use on the target branch.
  -p, --push            Push the branch to origin/{branch} after committing.
  -x PREFIX, --prefix=PREFIX
                        The prefix to add to each file that gets pushed to the
                        remote. [none]
  -f, --force           Force the push to the repository.
  -o, --no-history      Force new commit without parent history.
  -r REMOTE, --remote=REMOTE
                        The name of the remote to push to. [origin]
  -b BRANCH, --branch=BRANCH
                        Name of the branch to write to. [gh-pages]
  -s, --shell           Use the shell when invoking Git. [False]
  -l, --follow-links    Follow symlinks when adding files. [False]
  -h, --help            show this help message and exit

Reproduce

# build the website
(.venv) guts:~/Git/Geotribu/website$ mkdocs build --clean --config-file mkdocs.yml --strict
INFO    -  Cleaning site directory 
INFO    -  Building documentation to directory: /home/guts/Git/Geotribu/website/build/mkdocs/site 
INFO    -  Documentation built in 81.46 seconds

# quick check output
(.venv) guts:~/Git/Geotribu/website$ ls build/mkdocs/site/
404.html          articles  CNAME       dicogis               feed_rss_updated.xml  install_webapp        node  robots.txt  rss.xml  sitemap.xml     team   toc_nav_ignored
acknowledgements  assets    contribuer  feed_rss_created.xml  index.html            manifest.webmanifest  rdp   rss         search   sitemap.xml.gz  theme

# push on gh-pages
(.venv) guts:~/Git/Geotribu/website$ ghp-import --force --no-history --no-jekyll --push build/mkdocs/site
Usage: ghp-import [OPTIONS] DIRECTORY

ghp-import: error: Failed to rebase gh-pages branch.

I've also tried:

# using shell
$ ghp-import --force --no-history --no-jekyll --push --shell build/mkdocs/site
# no force
$ ghp-import --no-history --no-jekyll --push build/mkdocs/site

With the same error.

If I remove the --no-history option, it's working:

$ ghp-import --force --no-jekyll --push build/mkdocs/site
Énumération des objets: 1285, fait.
Décompte des objets: 100% (1285/1285), fait.
Compression par delta en utilisant jusqu'à 12 fils d'exécution
Compression des objets: 100% (55/55), fait.
Écriture des objets: 100% (649/649), 1.99 Mio | 3.25 Mio/s, fait.
Total 649 (delta 48), réutilisés 631 (delta 31), réutilisés du pack 0
remote: Resolving deltas: 100% (48/48), completed with 16 local objects.
To github.com:geotribu/website.git
   9ded7f3a4..e920821d5  gh-pages -> gh-pages

# checking
(.venv) guts:~/Git/Geotribu/website$ git log --branches="gh-p*"
commit e920821d5baaee83103faaf1ffe46e0d33438a56 (origin/gh-pages, gh-pages)
Author: Julien M. <dev@ingeoveritas.com>
Date:   Thu Mar 25 12:06:18 2021 +0100

    Update documentation

commit 9ded7f3a473882ef56ab71e2b52beaaeca549cd5
Author: Julien M. (In Geo Veritas) <dev@ingeoveritas.com>
Date:   Mon Mar 22 00:03:58 2021 +0100

    Update documentation

AND if I try again with --no-history, then it's working:

(.venv) guts:~/Git/Geotribu/website$ ghp-import --force --message="Deploy Geotribu static website" --no-history --no-jekyll --push build/mkdocs/site
Énumération des objets: 1205, fait.
Décompte des objets: 100% (1205/1205), fait.
Compression par delta en utilisant jusqu'à 12 fils d'exécution
Compression des objets: 100% (101/101), fait.
Écriture des objets: 100% (1205/1205), 5.02 Mio | 4.16 Mio/s, fait.
Total 1205 (delta 565), réutilisés 1164 (delta 539), réutilisés du pack 0
remote: Resolving deltas: 100% (565/565), done.
To github.com:geotribu/website.git
 + e920821d5...106a133dd gh-pages -> gh-pages (forced update)

 # checking
(.venv) guts:~/Git/Geotribu/website$ git log --branches="gh-p*"
commit 106a133ddcff615b7aa61fbe7a570fe26e828cf2 (origin/gh-pages, gh-pages)
Author: Julien M. <dev@ingeoveritas.com>
Date:   Thu Mar 25 12:19:25 2021 +0100

    Deploy Geotribu static website

Am I missing something?

@Guts Guts changed the title Using Irregular "error: Failed to rebase gh-pages branch" with --no-history Mar 25, 2021
@c-w c-w closed this as completed in #99 May 24, 2021
@c-w
Copy link
Owner

c-w commented May 24, 2021

Thanks for the report. The --no-history functionality is now being tested as part of our CI and you can see that the project's gh-pages branch has only one commit now.

A fix for this has been released in 2.0.1

@Guts
Copy link
Author

Guts commented May 28, 2021

Thanks @c-w, it works like a charm 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

Successfully merging a pull request may close this issue.

2 participants