I use IntelliJ IDEA, and furthermore I use the "create patch" feature to
generate a patch file.  This is far more convenient than using the CLI when
there are multiple "change lists", and for other reasons, since at the CLI
I would have to presumably list out each changed file to include.

However, IntelliJ's patches aren't always compatible with other tools that
consume patch files.  We use Apache Yetus and it doesn't like them -- it
won't even kick off a build so you'll never see a comment from it in the
related JIRA issue.  JetBrains is tracking this patch compatibility
deficiency and they may improve it in the future but it's been years.

I wrote the following one-liner script on my path that I use to convert a
patch file in-place.  The only thing that it does that is necessary to make
Yetus like it is to add the "a/" and "b/" to the file paths in the patch.
Here it is:

# see https://youtrack.jetbrains.com/issue/IDEA-92793
sed -i '' -e 's/^--- /--- a\//g' -e 's/^+++ /+++ b\//g' "$1"

I'm sharing this so others know of the issue and may want to use this
script as well.  I will report it to Yetus; maybe they'll include detection
of when to do this so I don't have to remember to.

~ David
-- 
Lucene/Solr Search Committer, Consultant, Developer, Author, Speaker
LinkedIn: http://linkedin.com/in/davidwsmiley | Book:
http://www.solrenterprisesearchserver.com

Reply via email to