emacs for submodule of installed package that hosted on github - emacs

I have installed emacs on several computers, and to sync the configurations between them, i setup a github repo that stores my emacs configurations, i.e., my folder ~/.emacs.d
now, i started to use emacs on one computer, i installed certain package, lets say, package_foo, using MELPA. Now there is a folder called package_foo in my .emacs.d/elpa foder. i also found the package_foo actually is actually hosted on github. it would be great if i can submodule it because my .emacs.d is on github as well.
so if package_foo i installed by emacs package manager is on github, how can i submodule it automatically instead of copy it to my .emacs.d/elpa folder? Is there an emacs plugin that knows the source of package_foo, and submodule it for installation (if possible) instead of pulling all files? That can not only save space on github, but also save my bandwidth when syncing.

Don't use submodules for packages. Don't commit packages to your repository.
Instead, configure Emacs to automatically install missing packages for you. You can either use some special function for this purpose:
(defun package-required (package) (unless (package-installed-p package) (package-install package))
(package-required 'magit)
Or you can use Carton to manage your packages by declaring them in a Carton file. Then you can use the shell commands carton install to install missing packages, and carton update to update all packages.

Related

Can a specific file from a specific github repo tree be installed with pip?

I need to install tensorflow_backend.py from a specific tree in keras, ideally without updating the other keras files. This shows how to install a specific repo branch, but how can the same be done for this single file in a tree?
No. pip installs Python packages. You need a different tool to download just one file. For a remote git repository git archive is a good tool. For a remote web interface use curl or wget.

How to use git master of gst-omx (gstreamer1) for the buildroot package?

I'm testing the current buildroot 2016.02-rc2 release. It contains gstreamer1 packages for version 1.6.3, but I would like to build 1.7.2 instead. I successfully updated package definitions for gstreamer1 and the most important plugins to use 1.7.2. However gst-omx has only a 19 months old release archive for the version 1.2.0 for the direct download (https://gstreamer.freedesktop.org/src/gst-omx/) and it fails to compile. So I would like to use the latest version from git repo.
How can I do it? git repository contains a "common" submodule which buildroot's build system cannot handle as it seems. I thought about creating a new release tar.xz package, that would contain everything for building it like all other gstreamer packages, but couldn't find out how those tar.xz packages on the server are generated...
There is indeed no support for submodule in Buildroot, since most of the time, submodules should be packaged as separate packages.
So, for your own testing, you have two options:
1/ You can do a quick test by creating yourself a tarball that contains all the gst-omx source code (including the contents of the common/) subdirectory.
2/ You can package the gstreamer common stuff as a separate package, make your gst-omx package depend on it, and in a pre-configure hook, create a symlink $(#D)/common -> $(GSTREAMER_COMMON_DIR)

I use Emacs with Prelude and want to re/write git-autocommit-mode

Where inside .emacs.d should I put the source code? How should I publish my changes? This is my first attempt at writing an Emacs mode. What are the current commendations?
proggress
I'm not sure if I did it properly but I have added following to my
~/.emacs.d/personal/personal.el
(add-to-list 'load-path "~/emacs.d/vendor")
(require 'git-auto-commit-mode)
then I did 'git clone myrepo' in the vendor directory.
I haven't used Prelude myself, but it's got an
init.el,
which is probably where you should put a statement to load your code.
But if you're really at the point where you want to write your own
code, I'd recommend to either dump Prelude in favor of rolling your
own config, or completely understand how Prelude works and build on
top of that. Anything in the middle will result in much confusion.
Here's how I'd go about changing git-autocommit-mode:
visit melpa.org to lookup the source: https://github.com/ryuslash/git-auto-commit-mode
fork the source on github
clone the repo I just forked:
git clone https://github.com/abo-abo/git-auto-commit-mode.git
uninstall git-auto-commit-mode via package.el
install use-package
use this code to load your own git-auto-commit-mode:
(use-package git-auto-commit-mode
:load-path "~/git/git-auto-commit-mode")
if you make changes that you think are useful, open a pull request
on github to merge in your changes into the source repo

GitHub: uploading existing libraries

Should I re-upload an existing library to my GitHub repo if my code uses it? Or should I only reference the library?
I have some Python programs that use the Yowsup library, which is already on GitHub. Should I upload my copy of this library with my code in order to make my code easier to understand, or should I just tell people to download Yowsup from its own GitHub page?
Thanks!
Maintain your dependencies using a dependency manager.
For Python code, this usually means using pip to maintain a requirements file:
pip install yowsup
pip freeze > requirements.txt
Commit the requirements.txt file to your repository. Don't commit the yowsup code itself.
Now other users can clone your repository and install all of your project's dependencies using
pip install -r requirements.txt
Generally you will want to do this inside a virtual environment, which in the Python world generally means using virtualenv (and optionally virtualenvwrapper).
Many other languages have similar tools, so you can apply the same general technique.

Automatic NuGet Copy or Mirror upon package install (push to private repo)

Probelm
I want to set-up the no commit workflow for NuGet. But in order to do so, I need to make sure I have copies of any 3rd party packages and there dependencies installed from nuget.org copied to our private repo.
NuGet Mirror
I've looked into the NuGet mirror command, but this looks to be a manual process.
https://docs.nuget.org/docs/reference/command-line-reference#Mirror_Command
NuGet Copy
I also looked into NuGet copy, but could A) not get it to work and B) it still looks like a manual process.
https://www.nuget.org/packages/nuget.copy.extension/1.2.0
Is there any solutions to do this automatically upon package install? I can't force the developers to remember to manually copy the packages after they install them. When the developer installs a package, I want it to be copied over to our private NuGet repo. Please lead me in the right direction.
I'm not aware of any built-in NuGet feature to do this, but here's a simple way to make sure all packages are synced to a shared repository.
NuGet saves all downloaded packages to C:\Users\username\AppData\Local\NuGet\Cache
Just install sync software like BitTorrent Sync on each developer PC and the shared repo server. BTSync will automatically synchronize any new packages to the shared repo as well as all other devs.