mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
doc/developer: allow whitespace changes mixed with functional changes
The cosmetic-changes policy in developer.texi was written during the SVN era, when reviewing indentation changes mixed with functional changes was genuinely difficult. Since FFmpeg has moved to Git, reviewers now have simple built-in tools to ignore whitespace changes: git diff -w git log -p --ignore-all-space Forgejo's pull request UI also offers a 'Hide whitespace changes' toggle, making it trivial to focus on the functional diff. For those who prefer reviewing patches in their mail client, the same result can be achieved by saving the patch and running: git apply --ignore-whitespace <patch> && git diff -w Relax the policy so that indentation changes which are invisible to git diff --ignore-all-space may accompany functional changes, while still requiring non-whitespace cosmetic changes to be in separate commits. Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
This commit is contained in:
@@ -471,13 +471,18 @@ ask/discuss it on the developer mailing list.
|
||||
|
||||
@subheading Cosmetic changes should be kept in separate patches.
|
||||
We refuse source indentation and other cosmetic changes if they are mixed
|
||||
with functional changes, such commits will be rejected and removed. Every
|
||||
with functional changes, such commits will be rejected and removed. However,
|
||||
indentation changes that can be ignored by @code{git diff --ignore-all-space}
|
||||
(e.g. changes in whitespace amount, leading/trailing spaces) may be mixed with
|
||||
functional changes, since reviewers can use @code{git diff -w} or
|
||||
@code{git log -p --ignore-all-space} to review only the functional parts of
|
||||
the change. Forgejo's pull request interface also provides a
|
||||
``Hide whitespace changes'' option for this purpose. Every
|
||||
developer has his own indentation style, you should not change it. Of course
|
||||
if you (re)write something, you can use your own style, even though we would
|
||||
prefer if the indentation throughout FFmpeg was consistent (Many projects
|
||||
force a given indentation style - we do not.). If you really need to make
|
||||
indentation changes (try to avoid this), separate them strictly from real
|
||||
changes.
|
||||
non-whitespace cosmetic changes, separate them strictly from real changes.
|
||||
|
||||
NOTE: If you had to put if()@{ .. @} over a large (> 5 lines) chunk of code,
|
||||
then either do NOT change the indentation of the inner part within (do not
|
||||
|
||||
Reference in New Issue
Block a user