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

Display the original commit message when mirroring #710

Closed
minwoox opened this issue Aug 16, 2022 · 6 comments
Closed

Display the original commit message when mirroring #710

minwoox opened this issue Aug 16, 2022 · 6 comments
Milestone

Comments

@minwoox
Copy link
Member

minwoox commented Aug 16, 2022

Currently, the commit message of a commit that is pushed by the mirroring task looks like this:

Mirror fbee605, git+ssh://github.com/xxx.git#master to the repository 'foo'

It does not contain the original commit message which is useful to users. It would be nice if we can display the original commit message.
We can retrieve the message via:

Iterable<RevCommit> call = git.log().setMaxCount(1).call();
@minwoox
Copy link
Member Author

minwoox commented Aug 16, 2022

We might display the message using the detail field.
However, the current UI does not display it so we should revamp the UI beforehand.

@ikhoon ikhoon added this to the revamp-webapp milestone Oct 18, 2022
@trustin
Copy link
Member

trustin commented Feb 14, 2023

There might be more than 1 commit involved in a mirroring attempt. Should we show every commit message (up to N commits)?

@minwoox
Copy link
Member Author

minwoox commented Feb 14, 2023

Should we show every commit message (up to N commits)?

That's a good idea.

@trustin
Copy link
Member

trustin commented Mar 2, 2023

At second thought, we probably should show the latest one only, given we're going to use shallow clone and shallow fetch (see #801).

@thachlp
Copy link
Member

thachlp commented Mar 7, 2023

From my understanding, here is the pr: #818
Please help review 🤗

trustin pushed a commit that referenced this issue Apr 10, 2023
Related: #710

Motivation:
Currently, we construct commit messages while mirroring by:
> "Mirror " + abbrId + ", " + remoteRepoUri() + '#' + remoteBranch()+  " to the repository '" + localRepo().name()

So, we would like to use the original message which is useful for users. 

Modifications:
1. Get a commit message from RevWalk:
> RevCommit commit = revWalk.parseCommit(objectIdOfCommit);
2. Generate a detail message including: author's name, email, time, and message. 

Result:
We display the original commit instead while mirroring.
@trustin
Copy link
Member

trustin commented Apr 17, 2023

Closed via #818 Thanks, @thachlp!

@trustin trustin closed this as completed Apr 17, 2023
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

4 participants