Hello, On Sat 07 May 2022 at 09:01pm -03, David Bremner wrote:
> Sean Whitton <spwhit...@spwhitton.name> writes: > >> Just looking at my current usage, there are two cases where I've wrapped >> nmbug in some additional myrepos scripting. The first is a status >> command: >> >> status = >> nmbug-spw status | grep -v "^U\s" || true >> # `nmbug status` does not catch committed but unpushed changes >> git --no-pager log --branches \ >> --not --remotes \ >> --simplify-by-decoration --decorate --oneline >> >> Possibly notmuch-git could learn how to do this? > > Perhaps. I think I would prefer something a bit more concise like a > count of unpushed commits. Do you tend to actually have meaningful > commit messages? I don't. I just want output if there are unpushed changes and no output if not. A count sounds good to me. > Personally I would be more worried about checkout (e.g. after init) > wiping out my notmuch database, since an errant commit can always be > reverted. Both cases seem to be covered by your heuristic. Perhaps we > could just count the size of the update, and insist on a --force option > if it is too large. I think you're right. It makes sense to build in safety features only for the case of accidentally wiping out the db. Either instead or in addition to something size-based, how about requiring --force if there do not exist any tags with the prefix in the notmuch database already? The size thing is brittle; in my scripting attempts, I've encountered several annoying edge cases. > For what it's worth, you can already call > > notmuch git -C $HOME/lib/nmbug-spw -p spw:: ... > > if that is more convenient. > > The defaults have already changed in my latest working branch so the > default repo is under $XDG_DATA_HOME/notmuch/$NOTMUCH_PROFILE/git, and > the default prefix is ''. But re-reading this, I see see we polled two > people and got two answers for what a reasonable default prefix is, so a > configuration item is definitely needed for prefix. Probably it is also > reasonable to have one for repo location. Coolio. -- Sean Whitton _______________________________________________ notmuch mailing list -- notmuch@notmuchmail.org To unsubscribe send an email to notmuch-le...@notmuchmail.org