git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Mikko Rantalainen <mikko.rantalainen@peda.net>
To: git@vger.kernel.org
Subject: Porcelain support for daggy-fixes?
Date: Thu, 10 Jun 2010 16:55:10 +0300	[thread overview]
Message-ID: <4C10EEBE.5030400@peda.net> (raw)

Introduction: http://monotone.ca/wiki/DaggyFixes/

I understand that this can already be done with git. The method is

1) store the current HEAD somewhere
2) figure out the proper parent for the bug fix
3) checkout the parent
4) implement the fix
5) commit the fix
6) checkout HEAD
7) merge with the commit from step 5

Is there some way to do this more automatically? The way I think this
should be done:

1) fix a bug that you just found (let's imagine for a second that you
just happened to know how to fix the bug without knowing the history of bug)
2) git commit (the bugfix is now the tip of the HEAD)
3) git daggy-fix

And you're done.

Here the magical "daggy-fix" would do the following:

"Remove" the change HEAD^..HEAD from the current branch, try to
recursively apply the patch to ancestors of HEAD and locate oldest
parent that the patch can be automatically applied to without a
conflict. Let's call this parent BUG (best guess for the original commit
that introduced the bug). Commit the patch as a new child of BUG and
then merge with HEAD^ (from the moment daggy-fix was executed). Checkout
the new HEAD to replace the original HEAD.

In short, replace the current tip of the current branch with the merge
of last commit rebased as the bugfix for historical commit and HEAD^.

Logical syntax for this command could be

git daggy-fix fix-commit-id bug-commit-id

where
fix-commit-id is the commit that should be relocated and re-merged
bug-commit-id is the commit that introduced the bug (no need for
automatic detection of the parent)

both commit id's are optional.

Does this sound reasonable or is there already some better way?

-- 
Mikko

             reply	other threads:[~2010-06-10 14:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10 13:55 Mikko Rantalainen [this message]
2010-06-10 14:21 ` Porcelain support for daggy-fixes? Pascal Obry
2010-06-11 11:25   ` Mikko Rantalainen

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=4C10EEBE.5030400@peda.net \
    --to=mikko.rantalainen@peda.net \
    --cc=git@vger.kernel.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://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).