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

Re: [JGIT PATCH] Create a debugging tool "jgit rebuild-commitgraph"

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 16, 2009, 20:13 UTC
Message-ID
<20090316201333.GR22920@spearce.org>
In-Reply-To
<200903162109.46653.robin.rosenberg.lists@dewire.com>
Robin Rosenberg <robin.rosenberg.lists@dewire.com> wrote:
Show 10 quoted lines
> måndag 16 mars 2009 15:44:50 skrev "Shawn O. Pearce" <spearce@spearce.org>:
> > Robin Rosenberg <robin.rosenberg@dewire.com> wrote:
> > > 
> > > I'd hate to put such a dangerous thing in the list of normal tools. If the user
> > > want to shoot him/her-self in the foot they should get a license first.
> > 
> > How about squashing this in?
> 
> Does it have to be a utility accessible through the pgm interface? Why not 
> just run ut as java org.spearce.jgit.pgm.debug.RebuildCommitGraph ? 
Yea, that's fine too.  Then its "debug-rebuildcommitgraph" I think,
but that's still a reasonable name for it.
 
Show 5 quoted lines
> >  	@Override
> >  	protected void run() throws Exception {
> > +		if (!really && !db.getAllRefs().isEmpty()) {
> > +			final StringBuilder m = new StringBuilder();
> > +			m.append("fatal: ");
...
Show 5 quoted lines
> > +			System.err.println(m);
> > +			throw die("Need approval to destroy current repository");
> 
> What's wrong with old fashioned '+' ? (which just translated to exactly this series
> of StringBuilder calls anyway?

Nothing, other than formatting. + line wraps somewhat ugly sometimes under the Eclipse formatter. Using StringBuilder with one append per line and a short name for the StringBuilder variable makes it easier to format.

-- 
Shawn.
Previous: Robin RosenbergNext: Shawn O. Pearce
Message 7 of 8 in “Create a debugging tool "jgit rebuild-commitgraph"”
  1. Create a debugging tool "jgit rebuild-commitgraph"Shawn O. Pearce, Mar 13, 2009
  2. Johannes SchindelinMar 13, 2009
  3. Shawn O. PearceMar 13, 2009
  4. Robin RosenbergMar 15, 2009
  5. Shawn O. PearceMar 16, 2009
  6. Robin RosenbergMar 16, 2009
  7. Shawn O. PearceMar 16, 2009
  8. Create a debugging tool "jgit debug-rebuild-commitgraph"Shawn O. Pearce, Mar 16, 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.