Should be noted, it is often tempting to describe everything about the change in the commit description rather than comments in the code. Remember, git commits disappear from sight pretty soon and become fossils, whereas there may be something important that should be said in the code itself.
What a good commit message looks like (2011)
81–90 of 100 posts
Re: What a good commit message looks like (2011)
#82Earlier quoted context omitted.
> I'm not sure why this matters much? Because wrapped code is generally nonsensical. > If the code doesn't fit on the screen you're viewing it on, then it's not going to be convenient to read Inconvenient is one thing, nonsensical is an other. > When would you have an indented line that shouldn't be wrap-indented? That's noted right after, in the parens: list items. This is not correct wrapping for a list item: * thi…
>Because wrapped code is generally nonsensical. Not really? It's probably slightly more awkward to read than scrolling, but then, the solution is to read code on an appropriately sized screen in the first place. And incidentally, truncated code definitely is nonsensical. >List items. They can be handled as you mention, but it's hardly the worst thing in the world if they're not. And if you really care about formattin…
Re: What a good commit message looks like (2011)
#83Earlier quoted context omitted.
Markdown renderers seem perfectly capable of this. git wouldn't even need to disambiguate asterisk for lists vs. asterisk for emphasis.
So every piece of software now needs a markdown renderer?
This does not mean that the format needs to be Markdown (which includes embedded HTML, so obviously not Markdown), or that all software needs a Markdown renderer. I'm not sure why you'd conclude that.
Re: What a good commit message looks like (2011)
#84Earlier quoted context omitted.
Is there not precedent for handling that correctly in a plain text field?
Which, in the case of HN and other pages, can either break the formatting of the entire page by pushing the right margin beyond the window, or artificially constrained windows which you need to scroll sideways on. Text layout is a hard problem. It's why TEX (and its derivatives) is still so damned useful (and complicated).
Don't wrap lines with a four-space prefix (or whatever format is decided), wrap lines without one. Allow users to disable the wrapping if they prefer wrapped code. The prefix can be stripped at display time if you wish, so that code is left-aligned - actually, since the formatting isn't encoded in the log, only the semantics, users can configure the display as they please.
Possible handle lines beginning with - as lists and indent them correctly. If a message somehow breaks the format, do not accept it. This isn't TeX-level complexity.
Re: What a good commit message looks like (2011)
#85Earlier quoted context omitted.
m-X auto-fill-mode. You can add this to other modes automatically. I almost always have it on. Added to Emacs in 1977.
auto-fill mode doesn't reflow paragraphs at will, it just inserts a line break when you go over the limit. For instance, if you're editing a document and write a long sentence, that spreads over 3-4 lines. You then take a scalpel to it to make it more concise, so that it fits on a line or 2. Emacs won't reflow it automatically, you can manually get it to reflow (M-q by default), but its not the behaviors you expect f…
Vim also has an auto-format feature, which can be enabled with `:set formatoptions+=a` and will make paragraph editing behave a bit more like, say, a word processing program, but the Vim help file cautions that formatting long paragraphs or paragraphs with complicated indentation can get slow. I haven't really used the auto-format feature myself, so I can't comment on how slow it actually seems to be in practice.
Re: What a good commit message looks like (2011)
#86In regards to commit ethos, I'm not sure I agree with all of the statements made. To me, something simple/concise, that others will understand, but not lacking in key info, is much better than several paragraphs explaining the same thing.
Re: What a good commit message looks like (2011)
#87Earlier quoted context omitted.
More importantly, the correct way is the way that is currently being used . If the project uses past tense, use it. If you want to change the convention, that's okay too, but everyone has to change. It's exactly the same issue as coding style. If you can look at code or commit messages and figure out who wrote it based purely on style/formatting, you're doing it wrong (or rather: the person using the inconsistent sty…
Tenses in commit messages seem a bit pedantic and inconsequential. It doesn't really affect much. Unlike tabs vs. spaces, where mixing would cause a mess.
Re: What a good commit message looks like (2011)
#88Earlier quoted context omitted.
OPs point remains. It's git's job to tell me its limitations. Not my job to adapt my tools to it. When practical, of course. In this case, git could simply give a "are you sure you want to commit with these long lines?" warning.
Git copes just fine with long commit messages. Providing the rest of your team is happy with it and your tools can display it ok, just do it.
Re: What a good commit message looks like (2011)
#89Earlier quoted context omitted.
yep as telo.. said - whatever will inevitably supercede git. In my own work it was VSS > Perforce > svn > git All of those were good choices when they were new, and suboptimal choices when the next better solution came along.
I had the feeling companies would just stick to their thing. Last I worked with used CVS and always talked about switching to SVN, but never did.
Re: What a good commit message looks like (2011)
#90Earlier quoted context omitted.
>Because wrapped code is generally nonsensical. Not really? It's probably slightly more awkward to read than scrolling, but then, the solution is to read code on an appropriately sized screen in the first place. And incidentally, truncated code definitely is nonsensical. >List items. They can be handled as you mention, but it's hardly the worst thing in the world if they're not. And if you really care about formattin…
> Not really? Yes really. > but then, the solution is to read code on an appropriately sized screen in the first place. That's not a solution to anything. > And incidentally, truncated code definitely is nonsensical. Truncated code is visibly truncated, not nonsensical garbage right next to actual code. > They can be handled as you mention And the software knows what a list item is… how? > it's hardly the worst thing…
I'm not sure what scenario you're imagining where you absolutely have to read code in commit messages on an unreasonably narrow screen, and you can't wait until you have an appropriate machine. But if a scenario occurred where that were important, I'm sure you'd manage to read some wrapped code, it's not that hard.
>Truncated code is visibly truncated
Unless it's not, because there's ` + someExtraStuff` just off the end.
>So you're saying git should embed a markdown renderer and text layout engine?
If you really want pristinely formatted commit messages that badly then yes.