D5744: commit: ignore diff whitespace settings when doing `commit -i` (issue5839)

spectral (Kyle Lippincott) phabricator at mercurial-scm.org
Thu Jan 31 17:06:37 EST 2019


spectral added a comment.


  In https://phab.mercurial-scm.org/D5744#84781, @navaneeth.suresh wrote:
  
  > Sorry for bumping this up. I worked on a similar issue on https://phab.mercurial-scm.org/D5490. My initial revision was similar to this one. @spectral Don't you think it'll affect record extension which was written with zero test coverage? Please don't feel obligated. I am just being curious.
  
  
  I wasn't able to come up with a reason to support these but only when committing interactively (as I said in the commit description), but I guess there's justification in https://www.mercurial-scm.org/pipermail/mercurial-devel/2011-June/032316.html.
  
  So I think I can understand why this is desired for this command. Maybe a better option is to change the difffeatureopts() call to replace the section that it looks in? i.e. change:
  
    diffopts = patch.difffeatureopts(repo.ui, whitespace=True)
  
  to:
  
    diffopts = patch.difffeatureopts(repo.ui, section='commands-interactive', whitespace=True)
  
  This way we aren't looking at the `[diff]` section, so the options specified on the commandline end up working, and if someone really does want this as a default, they can get that behavior.
  
  I'm not at all attached to that section name, i.e. I could see this being something like the following, to make it look at commands.commit.interactive.ignorews (and others):
  
    diffopts = patch.difffeatureopts(repo.ui, section='commands', configprefix='commit.interactive.', whitespace=True)
  
  I think I like that option, I'll send a patch for it.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D5744

To: spectral, #hg-reviewers
Cc: navaneeth.suresh, mercurial-devel


More information about the Mercurial-devel mailing list