This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cat > test0.cc <<EOF | |
#include <iostream> | |
#include <string> | |
void foo(){ | |
std::cout << "this is the target function." << std::endl; | |
} | |
EOF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%{ | |
/* Parse a string into an internal time stamp. | |
Copyright (C) 1999-2000, 2002-2012 Free Software Foundation, Inc. | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation; either version 3 of the License, or | |
(at your option) any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# usage: | |
# ./git-file-branch.sh fn.cpp | |
prev=$(git rev-parse $(git rev-list -n1 --all -- $1)^) | |
for br in $(git branch | cut -c 3-); do | |
[ "x$(git rev-list -n1 --no-merges --first-parent $prev..$br -- $1)" != "x" ] && echo $br | |
done |