Why would reverse hunk button be unselectable?

Shawn Fox March 23, 2015

Why would the reverse hunk button be unselectable? As I click on various commits within the commit graph, sometimes it is available but most of the time it is grayed out and unselectable.  I cannot understand why it is mostly unselectable.  

 

Open Source Components / Libraries
WPF Converters © 2007-2012 Kent Boogaart (MsPL)
ScrollableTabPanel © 2010 Olaf Rabbachin (public domain)
Circular Progress Bar © 2010 Sacha Barber (CPOL)
WPF Task Dialog Wrapper © 2011-2012 Sean A. Hanley (CPOL)
CommandSink © 2008 Josh Smith (CPOL)
ListViewLayoutManager © 2008 Jani Giannoudis (CPOL)
MultiSelectTreeView © 2012 Yves Goergen, Goroll (MIT)
Drag/Drop component © 2009-2011 Gong Solutions (New BSD)
RestSharp © 2009-2012 John Sheehan et al (Apache 2)
EncodingTools by Carsten Zeumer (public domain)
Open Source Binaries
PuTTY © 1997-2012 Simon Tatham et al (MIT)
Git (GPL 2) Unmodified binaries downloaded by SourceTree, source code is available.
Mercurial (GPL 2) Unmodified binaries downloaded by SourceTree, source code is available.
HgAttic Mercurial extension © Various (GPL 2) full source code is included.
MSYS patch tool © 1988 Larry Wall, 2003-2010 Free Software Foundation ( GPL 2 ) full source code is included .
7zip © 1999-2010 Igor Pavlov (license)

1 answer

0 votes
Seth
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.
March 24, 2015

Sometimes a hunk is too large to be displayed in its entirety. When this happens, SourceTree doesn't let you reverse the entire hunk because you can't preview everything you're reversing. You can try reducing the lines of context to break your large hunk into smaller hunks.

You can also adjust the settings in the Diff tab of the Options menu (see the "Internal Diff View" section).

Shawn Fox March 24, 2015

Okay.  That makes some sense.  However, I am in a situation where I'd like to reverse the deletion of a file.  Therefore changing the hunk size will not do any good since the entire file is the hunk.  The reverse file option is also grayed out.  My diff settings are set very high to 16K and the files in question are certainly not bigger than 16K.

It appears that the files in question are more than 100 lines.  The Max Diff Line Count is set to 2500.  My size limits for both text and binary are set to 16K.  Why would it still not allow me to reverse a file?

Seth
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.
March 24, 2015

If you have not committed the deletion, you should be able to right click the file in the list, and choose "Discard", which means "get rid of any uncommitted changes". If you have committed the deletion, it looks like you may need to reverse the entire commit, then amend the reverse commit to restore any changes you want to keep. Either way, you'll have to use parts of the UI outside the diff view.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events