Subject: Re: [EGIT PATCH 05/10] Do not write to the reflog unless the refupdate logmessage is set

From: "Shawn O. Pearce" <[email-masked]>
Date: Wed, 3 Jun 2009 08:41:29 -0700

Robin Rosenberg <[email-masked]> wrote:
> Do not write to the reflog unless the refupdate logmessage is set

Why not?  What is the justification for this?  Isn't a reflog record
still useful, at least to point out that something happened at this
point in time, and here's the old/new values?

> diff --git a/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java b/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
> index a9ab73b..79d9f2d 100644
> --- a/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
> +++ b/org.spearce.jgit/src/org/spearce/jgit/lib/RefUpdate.java
> @@ -479,7 +479,8 @@ else if (status == Result.FAST_FORWARD)
>  			else if (status == Result.NEW)
>  				msg += ": created";
>  		}
> -		RefLogWriter.append(this, msg);
> +		if (msg != null)
> +			RefLogWriter.append(this, msg);
>  		if (!lock.commit())
>  			return Result.LOCK_FAILURE;
>  		db.stored(this.ref.getOrigName(),  ref.getName(), newValue, lock.getCommitLastModified());

-- 
Shawn.