Invisible git meta commit

I have a question, the reasons for this described in the story. In the interest of respect for the reader’s time, part of the story may be skipped. :)

Short: Is there a way to check for changes to the git repository, but “hide” the change set metadata from general consumption (does the previous set of changes keep the fault, etc.)?

Long (feel free to skip the rest): I recently inherited a code base that, in appearance, had an initial team that encouraged each of its developers - as an exercise in spiritual growth - to mine the world and find the formatting style with which it felt the most zen-like ... they really find their various art styles, apply them to code formatting and live the artist’s life when you draw code masterpieces every day. Patterns appeared, such as randomly selecting the number of newline lines between statements, transferring each argument of the method - declarations and calls ... It continues and continues, but basically I want to configure my formatting settings in the IDE, turn it off for several hours, clear places by which he was bewildered, and commit it. I get some (valid) pushback from the command about losing the whole story in the easily visible word "last, affected", which is displayed in annotations, etc. Is there a way to make changes that don't delete them? I also thought that there could be a branching trick that could do something like a branch, format in a branch, reintegrate another branch into this one, somehow making my "secret commit" up-rev last, which will keep the old one.

Anyone have any suggestions? I am absolutely ready to entertain hacks for this one-time. :)

+4
source share
2 answers

Short: None.

Long: To move on to a consistent style, ask your fellow developers to change the code to fit your overall style when they work on it. Thus, the attribution of guilt remains unchanged for code that has not been modified. For the modified code, the fault attribute is then transferred to the developer who last touched it. You can do this in more detail, for example, clear formatting by function if you want.

+5
source

What you ask for here violates the "spirit" of Git (due to the lack of a better term).

Git takes its story very seriously. This was the goal of the system design that was once published, commits could not be changed without any comment. You can see the impact of this design decision on how Git works. For example, committing messages cannot be easily changed and is almost impossible to change after clicking.

In other words, silent or hidden things in the Git repository will not work.

+2
source

Source: https://habr.com/ru/post/1401521/


All Articles