Added an option to choose if commit message is prettified or not#619
Added an option to choose if commit message is prettified or not#619nulltoken merged 1 commit intolibgit2:vNextfrom
Conversation
There was a problem hiding this comment.
I think any rewrite should be explicitly done by the user. I'm not all that familiar with this code, but it looks like the user gets to return the whole set, in which case they should run the text through the prettify function if they want to (e.g. the equivalent of the 'reword' option in git-rebase--interactive would likely want to do this, as the user was asked for input), but we shouldn't change the data the user told us to put into the commit.
There was a problem hiding this comment.
I'll create another issue to specifically deal with this.
There was a problem hiding this comment.
we shouldn't change the data the user told us to put into the commit.
This
|
@nulltoken, This is the behavior of the original version, without this a lot of unit tests fail. |
LibGit2Sharp/ObjectDatabase.cs
Outdated
There was a problem hiding this comment.
converts crlf to lf
Beside this, this function does a little more than that:
- Remove empty lines from the beginning and end
- Remove trailing spaces from every line.
- Turn multiple consecutive empty lines between paragraphs into just one empty line.
- Ensure the commit message ends with a newline
- Remove every line starting with "#".
How about removing the (convert crlf to lf) part from the param description and adding a <para>...</para> describing this under the <summary/> function xml doc node?
|
@nulltoken, I updated the commit amibar@146ba84 |
LibGit2Sharp/ObjectDatabase.cs
Outdated
There was a problem hiding this comment.
I think this whole <para/> section should be moved under the <summary/> one so that it reads like
/// <summary>
/// Inserts a <see cref="Commit"/> into the object database, referencing an existing <see cref="Tree"/>.
/// <para>
/// Prettifying the message includes:
/// * Removing empty lines from the beginning and end.
/// * Removing trailing spaces from every line.
/// * Turning multiple consecutive empty lines between paragraphs into just one empty line.
/// * Ensuring the commit message ends with a newline.
/// * Removing every line starting with "#".
/// </para>
/// </summary>
|
Fixed the para |
|
👍 For me. Anyone else willing to chime in? |
|
No objection here |
|
@amibar Could you please rebase this on the latest vNext? |
|
@nulltoken, done |
LibGit2Sharp/ObjectDatabase.cs
Outdated
There was a problem hiding this comment.
Duh. I overlooked this. Sorry. Could you please add a message to the attribute in order to redirect the user to the proper overload to use?
eg.
[Obsolete("This method will be removed in the next release. Please use CreateCommit(Signature, Signature, string, bool, Tree, IEnumerable<Commit>) instead.")]
Prettifing the message includes: * Removing empty lines from the beginning and end. * Removing trailing spaces from every line. * Turning multiple consecutive empty lines between paragraphs into just one empty line. * Ensuring the commit message ends with a newline. * Removing every line starting with "#". Note that this has nothing to do with the core.autocrlf option.
|
@nulltoken, updated [obsolete] message |
|
...and merged! @amibar Very nice job here! Thanks a lot 👍 |
This solves issue #611