zsh-workers
 help / color / mirror / code / Atom feed
From: Aaron Schrab <aaron@schrab.com>
To: zsh-workers@zsh.org
Subject: Re: Can we all quietly agree to fix this commit log?
Date: Sat, 9 Nov 2013 06:29:54 -0500	[thread overview]
Message-ID: <20131109112954.GB6807@pug.qqx.org> (raw)
In-Reply-To: <131108182028.ZM26321@torch.brasslantern.com>

At 18:20 -0800 08 Nov 2013, Bart Schaefer <schaefer@brasslantern.com> wrote:
>I know all the git doc says never to amend a commit after pushing because
>it breaks clones, but I find this version number typo really bothersome.
>
>Is there some procedure we can figure out that gets around that?
>
>commit 375115c7dfd6dff576915d25fe2ecdd381dd9d81

An option that would clean it up somewhat, but without rewriting history 
would be to create a replacement ref for the mistaken commit.

  # Checking out tag should go into detached HEAD state
  git checkout zsh-5.0.2-test-1
  git commit --amend # Fixup the commit message
  git replace zsh-5.0.2-test-1 HEAD

At that point locally you'd see the amended commit message, unless you 
ask git to ignore replacement refs (e.g. `git --no-replace-objects 
log`).  But, replace refs are neither pushed nor fetched by default.  
Pushing can be done with:

  git push remote-name 'refs/replace/*:refs/replace/*'

And anybody who wanted to get the replacement ref 

  git fetch remote-name 'refs/replace/*:refs/replace/*'

People could also configure git to push and fetch those refs automatically 
whenever it's asked to interact with a given remote without being given 
a refspec.

  git config --add remote.remote-name.push  'refs/replace/*:refs/replace/*'
  git config --add remote.remote-name.fetch 'refs/replace/*:refs/replace/*'

But, the replacement ref would not affect any repository where it wasn't 
explicitly asked for in some way.  It's at least an easy first step.  If 
it's then determined that it isn't good enough, having created the 
replace ref doesn't really hurt anything; you'd still have the option of 
rewriting history.


  parent reply	other threads:[~2013-11-09 11:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-09  2:20 Bart Schaefer
2013-11-09  7:42 ` Wayne Davison
2013-11-09 11:29 ` Aaron Schrab [this message]
2013-11-09 12:22 ` Mikael Magnusson
2013-11-09 22:23   ` Bart Schaefer
2013-11-09 22:52     ` Aaron Schrab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131109112954.GB6807@pug.qqx.org \
    --to=aaron@schrab.com \
    --cc=zsh-workers@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).