From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16391 invoked by alias); 9 Nov 2013 11:35:44 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 31943 Received: (qmail 11163 invoked from network); 9 Nov 2013 11:35:30 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 Date: Sat, 9 Nov 2013 06:29:54 -0500 From: Aaron Schrab To: zsh-workers@zsh.org Subject: Re: Can we all quietly agree to fix this commit log? Message-ID: <20131109112954.GB6807@pug.qqx.org> Mail-Followup-To: zsh-workers@zsh.org References: <131108182028.ZM26321@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <131108182028.ZM26321@torch.brasslantern.com> User-Agent: Mutt/1.5.22+36 (g7db327c) (2013-10-16) At 18:20 -0800 08 Nov 2013, Bart Schaefer 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.