alphapapa / alphapapa/magit-todos

Idea: use (magit-get-upstream-ref) as ref commit

オープン
#155 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement good first issue help wanted
主要言語
Emacs Lisp
スター
791
フォーク
54
PR マージ指標
30日以内にマージされた PR はありません

説明

This is just an idea/suggestion. I see that magit-todos uses `(magit-main-branch)` to figure out (using `merge-base`) the revision to compare the HEAD against.

How about using `(magit-get-upstream-ref)` instead? I'm suggesting this, because people might not update their `main` branch for a long time, so it gets out of sync, and `merge-base` may find some very ancient revision, so we get a lot of entries in the TODO list.
On the other hand, `(magit-get-upstream-ref)` is usually more up-to-date, and it also more likely contains a more relevant revision to find the merge base.

What do you think?

I've been using this idea for a while, and it seems to work for me. If anyone interested, I use this snippet to achieve this:

```lisp
(defun my-magit-mode-hook ()
(let ((upstream (magit-get-upstream-ref)))
(when upstream
(setq magit-todos-branch-list-merge-base-ref upstream)))
(add-hook 'magit-mode-hook 'my-magit-mode-hook)
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。