Skip to content

Instantly share code, notes, and snippets.

View PeloNZ's full-sized avatar

Chris Wharton PeloNZ

View GitHub Profile
@PeloNZ
PeloNZ / git-submodule-sync.rb
Created January 19, 2016 11:18 — forked from frimik/git-submodule-sync.rb
Make damn sure that git submodule sync is going to work.
#! /usr/bin/env ruby
submods = Hash.new
%x{git config -f .gitmodules --get-regexp '^submodule\..*\.(path|url)$'}.lines.each do |l|
submodule, key, value = l.match(/^submodule\.(.*)\.(path|url)\s+(.*)$/)[1..3]
submods[submodule] = Hash.new unless submods[submodule].is_a?(Hash)
submods[submodule][key] = value
end
@PeloNZ
PeloNZ / gist:5931194
Last active December 19, 2015 09:09 — forked from arnorhs/gist:1517095
#!/bin/bash
# This script will open all files from a git diff or a git show in vim.
# My bash skills are a bit primitive so this can probably be done more intelligently
# Usage:
# gitopen -- opens all added files that have changed since HEAD
# gitopen diff HEAD -- these are the default parameters
# gitopen diff master -- opens files that have changed from master