Git #5

5名無しさん@Next2ch:2015/03/14(土) 23:33:32.46 ID:36hBr7hV

#特定のファイルの変更経歴を表示
function git_show_history_of_file(){
[ "$1" == "" ] && echo "give a file name" && return;
[ ! -f "$1" ] && echo "give a file name that exsists" && return;
git log --follow -p "$1"
}
#特定のハッシュの時点で行われた変更点を表示
function git_show_change_made_by_hash(){
[ "$1" == "" ] && echo "give a sha hash, usually 40 bytes, made from 0-9 and a
-f " && return;
git rev-list "HEAD..$1" 2>/dev/null
[ $? -ne 0 ] && {
echo "Hash [$1] does not exsist. Specify a valid commit.";
echo "Possible canidates are..."
git log |grep "${1:0:8}";
[ $? -ne 0 ] && {
{ git log |grep "${1:0:5}"; } || { [ ${#B} -gt 5 ] && git log |grep "${1:0-5:5}"; }
[ $? -ne 0 ] && {
echo "Unable to find any match. Is that really a sha hash of a commit?"
}
}
return 1;
}
git show "$1";
}


スパムを通報

このレスがスパム・荒らしである場合は以下のボタンをクリックして通報してください。
(同意できない意見などに反対票を投じる機能ではありません)
通報

このスレッドを全て表示


レスを書き込む