From 44d773ab151d862c7e31ae570fbff45a672c79a4 Mon Sep 17 00:00:00 2001 From: Mitch Tishmack Date: Sun, 19 Mar 2017 12:12:20 -0500 Subject: [PATCH] Get cray specific stuff working with new layout --- git.org | 137 ++++++++++++++++--------------- nix.org | 161 +------------------------------------ cray.org => z9999-cray.org | 14 ++-- 3 files changed, 81 insertions(+), 231 deletions(-) rename cray.org => z9999-cray.org (92%) diff --git a/git.org b/git.org index 4c415e7..47ca88b 100644 --- a/git.org +++ b/git.org @@ -39,66 +39,68 @@ General git configuration split out into sections mostly. #+END_SRC ** alias #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) - [alias] - begin = !git init && git commit --allow-empty -m 'Initial empty commit' - up = !git pull --rebase && git push - wsd = diff --color-words --ignore-space-at-eol --ignore-space-change --ignore-all-space - wd = diff --color-words - fa = fetch --all - ci = commit - cia = commit --all - co = checkout - ds = diff --stat - ba = branch --all - b = branch - st = status --short --branch - s = status --short --branch --untracked-files=no - unstage = reset HEAD - tlog = log --graph --color=always --abbrev-commit --date=relative --pretty=oneline - hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative - slog = log --oneline --decorate - fixup = commit --fixup - squash = commit --squash - ri = rebase --interactive --autosquash - ra = rebase --abort - effit = reset --hard - bn = rev-parse --abbrev-ref HEAD - cp = log --no-merges --cherry --graph --oneline - # What commits differ between branches, note, equivalent commits are omitted. - # Use this with three dot operator aka master...origin/master - cpd = log --no-merges --left-right --graph --cherry-pick --oneline - # Same as ^ only equivalent commits are listed with a = sign. - cmd = log --no-merges --left-right --graph --cherry-mark --oneline - # git update with submodule update - sup = !git pull --rebase && git submodule update --init --recursive - # git clone with submodules - sc = !git clone --recursive $1 - # what files are getting updated a lot descending output - churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort -r | awk 'BEGIN {print "count,file"} {print $1 "," $2}' | egrep -v '^\\s+$' - # help the gc a bit and get a bit more space back for a local clone - trim = !git reflog expire --expire=now --all && git gc --prune=now - # default remote, note depends on the repo having been git cloned - defremote = !git branch -rvv | egrep 'HEAD' | awk '{print $1}' | sed -e 's|/HEAD||g' - # short sha - short = rev-parse --short - # branch commits on lhs compared to rhs, use via g bcs $(g bn) ^other/branch - bcs = log --pretty="%H" --first-parent --no-merges - find-merge = !sh -c "commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 | uniq -f1 -d | sort -n | tail -1 | cut -f2" - show-merge = !sh -c "merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge" - # push branch while setting the upstream to the default remote - pbr = !git push --set-upstream $(git defremote) $(git bn) - p = !sh -c 'git branch ${1:-$(git defremote)}pr$0@$(iso8601 -s) $(git ls-remote -q ${1:-$(git defremote)} | grep refs/pull-requests/$0/from | cut -c1-8)' - # kinda/sorta git pull -r without the git pull nonsense - cleanmerged = !sh -c "git branch --merged | grep -Ev '^(. master|\*)' | xargs -n1 git branch -d" - prune = !sh -c 'git cleanmerged; git fetch -p; git trim' - # My defremote hack depends on $remote/HEAD to point to somewhere - # which it may not if the git repo wasn't cloned - fixhead = !sh -c "rem=${0:-origin} && branch=${1:-master} && git symbolic-ref refs/remotes/$rem/HEAD refs/remotes/$rem/${branch}" - # push branch while setting the upstream to the default remote - pbr = !git push --set-upstream $(git defremote) $(git bn) - p = !sh -c 'git branch ${1:-$(git defremote)}pr$0@$(iso8601 -s) $(git ls-remote -q ${1:-$(git defremote)} | grep refs/pull-requests/$0/from | cut -c1-8)' - # Pull all the commits missed from a git pull --depth N clone - unshallow = pull --unshallow + [alias] + begin = !git init && git commit --allow-empty -m 'Initial empty commit' + up = !git pull --rebase && git push + wsd = diff --color-words --ignore-space-at-eol --ignore-space-change --ignore-all-space + wd = diff --color-words + fa = fetch --all + ci = commit + cia = commit --all + co = checkout + ds = diff --stat + ba = branch --all + b = branch + st = status --short --branch + s = status --short --branch --untracked-files=no + unstage = reset HEAD + tlog = log --graph --color=always --abbrev-commit --date=relative --pretty=oneline + hist = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative + slog = log --oneline --decorate + fixup = commit --fixup + squash = commit --squash + ri = rebase --interactive --autosquash + ra = rebase --abort + effit = reset --hard + bn = rev-parse --abbrev-ref HEAD + cp = log --no-merges --cherry --graph --oneline + # What commits differ between branches, note, equivalent commits are omitted. + # Use this with three dot operator aka master...origin/master + cpd = log --no-merges --left-right --graph --cherry-pick --oneline + # Same as ^ only equivalent commits are listed with a = sign. + cmd = log --no-merges --left-right --graph --cherry-mark --oneline + # git update with submodule update + sup = !git pull --rebase && git submodule update --init --recursive + # git clone with submodules + sc = !git clone --recursive $1 + # what files are getting updated a lot descending output + churn = !git log --all -M -C --name-only --format='format:' "$@" | sort | grep -v '^$' | uniq -c | sort -r | awk 'BEGIN {print "count,file"} {print $1 "," $2}' | egrep -v '^\\s+$' + # help the gc a bit and get a bit more space back for a local clone + trim = !git reflog expire --expire=now --all && git gc --prune=now + # default remote, note depends on the repo having been git cloned + defremote = !git branch -rvv | egrep 'HEAD' | awk '{print $1}' | sed -e 's|/HEAD||g' + # short sha + short = rev-parse --short + # branch commits on lhs compared to rhs, use via g bcs $(g bn) ^other/branch + bcs = log --pretty="%H" --first-parent --no-merges + find-merge = !sh -c "commit=$0 && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 | uniq -f1 -d | sort -n | tail -1 | cut -f2" + show-merge = !sh -c "merge=$(git find-merge $0 $1) && [ -n \"$merge\" ] && git show $merge" + # push branch while setting the upstream to the default remote + pbr = !git push --set-upstream $(git defremote) $(git bn) + p = !sh -c 'git branch ${1:-$(git defremote)}pr$0@$(iso8601 -s) $(git ls-remote -q ${1:-$(git defremote)} | grep refs/pull-requests/$0/from | cut -c1-8)' + # kinda/sorta git pull -r without the git pull nonsense + # cleanmerged = !sh -c "git branch --merged | grep -Ev '^(. master|\*)' | xargs -n1 git branch -d" + prune = !sh -c 'git cleanmerged; git fetch -p; git trim' + # My defremote hack depends on $remote/HEAD to point to somewhere + # which it may not if the git repo wasn't cloned + fixhead = !sh -c "rem=${0:-origin} && branch=${1:-master} && git symbolic-ref refs/remotes/$rem/HEAD refs/remotes/$rem/${branch}" + # push branch while setting the upstream to the default remote + pbr = !git push --set-upstream $(git defremote) $(git bn) + p = !sh -c 'git branch ${1:-$(git defremote)}pr$0@$(iso8601 -s) $(git ls-remote -q ${1:-$(git defremote)} | grep refs/pull-requests/$0/from | cut -c1-8)' + # Pull all the commits missed from a git pull --depth N clone + unshallow = pull --unshallow + # Set the origin to not allow pushing, to be on the safe side. + nopush = remote set-url --push origin no_push #+END_SRC ** github #+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (bound-and-true-p git-p)) @@ -143,13 +145,6 @@ General git configuration split out into sections mostly. email = mitch.tishmack@gmail.com #+END_SRC -*** for cray -#+BEGIN_SRC conf :tangle (when (and (eq git-p t) (eq cray-p t)) "tmp/.gitconfig") -[user] - name = Mitch Tishmack - email = mtishmack@cray.com -#+END_SRC - * ~/.gitignore Common crap/build artifacts that git should always ignore. @@ -169,3 +164,11 @@ Common crap/build artifacts that git should always ignore. ,*.[oa] ,*.hi #+END_SRC + +* Cray overrides +** ~/.gitconfig +#+BEGIN_SRC conf :tangle (tangle/file ".gitconfig" (and (bound-and-true-p git-p) (bound-and-true-p cray-p))) +[user] + name = Mitch Tishmack + email = mtishmack@cray.com +#+END_SRC diff --git a/nix.org b/nix.org index 9656058..12b5dda 100644 --- a/nix.org +++ b/nix.org @@ -12,43 +12,17 @@ Nix user config.nix setup. #+BEGIN_SRC conf :mkdirp yes :tangle (tangle/file ".nixpkgs/config.nix" (bound-and-true-p nix-p)) - let - pkgs = import {}; - in { packageOverrides = pkgs: with pkgs; let in rec { - custom-pybugz = with python34Packages; buildPythonPackage rec { - name = "pybugz-${version}"; - version = "0.13"; - src = pkgs.fetchgit { - url = https://github.com/williamh/pybugz.git; - rev = "4dec396d43061c1def9aa19601c89c8aa00742b3"; - sha256 = "1s21jma83cyynmv3696hbrgy0d3sq4j027iplhnw22q2237bk1xd"; - }; - # TODO: Fix this, something to do with how its using unittest - doCheck = false; - buildInputs = [ pkgs.glibcLocales ]; - propagatedBuildInputs = [ six ]; - }; custom-pinentry = pinentry.override { gtk2 = null; qt4 = null; ncurses = null; }; custom-youtube-dl = python27Packages.youtube-dl.override { pandoc = null; }; - # 3 unit tests fail on both 27 pylint and 35 pylint, so ignore it -# custom-pylint = python35Packages.pylint.override { doCheck = false; }; - - custom-git = git.override { - pythonSupport = false; - svnSupport = true; - guiSupport = false; - sendEmailSupport = true; - }; default = buildEnv { name = "default"; ignoreCollisions = true; paths = [ ack - ansible aria aspell aspellDicts.en @@ -60,10 +34,7 @@ Nix user config.nix setup. cscope ctags curl - custom-git custom-pinentry - custom-pybugz -# custom-pylint custom-youtube-dl diffutils docbook5 @@ -76,15 +47,14 @@ Nix user config.nix setup. gist gitAndTools.git-extras gitAndTools.gitFull + gmp gnumake gnupg gnupg1compat gnutar graphviz-nox haskellPackages.ShellCheck - haskellPackages.bake haskellPackages.cabal-dependency-licenses - haskellPackages.ghc-core haskellPackages.ghc-mod haskellPackages.hasktags haskellPackages.hindent @@ -92,9 +62,7 @@ Nix user config.nix setup. haskellPackages.hspec haskellPackages.idris haskellPackages.intero - haskellPackages.network haskellPackages.pandoc - haskellPackages.shake haskellPackages.stack htop imagemagick @@ -107,11 +75,11 @@ Nix user config.nix setup. mercurial moreutils mosh + mr multimarkdown multitail - mutt munge - mr + mutt nox openssl p7zip @@ -123,17 +91,16 @@ Nix user config.nix setup. poppler_utils postgresql pv - python27Packages.bugzilla python27Packages.flake8 python27Packages.howdoi python27Packages.pip python27Packages.pyflakes + python27Packages.pylint python27Packages.virtualenv readline rlwrap rsync rtags - gmp silver-searcher sloccount sqlite @@ -142,14 +109,12 @@ Nix user config.nix setup. texlive.combined.scheme-full tmux tree - unrar unzip upx wakelan watch wget xz - zlib # If I ever come up with some linux only stuff or figure out xhyve # ] ++ stdenv.lib.optionals stdenv.isLinux [ # ] ++ stdenv.lib.optionals stdenv.isDarwin [ @@ -157,124 +122,6 @@ Nix user config.nix setup. ]; }; }; -<<<<<<< HEAD - - default = buildEnv { - name = "default"; - ignoreCollisions = true; - paths = [ - ack - ansible - aria - aspell - aspellDicts.en - bazaarTools - cacert - clang - clang-analyzer - cloc - cscope - ctags - curl - custom-git - custom-pinentry - custom-pybugz - custom-pylint - custom-youtube-dl - diffutils - docbook5 - duply - emacs - entr - gcc - gdbm - ghostscript - gist - gitAndTools.git-extras - gitAndTools.gitFull - gnumake - gnupg - gnupg1compat - gnutar - graphviz-nox - haskellPackages.ShellCheck - haskellPackages.bake - haskellPackages.cabal-dependency-licenses - haskellPackages.ghc-core - haskellPackages.ghc-mod - haskellPackages.hasktags - haskellPackages.hindent - haskellPackages.hoogle - haskellPackages.hspec - haskellPackages.idris - haskellPackages.intero - haskellPackages.network - haskellPackages.pandoc - haskellPackages.shake - haskellPackages.stack - htop - imagemagick - iperf - jq - keychain - lastpass-cli - less - llvm - mercurial - moreutils - mosh - multimarkdown - multitail - mutt - mr - nox - openssl - p7zip - patchutils - pbzip2 - pigz - pixz - pkgconfig - poppler_utils - postgresql - pv - python27Packages.bugzilla - python27Packages.flake8 - python27Packages.howdoi - python27Packages.pip - python27Packages.pyflakes - python27Packages.virtualenv - readline - rlwrap - rsync - rtags - gmp - silver-searcher - sloccount - sqlite - sshpass - subversionClient - texlive.combined.scheme-full - tmux - tree - unrar - unzip - upx - wakelan - watch - wget - xz -# If I ever come up with some linux only stuff or figure out xhyve -# ] ++ stdenv.lib.optionals stdenv.isLinux [ -# ] ++ stdenv.lib.optionals stdenv.isDarwin [ -# xhyve - ]; - }; - }; - allowUnfree = true; -} -======= allowUnfree = true; } ->>>>>>> origin/master #+END_SRC diff --git a/cray.org b/z9999-cray.org similarity index 92% rename from cray.org rename to z9999-cray.org index f8371cf..41fca8e 100644 --- a/cray.org +++ b/z9999-cray.org @@ -5,10 +5,10 @@ #+BABEL: :cache yes #+PROPERTY: header-args :cache yes :padline no :mkdirp yes :comments no -* Cray specific +* Cray specific overrides ** ~/.emacs.d/local.el -#+BEGIN_SRC emacs-lisp :tangle (if (bound-and-true-p cray-p) "tmp/.emacs.d/local.el" "no") :mkdirp yes +#+BEGIN_SRC emacs-lisp :tangle (tangle/file ".emacs.d/local.el" (bound-and-true-p cray-p)) (defun cray/get-bugs () (with-current-buffer (current-buffer) (setq input (save-restriction (widen) @@ -37,7 +37,7 @@ Use gnus in emacs for email. Outside of normal emacs since its easier. -#+BEGIN_SRC emacs-lisp :tangle (if (bound-and-true-p cray-p) "tmp/.gnus" "no") :mkdirp yes :tangle-mode (identity #o600) +#+BEGIN_SRC emacs-lisp :mkdirp yes :tangle-mode (identity #o600) :tangle (tangle/file ".gnus" (bound-and-true-p cray-p)) (use-package gnus :ensure t :config @@ -115,7 +115,7 @@ Use gnus in emacs for email. Outside of normal emacs since its easier. For some reason this sometimes needs to happen, stupid work dns. -#+BEGIN_SRC sh :tangle (if (and (bound-and-true-p cray-p) (bound-and-true-p macos-p)) "tmp/bin/flushdns" "no") :mkdirp yes :tangle-mode (identity #o755) +#+BEGIN_SRC sh :mkdirp yes :tangle-mode (identity #o755) :tangle (tangle/file "bin/flushdns" (and (bound-and-true-p cray-p) (bound-and-true-p macos-p))) #!/bin/sh set +e @@ -129,7 +129,7 @@ For some reason this sometimes needs to happen, stupid work dns. LEGACY svn interop -#+BEGIN_SRC sh :tangle (if (bound-and-true-p cray-p) "tmp/bin/tomod" "no") :mkdirp yes :tangle-mode (identity #o755) +#+BEGIN_SRC sh :mkdirp yes :results append :tangle-mode (identity #o755) :tangle (tangle/file "bin/tomod" (bound-and-true-p cray-p)) #!/usr/bin/env sh #-*-mode: Shell-script; coding: utf-8;-*- export script=$(basename "$0") @@ -200,9 +200,9 @@ LEGACY svn interop #+END_SRC ** ~/bin/towip -LEGACY svn interop +LEGACY svn interop, do I even need this any longer? -#+BEGIN_SRC sh :tangle (if (bound-and-true-p cray-p) "tmp/bin/towip" "no") :mkdirp yes :tangle-mode (identity #o755) +#+BEGIN_SRC sh :tangle (tangle/file "bin/towip" (bound-and-true-p cray-p)) :mkdirp yes :tangle-mode (identity #o755) #!/usr/bin/env sh #-*-mode: Shell-script; coding: utf-8;-*- export script=$(basename "$0")