Why is "import as full commit" disabled?

christoph_dietze January 13, 2013

Hello!

I made a commit and created a patch out of that. Then I reset my master before that commit.

Now, in the drop down box in: Actions -> Apply Patch... , I select the patch file just created, but the item "import as full commit" is greyed out. I cannot see the reason why it is disabled?

2 answers

1 accepted

0 votes
Answer accepted
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 13, 2013

Hi Christoph,

This would indicate to me that the patch either isn't made from a commit or there's something wrong with the patch file itself. In Mercurial we expect to see "# HG changeset patch" at the start of the file and in Git we expect to see "From: " and "Subject: " as is usually in a patch file made from a commit (more docs on Git patches here: http://www.kernel.org/pub/software/scm/git/docs/git-format-patch.html). It can only be a full commit if it was a patch created from a commit, hence the reliance on what should be in the patch file.

You may have accidentally created the patch from uncommitted changes meaning there was no author and thus not allowing you to import it as a full commit. If you check the patch file contents itself to see if they match the format as was briefly described in the above paragraph then we can see from there what's going wrong in this case.

Hope that helps

Cheers

<body></body>
christoph_dietze January 13, 2013

I am using GIT by the way :-)

I created the patch from a commit that I haven't pushed yet.

I checked the patch file and it starts with:

From 9a247ca8a521b066adb43e9c9369223781816f99 Mon Sep 17 00:00:00 2001
From: Christoph &lt;christoph.dietze@gmail.com&gt;
Date: Fri, 11 Jan 2013 11:12:50 +0100
Subject: ....
stevestreeting
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 20, 2013

The git patch analysis actually looks for 'From:' in the first line, when in fact yours starts with 'From ' (no colon). Looks like git format-patch's output must have changed without us noticing.

Filed as a bug here: https://jira.atlassian.com/browse/SRCTREE-1376

0 votes
christoph_dietze January 19, 2013

Using git directly on the commandline works:

git am ../patch.diff 
Applying: My generous patch

But in SourceTree I cannot apply the commit from that same file.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events