git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH JGIT] Circular references shouldn't be created

From
Shawn O. Pearce <spearce@spearce.org>
Date
Sep 18, 2009, 21:20 UTC
Message-ID
<20090918212017.GI14660@spearce.org>
In-Reply-To
<C89280B882467443A695734861B942B28759DEAA@DEWDFECCR09.wdf.sap.corp>
"Sohn, Matthias" <matthias.sohn@sap.com> wrote:
Show 13 quoted lines
> Robin Rosenberg <robin.rosenberg@dewire.com> wrote on Freitag, 18. September 2009 00:52
> > I think we should do this in the UI by not allowing the user to make a
> > choice that would result in a loop and fixing the way the UI resolves
> > choices. When creating a new branch we should analyze the selected
> > ref and dereference it if it is a symbolic name like HEAD or if it is a
> > tag,
> > and perhaps show it like "HEAD (refs/heads/master)" in the the dialog.
> > 
> > Using unresolvable refs as the base for a new branch should be
> > disallowed.
> 
> If we would do it in the EGit UI how about catching such cases 
> in other applications using JGit ?

I agree with Matthias here, other applications using JGit will also want to be able to detect a ref loop at ref creation time, and also at ref reading time. We should put the test function into JGit and allow the UI to call that test function to determine if creating that symref right now would create a loop. EGit UI can then use that function to qualify the user's selection, and prevent the user from making a choice which would create a loop.

-- 
Shawn.
Previous: Sohn, Matthias
Message 5 of 5 in “Circular references shouldn't be created”
  1. Circular references shouldn't be createdSohn, Matthias, Sep 17, 2009
  2. Avery PennarunSep 17, 2009
  3. Robin RosenbergSep 17, 2009
  4. Sohn, MatthiasSep 18, 2009
  5. Shawn O. PearceSep 18, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.