When I used "svn diff en.lua ", I get this result:
num="Amount",
all="All",
class="Quality",
-own="Have",
+own="Have2",
paper="Specs",
piece="Shard",
not_enough=" not enough",
but I only want to see this
-own="Have",
+own="Have2",
I'm wondering which parameter should I use for "svn diff"?
At least with svn 1.9, you can use svn diff -x -U0
. I'm unsure whether the option is available in earlier versions. This does not seem to be documented in the svn book, however the command line documentation shows:
$svn help diff
[...]
-x [--extensions] ARG : Specify differencing options for external diff or
internal diff or blame. Default: '-u'. Options are
separated by spaces. Internal diff and blame take:
-u, --unified: Show 3 lines of unified context
-b, --ignore-space-change: Ignore changes in
amount of white space
-w, --ignore-all-space: Ignore all white space
--ignore-eol-style: Ignore changes in EOL style
-U ARG, --context ARG: Show ARG lines of context
-p, --show-c-function: Show C function name
This will work for any SVN version:
svn diff some_file.extension | sed -n -e '/@@/,$p' | grep -vE "^( |@@)"
Explanation:
sed
command skips header.grep
command skips non-matched lines (which are prefixed with space) and changes info.So you should only be left with lines starting with a single +
or -
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With