Contributing to KDE is easier than you think – Phabricator patches using the web interface

栏目: IT技术 · 发布时间: 4年前

内容简介:Heya! This post will be ridiculously brief and simple, albeit filled with screenshots.As usual: This is a series of blog posts explaining different ways to contribute to KDE in an easy-to-digest manner.The purpose of this series originated from how I feel

Heya! This post will be ridiculously brief and simple, albeit filled with screenshots.

As usual: This is a series of blog posts explaining different ways to contribute to KDE in an easy-to-digest manner.

The purpose of this series originated from how I feel about asking users to contribute back to KDE. I firmly believe that showing users how contributing is easier than they think is more effective than simply calling them out and directing them to the correct resources; especially if, like me, said user suffers from anxiety or does not believe they are up to the task, in spite of their desire to help back.

Last time I explained how translators with a developer account have a really straightforward workflow and how the entire localization process for KDE works . I’ve also posted a little article I made some time ago on how to create a live-test environment to translate Scribus more easily , given that Scribus might become a KDE application in the future.

This post explains the process of sending your first patch to KDE. This tutorial, of course, is only useful for small patches, likely those which alter only one file, as the web interface is convenient for such cases but not when there is a ton of files from the same project.

I recently learned how to do this, so I really got excited to write a tutorial about it. However, it’s not worth adding it to the wiki as of now since the KDE infrastructure is being migrated to Gitlab . So instead I’m writing this blog post. Seriously, it’s so ridiculously easy that I honestly believe if this had been promoted before there would be many more patches coming from people who are still in the process of getting used to the terminal. Or those who simply prefer using a GUI, like me.

For more information about sending patches, please refer to https://community.kde.org/Get_Involved/development and https://community.kde.org/Infrastructure/Phabricator .

Creating your patch

First of all, I decided what I wanted to change. If you check https://phabricator.kde.org/T12810 , you’ll see the only change I’ll be doing to the selected projects is switching the contents of the GenericName field. That is, I’ll be changing a single line of code in one file of each project. I’ll start with GCompris .

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 1 – Finding out what to change.

GCompris is not yet on KDE Invent. So, for downloading the project, I’m going to git clone it from cgit.kde.org . While the interface is not the best, it serves its purpose and it’s lightweight.

On cgit.kde.org, I press Ctrl+F to find the project’s repository. It’s available here .

We’ll need to copy the link portrayed on the screenshot, it’s in the bottom left corner of the page. You can either select it or right-click and copy its address.

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 2 – Getting the repository address for cloning.

Next we’ll be using a terminal command. Don’t worry, it’s easy to follow and it’s minimal too. For this I like using Yakuake , sometimes I use Konsole , but for this tutorial, I’ll be using Dolphin to keep it more GUI-friendly.

Open a Dolphin window and press F4 to open its terminal. It should open on your home directory, so you can download the repository there, but with Dolphin you can simply navigate to the folder you want and clone the repository, for instance, inside ~/Documents/Patches .

Please install git if you don’t yet have it on your system. This is the only thing you’ll need to install.

After selecting the desired folder and pressing F4, download the repository using git using the previously copied link. It will look similar to the command git clone git://anongit.kde.org/gcompris.git :

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 3 – Cloning from Dolphin.

The above screenshot is only for illustration purposes, I cloned mine inside my home ( ~/ ) folder.

After that, you should have something like the following screenshot.

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 4 – Repository downloaded.

Open the desired file with e.g. Kate and make the desired change. In my case, I need to change org.kde.gcompris.desktop :

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 5 – Changing the desired files.

Don’t forget to save your changes. Now back to Dolphin, go back to its terminal and type git diff . Yes, the same tool we used for downloading the repository we use to create the patch! Git is really the only requirement for this tutorial. You should have something like this:

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 6 – Checking the diff.
Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 7 – Diff output.

The original text which was removed is shown in red and prefixed with a minus, the text added in its stead is shown in green and prefixed with a plus. Just be sure the changes you did are correctly depicted in green.

For the patch, as we will see later, you can simply copy what shows up in your terminal. But another way to do that is by creating a file and sending its contents instead. If you want to create a file, use git diff > filename.diff . I used the extension .diff , but it doesn’t really matter; you can name it .txt or .patch , for instance. For checking if everything is alright, you can then open it by right-clicking the file and opening it with Kate, or you can run kate gcompris.diff as shown below.

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 8 – Creating a diff file to send as a patch.

Sending your patch

Let’s now go to Phabricator. Before submitting a patch, you’ll need a KDE Identity account . You don’t need to have a developer account. With a KDE Identity, you can login to Phabricator which is located on phabricator.kde.org .

After logging into Phabricator, click on Code Review on the upper left corner of the page.

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 9 – Code Review location.

On the next window, click on Create Diff on the upper right corner.

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 10 – Create Diff location.

On the next window, if you want to send the diff file, click on the Browse... button next to Raw Diff From File and select the file.

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 11 – Create Diff window with already selected file.

If you don’t want to send a file but instead you just want to paste the diff itself, you can do so on the Raw Diff section. Just remember: choose ONE of those two methods. Don’t send the diff through both methods .

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 12 – Create Diff window with diff content.

I’ll repeat: choose ONE of those two methods. Don’t send the diff through both methods .

Also important: Don’t forget to add the correct repository name . In my case, it was this one:

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 13 – How it looks like after selecting the correct repository.

On the next window, simply accept the default for creating a new revision, confirm and go to the next window. It will look similarly to the following:

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 14 – Create Revision window (for desktop readers).

For the users following this tutorial from their mobile, here’s a better framed screenshot:

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 15 – Create Revision window (for mobile readers).

Fill each field accordingly. Add a descriptive title and a short summary explaining what the patch does, and in the reviewers, repository, tags and subscribers sections, add the correct project. Just by typing the program name Phabricator should suggest the correct project for you, just click on the one you think is right. Again, in my case, it was GCompris.

After filling the fields correctly, click on Create New Revision.

And done! Your patch will look similar to this:

Contributing to KDE is easier than you think – Phabricator patches using the web interface
Figure 16 – Patch sent!

That’s it for sending your first patch through the web interface of Phabricator. If your patch has any issues, those should be pointed out during the review stage by the more experienced contributors responsible for the project.

The most important thing that should be done is getting in touch with the community. If you want to know more about contributing, please read this very clear wiki page on Getting Involved . There’s Matrix , Telegram and IRC for instant messaging.


以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Big Java Late Objects

Big Java Late Objects

Horstmann, Cay S. / 2012-2 / 896.00元

The introductory programming course is difficult. Many students fail to succeed or have trouble in the course because they don't understand the material and do not practice programming sufficiently. ......一起来看看 《Big Java Late Objects》 这本书的介绍吧!

HTML 压缩/解压工具
HTML 压缩/解压工具

在线压缩/解压 HTML 代码

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试