public inbox for gentoo-catalyst@lists.gentoo.org
 help / color / mirror / Atom feed
From: "W. Trevor King" <wking@tremily.us>
To: gentoo-catalyst@lists.gentoo.org
Cc: Brian Dolbec <dolsen@gentoo.org>
Subject: Re: [gentoo-catalyst] [PATCH 0/4] Some general cleanup, remove some hardcoding of paths.
Date: Thu, 28 Feb 2013 08:17:10 -0500	[thread overview]
Message-ID: <20130228131710.GA2872@odin.tremily.us> (raw)
In-Reply-To: <1362016021-8338-1-git-send-email-dolsen@gentoo.org>

[-- Attachment #1: Type: text/plain, Size: 1572 bytes --]

On Wed, Feb 27, 2013 at 05:46:57PM -0800, Brian Dolbec wrote:
> There are several more bugfixes I feel shuld be applied to master if
> you intend on releasing a bug fix version bump.  They will have to
> be applied manually since the file names and locations have changed
> in the rewrite.

Git records abbreviated blob SHAs in the diff:

  diff --git a/ChangeLog b/ChangeLog
  index 893cfec..12b41f2 100644
  --- a/ChangeLog
  +++ b/ChangeLog

which it can use to apply patches to files, even if the patched blobs
have been renamed in a separate commit.  You have to use the `--3way`
option with `git am` to turn this functionality on, though.  For
example:

  $ mkdir test-repo
  $ cd test-repo
  $ git init
  $ echo 'hello world' > README
  $ git add README
  $ git commit -m 'README: create with dummy content'
  $ git mv README{,-b}
  $ git commit -am 'README-b: moved from README'
  $ echo 'goodbye world' >> README-b
  $ git commit -am 'README: edited'
  $ git format-patch HEAD^
  $ git reset --hard HEAD^^
  $ git am -3 *patch

Works (even though we reset to before the rename), as we can see with:

  $ git --no-pager log --oneline
  c587719 README: edited
  ee5ec97 README: create with dummy content
  $ cat README
  hello world
  goodbye world

However, the fact that Git *can* apply patches like this doesn't mean
that it's a good idea ;).

Cheers,
Trevor

-- 
This email may be signed or encrypted with GnuPG (http://www.gnupg.org).
For more information, see http://en.wikipedia.org/wiki/Pretty_Good_Privacy

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

      parent reply	other threads:[~2013-02-28 13:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-28  1:46 [gentoo-catalyst] [PATCH 0/4] Some general cleanup, remove some hardcoding of paths Brian Dolbec
2013-02-28  1:46 ` [gentoo-catalyst] [PATCH 1/4] Whitespace cleanup Brian Dolbec
2013-02-28 11:46   ` W. Trevor King
2013-02-28 23:44     ` Matt Turner
2013-03-09  2:36   ` Matt Turner
2013-02-28  1:46 ` [gentoo-catalyst] [PATCH 2/4] Add more configured defaults Brian Dolbec
2013-02-28 11:51   ` W. Trevor King
2013-02-28  1:47 ` [gentoo-catalyst] [PATCH 3/4] Remove self.mounts and self.mountmap's use of paths for keys and paths Brian Dolbec
2013-02-28  3:01   ` Brian Dolbec
2013-02-28  1:47 ` [gentoo-catalyst] [PATCH 4/4] cleanup long lines, improve useage() output formatting slightly Brian Dolbec
2013-02-28 13:17 ` W. Trevor King [this message]

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=20130228131710.GA2872@odin.tremily.us \
    --to=wking@tremily.us \
    --cc=dolsen@gentoo.org \
    --cc=gentoo-catalyst@lists.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox