Why is "import as full commit" disabled?

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

This widget could not be displayed.

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>

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: ....

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

This widget could not be displayed.

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
Atlassian Summit 2018

Meet the community IRL

Atlassian Summit is an excellent opportunity for in-person support, training, and networking.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

734 views 1 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you