Skip to content

Can't edit packages, doom removes .git history. #7414

@danielkrajnik

Description

@danielkrajnik

I confirm that...

  • I have searched the issue tracker, documentation, FAQ, Discourse, and Google, in case this issue has already been reported/resolved.
  • I have read "How to Debug Issues", and will use it to provide as much information about this issue as possible.
  • The issue can be reproduced on the latest available commit of Doom.
  • The issue can be reproduced on a stable release of Emacs, such as 27, 28, or 29. (Unstable versions end in .50, .60, or .9x)

Expected behavior

Consistently be able to merge upstream updates with your local changes.

Current behavior

At some point local changes to htmlz-mode package break doom upgrade and the package can't be merged anymore. Inspecting git log shows that the previous commits just "disappear", everything except for your local commit. When you then try to git pull:

hint: You have divergent branches and need to specify how to reconcile them.
hint: You can do so by running one of the following commands sometime before
hint: your next pull:
hint:
hint:   git config pull.rebase false  # merge
hint:   git config pull.rebase true   # rebase
hint:   git config pull.ff only       # fast-forward only
hint:
hint: You can replace "git config" with "git config --global" to set a default
hint: preference for all repositories. You can also pass --rebase, --no-rebase,
hint: or --ff-only on the command line to override the configured default per
hint: invocation.
fatal: Need to specify how to reconcile divergent branches.

and doom upgrade :

  > Updating packages (this may take a while)...
    > In repository "htmlz-mode", HEAD on default branch "master" has diverged from "origin/master"

         1) Abort
         2) Merge "origin/master" into "master"
         3) Rebase "master" onto "origin/master"
         4) Reset "master" to "origin/master"
         5) Magit log "master...origin/master" and open recursive edit

      How to proceed? (1, 2, 3, 4, 5)

None of these options works though.

Steps to reproduce

  1. add to your packages.el:
elisp
(package! htmlz-mode
  :recipe (:host github :repo "0xekez/htmlz-mode"))
  1. doom sync
  2. cd $HOME/.config/emacs/.local/straight/repos/htmlz-mode
  3. edit htmlz.el
  4. add to line 109 ;;;###autoload
  5. save and close
  6. run in the same directory git commit -am "fix htmlz-mode not showing up on start"
  7. run git log to confirm the old upstream and new local commits are saved
  8. go about your day. At some point (maybe today, next day, next week) doom upgrade will fail with the above error and you git log will only have your local commit.

System Information

https://pastebin.com/mmuSYT1N

Metadata

Metadata

Assignees

No one assigned

    Labels

    incompleteNot enough info to categorize this issue/PR.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions