Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors when splitting multi-lines commit messages #2

Open
julienbeisel opened this issue Jan 13, 2022 · 5 comments
Open

Errors when splitting multi-lines commit messages #2

julienbeisel opened this issue Jan 13, 2022 · 5 comments

Comments

@julienbeisel
Copy link

julienbeisel commented Jan 13, 2022

I tried to display multi-lines commit messages (by only taking the first line into account).

The line below does not work properly:

msg = commit.message.partition('\n')[0]

I think that every escape characters are not recognized and it results in an unstable result that breaks my markdown formatting.

The way to fix it is to use splitlines()

msg = commit.message.splitlines()[0]

I chose to display the first line, but it can also be possible to insert other lines with a regex or a join() on the array :

msg = "<br />".join(commit.message.splitlines())

@pawelsikora
Copy link
Owner

Hmm nice catch.

We can do both single/multi line, the question is why(do we/others need multiline really?)
I would rather see the benefit of providing short sha with link do repo to view the full commit than to provide in the table more than one line (topic) - simply to make it clear and simple.

@julienbeisel
Copy link
Author

In my case some users have a commits that contain multi lines messages, so I need to handle that case (the current version is buggy and totally breaks the formating).

sha can be an option. I think it could be great to pass parameters in the config file to set the headers.

For example

columns-to-display : ['author', 'message']
columns-to-display : ['date', 'author', 'sha']

@julienbeisel
Copy link
Author

I can do a PR for that if you want.

Currently I host a fork of this project in a private Pypi but I would be happy to contribute :)

@pawelsikora
Copy link
Owner

@julienbeisel
And I would be happy to have you as contributor, so just make a PR :)

@pawelsikora
Copy link
Owner

@julienbeisel multiline comments are naturall, this is not something I was talking about :)

We can do it, if you need it.

In case of parameters probably better to parse and for easy of use would be rather:

layout:

  • default: true/false
  • custom:
    • author: true/false
    • date: true/false
    • commit_sha: true/false
      • repo_url: ...

Would you mind to have a talk about some things via email? You can find mine in my profile.

Regards,
Pawel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants