>From Git’s perspective, both are “destructive”. You will see that the old
line is deleted and a new one is added. Also, if you simply check if
something was added to the code, your destructive example becomes
non-destructive, as the new version only adds “inline-” in the middle of
the line.

What you need here is a semantic scanner, which you can run from within a
Git hook. The former doesn’t really belong to this group, while the latter
is explained at [1] and [2].

Best,
Gergely

[1] https://git-scm.com/docs/githooks
[2] https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks

2015-10-30 13:06 GMT+01:00 Ivan Švaljek <ivan.sval...@gmail.com>:

> By destructive I mean any code overwrite or deletation, by non-destructive
> I mean anything added to the source file that doesn't overwrite or delete
> old version's content.
>
> Destructive
> .banner_wrap {display:block;} -> .banner_wrap {display:inline-block;}
>
> Non-destructive
> .banner_wrap {display:block;} -> .banner_wrap {display:block; border:1px
> solid #eee; }
>
>
> Dana petak, 30. listopada 2015. u 12:17:04 UTC+1, korisnik Gergely
> Polonkai napisao je:
>>
>> First things first: what do you think destrictive? Removing "rm -rf \*"
>> from a shell script doesn’t seem destructive to me, for example…
>>
>> 2015-10-29 20:58 GMT+01:00 Ivan Švaljek <ivan.s...@gmail.com>:
>>
>>> Is it possible to automate an C# app using git, so I get a flag whether
>>> the changes in the new file version are destructive or non-destructive?
>>> Bonus question: is there a functionality in git to then merge those two
>>> file versions if the changes were non destructive (line addition in css or
>>> a comment in php)?
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "Git for human beings" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to git-users+...@googlegroups.com.
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>>
>> --
> You received this message because you are subscribed to the Google Groups
> "Git for human beings" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to git-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Git 
for human beings" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to git-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to