Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Mirror answers on the Git mailing list to the corresponding PRs#72

Merged
dscho merged 22 commits intogitgitgadget:mastergitgitgadget/gitgitgadget:masterfrom
dscho:mirror-replies-to-prsdscho/gitgitgadget:mirror-replies-to-prsCopy head branch name to clipboard
Apr 14, 2019
Merged

Mirror answers on the Git mailing list to the corresponding PRs#72
dscho merged 22 commits intogitgitgadget:mastergitgitgadget/gitgitgadget:masterfrom
dscho:mirror-replies-to-prsdscho/gitgitgadget:mirror-replies-to-prsCopy head branch name to clipboard

Conversation

@dscho
Copy link
Member

@dscho dscho commented Jan 25, 2019

So far, GitGitGadget has been a one-way street: commits pushed to GitGitGadgets' Git fork could be sent to the Git mailing list, but the communication about the patches had to happen there, completely.

With this PR, the answers on the Git mailing list get added as PR comments.

While the format is far from perfect (the emails are rendered in a rather ugly way, non-ASCII senders are not displayed properly, for replies to individual patches, there is no obvious link to the respective commit, etc), it is a start.

This can be seen in action at gitgitgadget/git#31 (comment)

@dscho
Copy link
Member Author

dscho commented Jan 25, 2019

@jeffhostetler the code in this PR generated gitgitgadget/git#108 (comment) (if you wondered about that).

@dscho
Copy link
Member Author

dscho commented Jan 27, 2019

@jeffhostetler I know you're not necessarily familiar with the GitGitGadget code base, but maybe you could give this PR a look-over?

kewillford
kewillford previously approved these changes Mar 14, 2019
Copy link

@kewillford kewillford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would take this approval with a grain of salt considering

  1. I'm not that familiar with typescript
  2. I'm not that familiar with gitgitgadget
  3. I'm not that familiar with the format of git mail messages

But it looks like it works and is organized.
I was wondering if there are any tests for gitgitgadget because there is a lot of parsing going on and tests would really help validate it.

dscho added 6 commits April 12, 2019 15:42
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In preparation for upgrading ts-jest, fix a couple of issues where
possibly undefined values really need to be verified *not* to be
undefined, and avoid unused variables, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Suggested by `npm audit`.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This comes in *real* handy for debugging and developing.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is nice and dandy if the commit-to-mail and mail-to-commit notes are
reliable, but when they are not (and they seem not to, for some reason
there was an uptick of unmatched commits recently), it becomes less nice
and less dandy.

In preparation for spending a bit more effort to identify upstream
commits, allow specifying the upstream commit explicitly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the mirror-replies-to-prs branch 2 times, most recently from 09fde46 to 2552d43 Compare April 12, 2019 22:21
dscho added 14 commits April 13, 2019 00:29
The `git range-diff` command already has code to identify upstream
commits. Since we expect those to be in `pu`, we have a *relatively*
limited set of commits to choose from, therefore we can make use of the
`range-diff` command.

This should make the detection quite a bit more robust.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We just spent a lot of time trying to make sure that we find the
upstream commits corresponding to the PRs' original commits. Let's use
that information, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This offers a much more robust (and much slower) way to detect which
upstream commits correspond to the original commits in the PRs.

That robustness is needed, though, as there are quite a few open PRs
that do not have the correct labels because no upstream branch is
associated with them, even if those branches exist in many cases.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
... because they hurt the reading flow.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It declares its fields as readonly, we need them mutable (see the
next commits).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
In the next commit, we will add some optional stdout processing that
won't work inside an async function because it needs access to the
`reject()` function of the returned Promise.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
With this option, we allow callers to specify a callback that handles
every line of the input individually.

This will come in handy when we will start processing the output of
`git log -p` in public-inbox/git, as we will be able to handle each
commit individually, together with its diff, from which we can extract
the corresponding mbox.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
We will introduce more of the same kind shortly, needing the ID of the
generated comment, so it makes sense to have all of them consistent.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is a bit tricky because GitHub wants a path and a position, too.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is super easy ;-)

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It really is a number, not a string.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
It is all nice and dandy to submit patch series from PRs, but you cannot
really see the reviewers' comments in the PRs, making the entire
exercise a little less fun.

Let's do something about it.

This new class only helps with processing the mails, but it is not
hooked up with any command-line interface yet, and it also does not
store the state correctly yet, e.g. "what was the latest mail we
processed?" (to allow for efficient incremental processing).

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
This is what will be used in an Azure Pipeline to mirror the mails to
the PRs.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho force-pushed the mirror-replies-to-prs branch from 2552d43 to 6697549 Compare April 12, 2019 22:39
It is true, if we treat the `gitOpts` variable strictly as
`IGitOptions`, then it does not have an `env` field...

Let's play it a bit loose by simply not stating what interface it should
implement explicity, but use it as such implicitly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
Copy link
Member Author

dscho commented Apr 14, 2019

I was wondering if there are any tests for gitgitgadget because there is a lot of parsing going on and tests would really help validate it.

Indeed, it gives a bit more confidence to have tests covering this functionality.

The part that I think is the only part that is testable, though, is the parsing of the mbox file (which is already tested). The more important part is where the code actually acts on mails sent to the mailing list, which I think is not really testable, not unless I mock quite a bit of stuff into the code... which would cost me a lot of time, and might actually be buggy in and of itself? So I'll try to be lazy here ;-)

Thank you for the review!

@dscho dscho merged commit e3d3929 into gitgitgadget:master Apr 14, 2019
@dscho dscho deleted the mirror-replies-to-prs branch April 14, 2019 19:24
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

Successfully merging this pull request may close these issues.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.