git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Grimm <koreth@midwinter.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: skimo@liacs.nl, git@vger.kernel.org, Junio C Hamano <gitster@pobox.com>
Subject: Re: [PATCH 4/4] Add git-rewrite-commits
Date: Sun, 08 Jul 2007 11:04:22 -0700	[thread overview]
Message-ID: <46912726.5080807@midwinter.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0707081729040.4248@racer.site>

Johannes Schindelin wrote:
> I am really unhappy that so much is talked about filtering out commits.  
> That is amost certainly not what you want in most cases.  In particular, I 
> suspect that most users would expect the _changes_ filtered out by such a 
> command, which is just not true.
>   

I agree that unless it's named and documented very carefully, users 
might expect this to tweak history such that the commits in question 
never happened (unlike revert, which of course adds a new commit and 
leaves the old ones alone.) The documentation for this command could 
stand to be more explicit about that.

> Further, I do not see much value in making this operation faster.  It is 
> meant to be a one-time operation, for example when you open-source a 
> product and have to cull a lot of history that you must not show for legal 
> reasons.  It is a one-shot operation.
>   

Your recent changes to git-rebase (which, BTW, are great) include a 
feature that's very similar to this: the "squash these commits together 
in my history" feature. That'd be my use case for this, when I want to 
publish my changes to other developers who don't care about all my 
intermediate checkpoints of work in progress, and when the commits I'm 
removing haven't been published anywhere else yet.

With this command, I could do something like:

git rewrite-commits --grep="!@@@checkpoint"
git push

and it would strip out all my intermediate checkpoint commits (assuming 
I've marked them as such in my commit comments, which I always do) 
before pushing to my project's shared repo. Right now that's a much more 
cumbersome, and very manual, operation. Even with the new git-rebase 
changes, I still have to pick out those commits by hand, and it assumes 
that I otherwise want to do a rebase in the first place.

> So there are two things I see here that filter-branch cannot do yet.  The 
> first is to rewrite _all_ branches, which should be easy to do, it only 
> has to be done.
>   

I wonder if it makes sense to go that direction, though, or to make this 
command do the things that filter-branch can do, for the simple reason 
that filter-branch is a shell script and this is already a nice 
non-shell-dependent C program. Obviously you end up in the same place 
either way eventually once filter-branch percolates to the top of the 
"port these scripts to C" list, but it seems odd to me to port features 
from a C program back to a shell script only to have to convert the 
shell script to C later on.

Ironically, this app doesn't really speed up the one thing I find too 
slow in filter-branch: the "remove a file from the tree in all 
revisions" case. To do that you still have to launch a filter app for 
every commit, which is especially bad when the file in question only 
appears in a few revisions deep in the history of a repo.

This command points us in the direction of a "remove/rename this file in 
history" feature that doesn't require forking tens of thousands of child 
processes on a repo with lots of history. For that alone I think it's 
worthwhile, even though it's not there yet; that will never happen with 
a shell script. And yeah, that's not a frequent operation, but it's sure 
nice when even the infrequent operations are lightning fast.

-Steve

  parent reply	other threads:[~2007-07-08 18:04 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-08 16:23 [PATCH 0/4] Add git-rewrite-commits skimo
2007-07-08 16:23 ` [PATCH 1/4] export get_short_sha1 skimo
2007-07-08 16:23 ` [PATCH 2/4] export add_ref_decoration skimo
2007-07-08 16:23 ` [PATCH 3/4] revision: mark commits that didn't match a pattern for later use skimo
2007-07-08 16:23 ` [PATCH 4/4] Add git-rewrite-commits skimo
2007-07-08 16:37   ` Johannes Schindelin
2007-07-08 17:30     ` Sven Verdoolaege
2007-07-08 18:17       ` Johannes Schindelin
2007-07-08 19:11         ` Sven Verdoolaege
2007-07-08 18:04     ` Steven Grimm [this message]
2007-07-08 18:15       ` Sven Verdoolaege
2007-07-08 18:41       ` Johannes Schindelin
2007-07-08 21:10         ` Sven Verdoolaege
2007-07-09  9:01           ` Johannes Sixt
2007-07-09  9:48             ` Sven Verdoolaege
2007-07-09 11:57             ` Johannes Schindelin
2007-07-08 23:56   ` Johannes Schindelin
2007-07-09  9:47     ` Sven Verdoolaege
2007-07-09 12:57       ` Johannes Schindelin
2007-07-09 13:49         ` Sven Verdoolaege
2007-07-09 14:11           ` Johannes Schindelin
2007-07-09 14:42             ` Sven Verdoolaege
2007-07-09 14:59               ` Johannes Schindelin
2007-07-09 12:36     ` Jeff King
2007-07-09 13:16       ` Johannes Schindelin

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=46912726.5080807@midwinter.com \
    --to=koreth@midwinter.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=skimo@liacs.nl \
    /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.
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).