Git Product home page Git Product logo

Comments (12)

velo avatar velo commented on May 25, 2024

+1

I think we should format all git history as well... to prevent huge diffs caused only by format

But needs #27 first

from formatter-maven-plugin.

ctubbsii avatar ctubbsii commented on May 25, 2024

Re: "I think we should format all git history as well"

Please don't rewrite the history with formatting changes. That would be... very anti-git, and would confuse any attempt to merge existing outstanding work.

A huge diff is perhaps a bit annoying, but it's much more friendly than the alternative.

from formatter-maven-plugin.

velo avatar velo commented on May 25, 2024

The problem I see with the huge diff is that it kills history....

When you need/wanna understand why a change was introduced you wont get the information (at least not in a easy way)

from formatter-maven-plugin.

ctubbsii avatar ctubbsii commented on May 25, 2024

Understood, but rewriting history is not the answer. A commit which only changes formatting, and introduces no other change, is preferable. It's unfortunate that in some cases, it may make history harder to understand, but the effect is localized, limited in scope and in time. I've used this formatter plugin to reformat other projects in a single commit, and it has rarely been disruptive to the point where history could not be understood. This risk is minimal, and far preferred over the side-effect problems of rewriting history. That's my opinion, anyway.

from formatter-maven-plugin.

velo avatar velo commented on May 25, 2024

I wonder, what is the rewriting history side-effect?

I ask cause I'm about to do it for the ninth time =D

from formatter-maven-plugin.

ctubbsii avatar ctubbsii commented on May 25, 2024

The main problem is that you can't tell if a branch has already been merged, and it makes it difficult to merge cleanly back into a clone. It creates new history, which separates clones from each other, and makes it difficult to see their common ancestor (fork point). When merging, it can reintroduce the same commits, resulting in duplicates.

If you, and everybody who collaborates with you always use rebase, it's not that bad, but it can confuse rebase because of the difficulty of finding the merge-base.

It also breaks any links directly to a commit, and disassociates the tag history from the branch history.

from formatter-maven-plugin.

ctubbsii avatar ctubbsii commented on May 25, 2024

It's less important if you do it in your own clone/repos, but if you do it in a repository shared by or used by others, it is quite terrible.

from formatter-maven-plugin.

velo avatar velo commented on May 25, 2024

I see

from formatter-maven-plugin.

velo avatar velo commented on May 25, 2024

what is our default code formatter?
https://github.com/revelc/formatter-maven-plugin/blob/master/src/test/resources/sample-config.xml ?

or something else?

from formatter-maven-plugin.

velo avatar velo commented on May 25, 2024

Made a PR for it.

For start, is just eclipse vanilla formatter

Do you guys agree on that?

#65

from formatter-maven-plugin.

velo avatar velo commented on May 25, 2024

Also, made another PR regarding pom.xml format/order

https://github.com/revelc/formatter-maven-plugin/pull/66/files

from formatter-maven-plugin.

velo avatar velo commented on May 25, 2024

Fixed

from formatter-maven-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.