emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: whitespace-only changes


From: Daniel Martín
Subject: Re: whitespace-only changes
Date: Thu, 20 Aug 2020 22:50:17 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (darwin)

Richard Stallman <rms@gnu.org> writes:

> [[[ To any NSA and FBI agents reading my email: please consider    ]]]
> [[[ whether defending the US Constitution against all enemies,     ]]]
> [[[ foreign or domestic, requires you to follow Snowden's example. ]]]
>
> Larsi wrote:
>
>   > Thanks for the patch, but we don't normally apply whitespace-only fixes,
>   > because that makes it harder to investigate, later (with git blame and
>   > friends), what previous code changes did.
>
> I am sure he knows what he's talking about, but it is unfortunate that
> we cannot fix bad indentation.  Can't we correct this problem somehow?
>
> For instance, label whitespace changes clearly in the commit log, and
> change some tools to ignore them?

Git 2.23 introduced a feature to make git blame ignore these kind of
commits that only contain refactoring changes. The steps to make it work
are as follows:

First, add a .git-blame-ignore-revs to the root of the repository. This
file should contain the list of commit hashes to ignore (one per line).

Then, each developer should configure their local environment to take
the .git-blame-ignore-revs file into account by running the following
command from a shell:

$ git config blame.ignoreRevsFile .git-blame-ignore-revs

It's not an ideal solution, though. It depends on having a recent
version of git installed, only works for git blame, and it won't work if
someone is using https://git.savannah.gnu.org to check the history of
code changes, for example.

--
Daniel Martín


reply via email to

[Prev in Thread] Current Thread [Next in Thread]