12

I recently posted an answer that worked exactly as the asker wanted, specific to his needs and maintainable by me (i.e. - I can answer questions about my answer if needed and explain its workings and why I provided it)

Another user with a high reputation saw fit to edit my answer to the point that I cannot answer questions about my answer, nor can I explain why it works or even if it does.

What should I do in this case? I don't feel right just redoing my original work. Is there a method to vode the other user's edits down without impacting my answer?

See the answer in question here: https://unix.stackexchange.com/posts/111727/revisions

  • 1
    the edits can be rolled back to a previous revision. I assume you can do that yourself, otherwise a high-rep user or a mod on unix is needed... – rene Jan 30 '14 at 20:34
  • @rene user has full edit rights over his/her own posts so this include rollback. – Shadow Wizard Jan 30 '14 at 20:38
  • 2
    Revert and add a comment (@ the user) suggesting that they add their own answer instead of heavily modifying yours. That's a pretty substantial change, and a user with that much rep should know better. – Charles Jan 30 '14 at 20:38
  • This should probably be on unix meta, not SO's meta – Servy Jan 30 '14 at 20:40
  • 4
    Yes that was pure radical change and plain rude in my opinion as a side viewer. In the revisions page you should see "rollback" link under the first revision, click it and like @Charles advised, leave comment to the editor using @name notation. – Shadow Wizard Jan 30 '14 at 20:40
  • 3
    You can link to this question if you feel uncomfortable in adressing the 'high-rep' user. – rene Jan 30 '14 at 20:40
  • Thanks, and I would have put this on the UL Meta, but for some reason my rep wasn't carrying over there, – David Wilkins Jan 30 '14 at 20:51
  • With the exception of meta.so (and that is about to change), all meta sites carry the reputation of their respective main sites. So, your rep on U&L meta is the same as your rep on Unix & Linux. – terdon Jan 31 '14 at 20:31
5

I understand where you're coming from, this kind of edit can seem aggressive and impolite. In the defense of this particular user, it is true that on this site we tend to try and make answers as general and applicable to as many *nix flavors as possible.

The specific edit in question changed this:

find . -maxdepth 1 -exec grep foo {} \;

to

find . ! -name . -prune -type f -exec grep /dev/null foo {} +

So, the user in question modified your answer to make it work on systems whose find implementation does not have the -mindepth and -maxdepth parameters. This makes the answer more portable and applicable to a wider range of systems. Granted the syntax is a bit more esoteric and it would have been better had the user actually included an explanation of what the new command does and how it works. I agree that without an explanation, such a radical edit is a bit too much.

The other edits were clearer, there is no reason to use \; to end the -exec command, ending it with + will make find minimize the number of separate commands it will run. From man find:

   -exec command {} +
          This  variant  of the -exec action runs the specified command on
          the selected files, but the command line is built  by  appending
          each  selected file name at the end; the total number of invoca‐
          tions of the command will  be  much  less  than  the  number  of
          matched  files.   The command line is built in much the same way
          that xargs builds its command lines.  Only one instance of  `{}'
          is  allowed  within the command.  The command is executed in the
          starting directory.

In most cases actually, + will be preferred over \;.

Adding the /dev/null ensures that the name of the matching file is always shown. This is because when grep is given more than a single file name, it will print the file name as well as the matching line for each match. Without it, and with the original version of your answer, you would only get the matching line with no indication of which file actually matched.

So, the edit actually did improve your answer by the standards of this site. It made it more portable which is generally to be preferred and it made it both faster and lighter on the system because of using +. Most importantly, it made it output the matched files, without which your original answer was incomplete.

So, while I can see why this bothered you and your reaction is perfectly reasonable and while you have every right to rollback to the original version, I would recommend you use at least some of the tricks shown in the edit to improve your answer.

One more thing, because the regulars of this site are very used to this user's edits and long experience has taught us that they always improve our answers, we are not bothered even by such radical changes. I admit that more than once I've had to delve into the man pages to understand why in the world a particular edit was made but there was a valid reason every time. Also, we have established that none of the regulars mind radical edits as long as they improve the answer. Most of us have stated so at one time or another. This means that there is more active editing going on here than on many other SE sites and this can be off-putting if you're not used to it.

I think, however, that your case demonstrates that we might be overdoing it a bit. Perhaps in the future we should make an effort to always add a detailed explanation to our edits, both for the benefit of the OP and for everyone else.

  • Upvoted: particularly for the observation that active editing here is one of this site's strengths. It is a wiki afterall; we shouldn't be too precious about others improving answers. – jasonwryan Jan 31 '14 at 19:58
  • 2
    @jasonwryan agreed. I do think it helps if the editor adds an explanation for the less obvious edits. It is strange if you end up with an answer that carries your name but which you don't understand. – terdon Jan 31 '14 at 20:02
  • 1
    Thank you for the feedback. I think I would have been much less likely to rollback if the edit was in addition to as opposed to over the top of my answer. I wouldn't even have minded if the answer was provided as a new one whether it was described as more portable than mine or otherwise. I still do not know how to make the edited version change depth, and while that wasn't explicit in the OP's scope, it was implicit in my answer, even if mine was system dependant. – David Wilkins Jan 31 '14 at 20:39
  • @DavidWilkins yes it was, your answer allowed the OP to set the depth but i) only on systems that support it and ii) that was not part of the question. Also, and more importantly, your answer did not print the name of the matching file and that is a problem. Anyway, as a general rule on the SE network, if you don't like an edit made to an answer (be it yours or not) you can roll it back. And remember that these sites are not forums, they are closer to wikis and the end result is community moderated, high quality answers. Aggressive editing is often expected. – terdon Jan 31 '14 at 20:41

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .