Thread (4 messages) flat view 4 messages, 4 authors, 2016-06-15

Re: Git Bug - diff in commit message.

From: Michael Witten <hidden>
Date: 2016-06-15 22:52:00

On Thu, Sep 8, 2011 at 14:49, anikey [off-list ref] wrote:
quoted hunk ↗ jump to hunk
Hi, peops. I'm pretty much sure that's a bug.

What I did was putting git diff (i needed to tell people that for my changes
to start working they needed to aplly message-inline patch to some code
which was not under git) in commit message. Like adding:
diff --git a/app/controllers/settings_controller.rb
b/app/controllers/settings_controller.rb
index 937da74..0e8440d 100644
--- a/app/controllers/settings_controller.rb
+++ b/app/controllers/settings_controller.rb
@@ -42,7 +42,7 @@ class SettingsController < ApplicationController
  end

  def snmp_mibs
-    render layout: 'ext3'
+    render layout: 'ext3_2'
  end

  def cfg_auth_keys(auth_type=:all)

though the commit itself didn't contain that change. So while `git rebase
some_branch_name` I started getting:

First, rewinding head to replay your work on top of it...
Applying: My cool patch.
fatal: sha1 information is lacking or useless
(app/controllers/settings_controller.rb).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 My cool patch.

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".
Ha!

It would appear that `git rebase' is in fact producing patches with
`git format-patch' and then applying the resulting patches with `git
am', which gets confused by your inline diff; this can be clearly seen
in the `git-rebase--am[.sh]' file.

Perhaps `git rebase' should be reimplemented to use `git cherry-pick',
or does that suffer from the same problem?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help