Can't edit packages, doom removes .git history.
- Dominant language
- Emacs Lisp
- Stars
- 22.7k
- Forks
- 3.1k
- Avg merge
- 10h 46m
- Merged PRs (30d)
- 4
Description
### I confirm that...
- [x] I have searched the [issue tracker](https://github.com/doomemacs/doomemacs/issues), [documentation](https://docs.doomemacs.org), [FAQ](https://docs.doomemacs.org/-/faq), [Discourse](https://discourse.doomemacs.org), and [Google](https://google.com), in case this issue has already been reported/resolved.
- [x] I have read "[How to Debug Issues](https://doomemacs.org/d/how2debug)", and will use it to provide as much information about this issue as possible.
- [x] The issue can be reproduced on the **latest** available commit of Doom.
- [x] 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"))
```
2. `doom sync`
3. `cd $HOME/.config/emacs/.local/straight/repos/htmlz-mode`
4. edit `htmlz.el`
5. add to line 109 `;;;###autoload`
6. save and close
7. run in the same directory `git commit -am "fix htmlz-mode not showing up on start"`
8. run `git log` to confirm the old upstream and new local commits are saved
9. 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
Contributor guide
Research direction
Start by reproducing the steps with htmlz-mode in .local/straight/repos/htmlz-mode, checking git log before and after doom upgrade. Then inspect the package update path that presents the merge, rebase, or reset choices. Done means local commits and upstream history remain available and doom upgrade can consistently merge the repository changes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- emacs-lisp, git
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100