[LyX/master] Give error if adding a branch that already exists

Scott Kostyshak skostysh at lyx.org
Tue Mar 25 13:13:04 UTC 2025


On Mon, Mar 24, 2025 at 10:22:24PM +0100, Scott Kostyshak wrote:
> On Mon, Mar 24, 2025 at 01:16:00PM -0400, Richard Kimberly Heck wrote:
> > On 3/24/25 8:22 AM, Scott Kostyshak wrote:
> > > On Mon, Mar 24, 2025 at 12:16:49PM +0000, Scott Kostyshak wrote:
> > > > commit 7d1eea0301986c6f7a080bfaf8166d051aa71f05
> > > > Author: Scott Kostyshak <skostysh at lyx.org>
> > > > Date:   Mon Mar 24 12:37:05 2025 +0100
> > > > 
> > > >      Give error if adding a branch that already exists
> > > >      The previous behavior was a silent no-op. Now, we inform the user
> > > >      that the branch name already exists, and preserve the field text so
> > > >      it can be easily modified after the message.
> > > > ---
> > > >   src/frontends/qt/GuiBranches.cpp | 12 +++++++++++-
> > > >   1 file changed, 11 insertions(+), 1 deletion(-)
> > > Is it OK if I add an assertion (in attached patch) to potentially find
> > > other places where we add a branch that already exists? I feel as though
> > > all cases should handle the situation add a higher level, although I'm
> > > not confident in that claim.
> > 
> > Given that some people do use master for actual work, that seems a bit harsh
> > (since it will effectively crash the program). How about just adding an
> > alert here or something?
> 
> Makes sense, I'll do that.

Done in master at d8d7496e. It now just gives a terminal message. I
think eventually it would make sense to convert to an assert, but I
agree no need to do that now.

Scott
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20250325/7706ea5a/attachment.sig>


More information about the lyx-devel mailing list