Posts | Tags | Archive

GitHub: Convert an issue to a pull request

GitHub currently doesn't provide a way to convert an issue to a pull request in their interface. However, the capability exists in their Pull Request API.

Update

I've built a self-hostable webapp called gh-i2p that makes this process easier.

To call the API using a simple curl command, run the command:

1
2
3
4
curl --user "[github username]" \
     --request POST \
     --data '{"issue": "[issue num]", "head": "[branch to merge from]", "base": "[branch to merge into]"}' \
     https://api.github.com/repos/[user]/[repo]/pulls

For example, to make user1 change issue 13 into a pull request to merge branch test_branch into master in the testing_repo repository belonging to user2, the command would be:

1
2
3
4
curl --user 'user1' \
     --request POST \
     --data '{"issue": "13", "head": "test_branch", "base": "master"}' \
     https://api.github.com/repos/user2/testing_repo/pulls

To specify a fork of a repository to merge from, put the username followed by a semicolon in front of the branch name like so: "username:branch_name"

After running the command, you will be prompted for your GitHub password. Enter it and curl should output the JSON response from the API. Make sure to check this response for errors!


Forcing a media refresh on Android with adb

Android will automatically perform a media refresh when an SD card is mounted.

Using adb, we can fake that event by manually sending a MEDIA_MOUNTED intent.

For example, if you wanted to run a media refresh of the entire SD card:

1
adb -d shell "am broadcast -a android.intent.action.MEDIA_MOUNTED -d file:///sdcard"

To refresh different directory, just change "/sdcard" to the absolute path of the directory you want to refresh.

For more fine-grained control, use the MEDIA_SCANNER_SCAN_FILE intent, which triggers a rescan of a single file.


Installing Fehlstart - A simple, quick application launcher

Fehlstart is an application launcher, much like Launchy, Quicksilver, or GNOME Do. However, where other launchers focus on adding features, Fehlstart is as basic as they come. If you want to search for files or control your media player, look elsewhere. Felhstart launches applications. Period.

Fehlstart isn't in any major repositories so it has to be compiled from source.

  1. Install dependencies
    • git, gcc, make, libgtk2.0-dev, libkeybinder-dev
    • On most systems these packages will be available through your package manager
  2. Get the code
    • git clone https://gitlab.com/fehlstart/fehlstart.git
  3. Compile and install
    • Navigate into the folder containing the code
    • Run make
    • Run make install (with the needed permissions)
  4. Add fehlstart to your window manager's autostart list
  5. Log out and back in to launch Fehlstart.
  6. Press the key combination <Super> + <Space> to bring up the launcher
  7. Type to search through the installed applications, then press <Enter> to launch.

© Carey Metcalfe. Built using Pelican. Theme is subtle by Carey Metcalfe. Based on svbhack by Giulio Fidente.