Git রিপোজিটরি দিয়ে কাজ করার সময় আমার জীবন সহজ করতে আমি কিছু Bash স্ক্রিপ্ট লিখেছি। আমার অনেক কলিগ বলে এটি দরকার নেই; Git কমান্ড দিয়ে সবকিছু করা যায়। সেটি সত্য হলেও, আমি স্ক্রিপ্টগুলো Git কমান্ড কী দিয়ে কী করা যায় তা বুঝতে চেষ্টা করার চেয়ে অসীম বেশি সুবিধাজনক পাই।
1. gitlog
gitlog মাস্টার ভার্শনের বিপরীতে বর্তমান প্যাচগুলোর একটি সংক্ষিপ্ত লিস্ট প্রিন্ট করে। এটি সেগুলো পুরনো থেকে নতুন ক্রমে প্রিন্ট করে এবং অথর ও ডেসক্রিপশন দেখায়, H = HEAD, ^ = HEAD^, 2 = HEAD~2, ইত্যাদি। উদাহরণ:
$ gitlog -----------------------[ recovery25 ]----------------------- (snip) 11 340d27a33895 Bob Peterson gfs2: drain the ail2 list after io errors 10 9b3c4e6efb10 Bob Peterson gfs2: clean up iopen glock mess in gfs2_create_inode 9 d2e8c22be39b Bob Peterson gfs2: Do proper error checking for go_sync family of glops 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite 3 4525c2f5b46f Bob Peterson Rafael Aquini's slab instrumentation 2 a06a5b7dea02 Bob Peterson GFS2: Add go_get_holdtime to gl_ops ^ 8ba93c796d5c Bob Peterson gfs2: introduce new function remaining_hold_time and use it in dq H e8b5ff851bb9 Bob Peterson gfs2: Allow rgrps to have a minimum hold time
যদি অন্য ব্রাঞ্চের প্যাচগুলো দেখতে চান, অল্টারনেটিভ ব্রাঞ্চ সপসিফাই করুন:
$ gitlog recovery24
2. gitlog.id
gitlog.id শুধু প্যাচের SHA1 ID গুলো প্রিন্ট করে:
$ gitlog.id -----------------------[ recovery25 ]----------------------- 56908eeb6940 2ca4a6b628a1 fc64ad5d99fe 02031a00a251 f6f38da7dd18 d8546e8f0023 fc3cc1f98f6b 12c3e0cb3523 76cce178b134 6fc1dce3ab9c 1b681ab074ca 26fed8de719b 802ff51a5670 49f67a512d8c f04f20193bbb 5f6afe809d23 2030521dc70e dada79b3be94 9b19a1e08161 78a035041d3e f03da011cae2 0d2b2e068fcd 2449976aa133 57dfb5e12ccd 53abedfdcf72 6fbdda3474b3 49544a547188 187032f7a63c 6f75dae23d93 95fc2a261b00 ebfb14ded191 f653ee9e414a 0e2911cb8111 73968b76e2e3 8a3e4cb5e92c a5f2da803b5b 7c9ef68388ed 71ca19d0cba8 340d27a33895 9b3c4e6efb10 d2e8c22be39b 9563e31f8bfd ebac7a38036c f703a3c27874 a3e86d2ef30e da3c604755b0 4525c2f5b46f a06a5b7dea02 8ba93c796d5c e8b5ff851bb9
এটিও বর্তমান ব্রাঞ্চ ধরে নেয়, কিন্তু আপনি চাইলে অন্য ব্রাঞ্চ সপসিফাই করতে পারেন।
3. gitlog.id2
gitlog.id2 gitlog.id-এর মতোই কিন্তু টপে ব্রাঞ্চ লাইন ছাড়া। এটি একটি ব্রাঞ্চ থেকে কারেন্ট ব্রাঞ্চে সকল প্যাচ চেরি-পিক করার জন্য হ্যান্ডি:
$ # নতুন ব্রাঞ্চ তৈরি করুন $ git branch --track origin/master $ # নতুন ব্রাঞ্চ চেকআউট করুন $ git checkout recovery26 $ # পুরনো ব্রাঞ্চ থেকে সকল প্যাচ চেরি-পিক করুন $ for i in `gitlog.id2 recovery25` ; do git cherry-pick $i ;done
4. gitlog.grep
gitlog.grep প্যাচ কালেকশনের ভিতরে একটি স্ট্রিং গ্রেপ করে। উদাহরণস্বরূপ, যদি আমি একটি বাগ খুঁজে পাই এবং inode_go_sync ফাংশনের রেফারেন্স থাকা প্যাচটি ফিক্স করতে চাই, তবে আমি করি:
$ gitlog.grep inode_go_sync -----------------------[ recovery25 - 50 patches ]----------------------- (snip) 11 340d27a33895 Bob Peterson gfs2: drain the ail2 list after io errors 10 9b3c4e6efb10 Bob Peterson gfs2: clean up iopen glock mess in gfs2_create_inode 9 d2e8c22be39b Bob Peterson gfs2: Do proper error checking for go_sync family of glops 152:-static void inode_go_sync(struct gfs2_glock *gl) 153:+static int inode_go_sync(struct gfs2_glock *gl) 163:@@ -296,6 +302,7 @@ static void inode_go_sync(struct gfs2_glock *gl) 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite 3 4525c2f5b46f Bob Peterson Rafael Aquini's slab instrumentation 2 a06a5b7dea02 Bob Peterson GFS2: Add go_get_holdtime to gl_ops ^ 8ba93c796d5c Bob Peterson gfs2: introduce new function remaining_hold_time and use it in dq H e8b5ff851bb9 Bob Peterson gfs2: Allow rgrps to have a minimum hold time
তাহলে আমি জানি প্যাচ HEAD~9 হলো যে টি ফিক্স করতে হবে। git rebase -i HEAD~10 দিয়ে প্যাচ ৯ এডিট করি, git commit -a --amend, তারপর git rebase --continue দিয়ে প্রয়োজনীয় এডজাস্টমেন্ট করি।
5. gitbranchcmp3
gitbranchcmp3 আমার কারেন্ট ব্রাঞ্চকে অন্য ব্রাঞ্চের সাথে কম্পেয়ার করতে দেয়, যাতে পুরনো প্যাচ ভার্শন এবং নতুন ভার্শন কম্পেয়ার করে দ্রুত বুঝতে পারি কী চেঞ্জ হয়েছে এবং কী নয়। এটি একটি কম্পেয়ার স্ক্রিপ্ট জেনারেট করে (যেটি KDE টুল Kompare ব্যবহার করে, যা GNOME3-তেও কাজ করে) যেসব প্যাচ একदम সেম নয় তাদের কম্পেয়ার করতে। যদি লাইন নম্বর ছাড়া কোনো ডিফারেন্স না থাকে, এটি [SAME] প্রিন্ট করে। যদি শুধু কমেন্টের ডিফারেন্স থাকে, এটি [same] (লোয়ার কেস) প্রিন্ট করে। উদাহরণ:
$ gitbranchcmp3 recovery24 Branch recovery24 has 47 patches Branch recovery25 has 50 patches (snip) 38 87eb6901607a 340d27a33895 [same] gfs2: drain the ail2 list after io errors 39 90fefb577a26 9b3c4e6efb10 [same] gfs2: clean up iopen glock mess in gfs2_create_inode 40 ba3ae06b8b0e d2e8c22be39b [same] gfs2: Do proper error checking for go_sync family of glops 41 2ab662294329 9563e31f8bfd [SAME] gfs2: use page_offset in gfs2_page_mkwrite 42 0adc6d817b7a ebac7a38036c [SAME] gfs2: don't use buffer_heads in gfs2_allocate_page_backing 43 55ef1f8d0be8 f703a3c27874 [SAME] gfs2: Improve mmap write vs. punch_hole consistency 44 de57c2f72570 a3e86d2ef30e [SAME] gfs2: Multi-block allocations in gfs2_page_mkwrite 45 7c5305fbd68a da3c604755b0 [SAME] gfs2: Fix end-of-file handling in gfs2_page_mkwrite 46 162524005151 4525c2f5b46f [SAME] Rafael Aquini's slab instrumentation 47 a06a5b7dea02 [ ] GFS2: Add go_get_holdtime to gl_ops 48 8ba93c796d5c [ ] gfs2: introduce new function remaining_hold_time and use it in dq 49 e8b5ff851bb9 [ ] gfs2: Allow rgrps to have a minimum hold time Missing from recovery25: The missing: Compare script generated at: /tmp/compare_mismatches.sh
6. gitlog.find
শেষে, gitlog.find—এটি আমাকে আমার প্যাচগুলোর আপস্ট্রিম ভার্শন কোথায় এবং প্রতিটি প্যাচের বর্তমান স্ট্যাটাস কী সেটা শনাক্ত করতে সাহায্য করে। এটি প্যাচ ডেসক্রিপশন ম্যাচ করে এটি করে। এটি একটি কম্পেয়ার স্ক্রিপ্টও জেনারেট করে (আবার Kompare ব্যবহার করে) কারেন্ট প্যাচকে আপস্ট্রিম কাউন্টারপার্টের সাথে কম্পেয়ার করতে:
$ gitlog.find -----------------------[ recovery25 - 50 patches ]----------------------- (snip) 11 340d27a33895 Bob Peterson gfs2: drain the ail2 list after io errors lo 5bcb9be74b2a Bob Peterson gfs2: drain the ail2 list after io errors 10 9b3c4e6efb10 Bob Peterson gfs2: clean up iopen glock mess in gfs2_create_inode fn 2c47c1be51fb Bob Peterson gfs2: clean up iopen glock mess in gfs2_create_inode 9 d2e8c22be39b Bob Peterson gfs2: Do proper error checking for go_sync family of glops lo feb7ea639472 Bob Peterson gfs2: Do proper error checking for go_sync family of glops 8 9563e31f8bfd Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite ms f3915f83e84c Christoph Hellwig gfs2: use page_offset in gfs2_page_mkwrite 7 ebac7a38036c Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing ms 35af80aef99b Christoph Hellwig gfs2: don't use buffer_heads in gfs2_allocate_page_backing 6 f703a3c27874 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency fn 39c3a948ecf6 Andreas Gruenbacher gfs2: Improve mmap write vs. punch_hole consistency 5 a3e86d2ef30e Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite fn f53056c43063 Andreas Gruenbacher gfs2: Multi-block allocations in gfs2_page_mkwrite 4 da3c604755b0 Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite fn 184b4e60853d Andreas Gruenbacher gfs2: Fix end-of-file handling in gfs2_page_mkwrite 3 4525c2f5b46f Bob Peterson Rafael Aquini's slab instrumentation Not found upstream 2 a06a5b7dea02 Bob Peterson GFS2: Add go_get_holdtime to gl_ops Not found upstream ^ 8ba93c796d5c Bob Peterson gfs2: introduce new function remaining_hold_time and use it in dq Not found upstream H e8b5ff851bb9 Bob Peterson gfs2: Allow rgrps to have a minimum hold time Not found upstream Compare script generated: /tmp/compare_upstream.sh
প্যাচগুলো দুই লাইনে দেখানো হয়েছে, প্রথমটি আপনার কারেন্ট প্যাচ, দ্বিতীয়টি সংশ্লিষ্ট আপস্ট্রিম প্যাচ, এবং একটি ২-অক্ষরের সংক্ষিপ্ত রূপ যা আপস্ট্রিম স্ট্যাটাস নির্দেশ করে:
- lo মানে প্যাচটি লোকাল আপস্ট্রিম Git রেপোতে আছে (অর্থাৎ এখনো আপস্ট্রিমে পুশ করা হয়নি)।
- ms মানে প্যাচটি লিনাস টরভাল্ডসের মাস্টার ব্রাঞ্চে আছে।
- fn মানে প্যাচটি আমার "for-next" ডেভেলপমেন্ট ব্রাঞ্চে পুশ করা হয়েছে, পরবর্তী আপস্ট্রিম মার্জ উইন্ডোর জন্য।
আমার কিছু স্ক্রিপ্ট আমার সাধারণ Git ওয়ার্কফ্লো বেসড ধারণা নেয়। উদাহরণস্বরূপ, আপস্ট্রিম প্যাচ সার্চ করার সময় এটি আমার পরিচিত Git ট্রির লোকেশন ব্যবহার করে। তাই আপনাকে আপনার কন্ডিশন অনুযায়ী এডজাস্ট বা উন্নত করতে হবে। gitlog.find স্ক্রিপ্টটি শুধু GFS2 এবং DLM প্যাচ লোকেট করার জন্য ডিজাইন করা, তাই আপনি GFS2 ডেভেলপার না হলে আপনার কম্পোনেন্ট অনুযায়ী কাস্টোমাইজ করুন।
সোর্স কোড
এই স্ক্রিপ্টগুলোর সোর্স নিচে দেওয়া হলো।
1. gitlog
#!/bin/bash
branch=$1
if test "x$branch" = x; then
branch=`git branch -a | grep "*" | cut -d ' ' -f2`
fi
patches=0
tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}`
LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '`
for i in $LIST; do patches=$(echo $patches + 1 | bc);done
if [[ $branch =~ .*for-next.* ]]
then
start=HEAD
# start=origin/for-next
else
start=origin/master
fi
tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}`
/usr/bin/echo "-----------------------[" $branch "]-----------------------"
patches=$(echo $patches - 1 | bc);
for i in $LIST; do
if [ $patches -eq 1 ]; then
cnt=" ^"
elif [ $patches -eq 0 ]; then
cnt=" H"
else
if [ $patches -lt 10 ]; then
cnt=" $patches"
else
cnt="$patches"
fi
fi
/usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s %n" $i
patches=$(echo $patches - 1 | bc)
done
#git log --reverse --abbrev-commit --pretty=format:"%h %<|(32)%an %s" $tracking..$branch
#git log --reverse --abbrev-commit --pretty=format:"%h %<|(32)%an %s" ^origin/master ^linux-gfs2/for-next $branch
2. gitlog.id
#!/bin/bash
branch=$1
if test "x$branch" = x; then
branch=`git branch -a | grep "*" | cut -d ' ' -f2`
fi
tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}`
/usr/bin/echo "-----------------------[" $branch "]-----------------------"
git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '
3. gitlog.id2
#!/bin/bash
branch=$1
if test "x$branch" = x; then
branch=`git branch -a | grep "*" | cut -d ' ' -f2`
fi
tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}`
git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '
4. gitlog.grep
#!/bin/bash
param1=$1
param2=$2
if test "x$param2" = x; then
branch=`git branch -a | grep "*" | cut -d ' ' -f2`
string=$param1
else
branch=$param1
string=$param2
fi
patches=0
tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}`
LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '`
for i in $LIST; do patches=$(echo $patches + 1 | bc);done
/usr/bin/echo "-----------------------[" $branch "-" $patches "patches ]-----------------------"
patches=$(echo $patches - 1 | bc);
for i in $LIST; do
if [ $patches -eq 1 ]; then
cnt=" ^"
elif [ $patches -eq 0 ]; then
cnt=" H"
else
if [ $patches -lt 10 ]; then
cnt=" $patches"
else
cnt="$patches"
fi
fi
/usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s" $i
/usr/bin/git show --pretty=email --patch-with-stat $i | grep -n "$string"
patches=$(echo $patches - 1 | bc)
done
5. gitbranchcmp3
#!/bin/bash # # gitbranchcmp3[ ] # oldbranch=$1 newbranch=$2 script=/tmp/compare_mismatches.sh /usr/bin/rm -f $script echo "#!/bin/bash" > $script /usr/bin/chmod 755 $script echo "# Generated by gitbranchcmp3.sh" >> $script echo "# Run this script to compare the mismatched patches" >> $script echo " " >> $script echo "function compare_them()" >> $script echo "{" >> $script echo " git show --pretty=email --patch-with-stat \$1 > /tmp/gronk1" >> $script echo " git show --pretty=email --patch-with-stat \$2 > /tmp/gronk2" >> $script echo " kompare /tmp/gronk1 /tmp/gronk2" >> $script echo "}" >> $script echo " " >> $script if test "x$newbranch" = x; then newbranch=`git branch -a | grep "*" | cut -d ' ' -f2` fi tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}` declare -a oldsha1s=(`git log --reverse --abbrev-commit --pretty=oneline $tracking..$oldbranch | cut -d ' ' -f1 |paste -s -d ' '`) declare -a newsha1s=(`git log --reverse --abbrev-commit --pretty=oneline $tracking..$newbranch | cut -d ' ' -f1 |paste -s -d ' '`) #echo "old: " $oldsha1s oldcount=${#oldsha1s[@]} echo "Branch $oldbranch has $oldcount patches" oldcount=$(echo $oldcount - 1 | bc) #for o in `seq 0 ${#oldsha1s[@]}`; do # echo -n ${oldsha1s[$o]} " " # desc=`git show $i | head -5 | tail -1|cut -b5-` #done #echo "new: " $newsha1s newcount=${#newsha1s[@]} echo "Branch $newbranch has $newcount patches" newcount=$(echo $newcount - 1 | bc) #for o in `seq 0 ${#newsha1s[@]}`; do # echo -n ${newsha1s[$o]} " " # desc=`git show $i | head -5 | tail -1|cut -b5-` #done echo for new in `seq 0 $newcount`; do newsha=${newsha1s[$new]} newdesc=`git show $newsha | head -5 | tail -1|cut -b5-` oldsha=" " same="[ ]" for old in `seq 0 $oldcount`; do if test "${oldsha1s[$old]}" = "match"; then continue; fi olddesc=`git show ${oldsha1s[$old]} | head -5 | tail -1|cut -b5-` if test "$olddesc" = "$newdesc" ; then oldsha=${oldsha1s[$old]} #echo $oldsha git show $oldsha |tail -n +2 |grep -v "index.*\.\." |grep -v "@@" > /tmp/gronk1 git show $newsha |tail -n +2 |grep -v "index.*\.\." |grep -v "@@" > /tmp/gronk2 diff /tmp/gronk1 /tmp/gronk2 &> /dev/null if [ $? -eq 0 ] ;then # No differences same="[SAME]" oldsha1s[$old]="match" break fi git show $oldsha |sed -n '/diff/,$p' |grep -v "index.*\.\." |grep -v "@@" > /tmp/gronk1 git show $newsha |sed -n '/diff/,$p' |grep -v "index.*\.\." |grep -v "@@" > /tmp/gronk2 diff /tmp/gronk1 /tmp/gronk2 &> /dev/null if [ $? -eq 0 ] ;then # Differences in comments only same="[same]" oldsha1s[$old]="match" break fi oldsha1s[$old]="match" echo "compare_them $oldsha $newsha" >> $script fi done echo "$new $oldsha $newsha $same $newdesc" done echo echo "Missing from $newbranch:" the_missing="" # Now run through the olds we haven't matched up for old in `seq 0 $oldcount`; do if test ${oldsha1s[$old]} != "match"; then olddesc=`git show ${oldsha1s[$old]} | head -5 | tail -1|cut -b5-` echo "${oldsha1s[$old]} $olddesc" the_missing=`echo "$the_missing ${oldsha1s[$old]}"` fi done echo "The missing: " $the_missing echo "Compare script generated at: $script" #git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '
6. gitlog.find
#!/bin/bash
#
# Find the upstream equivalent patch
#
# gitlog.find
#
cwd=$PWD
param1=$1
ubranch=$2
patches=0
script=/tmp/compare_upstream.sh
echo "#!/bin/bash" > $script
/usr/bin/chmod 755 $script
echo "# Generated by gitbranchcmp3.sh" >> $script
echo "# Run this script to compare the mismatched patches" >> $script
echo " " >> $script
echo "function compare_them()" >> $script
echo "{" >> $script
echo " cwd=$PWD" >> $script
echo " git show --pretty=email --patch-with-stat \$2 > /tmp/gronk2" >> $script
echo " cd ~/linux.git/fs/gfs2" >> $script
echo " git show --pretty=email --patch-with-stat \$1 > /tmp/gronk1" >> $script
echo " cd $cwd" >> $script
echo " kompare /tmp/gronk1 /tmp/gronk2" >> $script
echo "}" >> $script
echo " " >> $script
#echo "Gathering upstream patch info. Please wait."
branch=`git branch -a | grep "*" | cut -d ' ' -f2`
tracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}`
cd ~/linux.git
if test "X${ubranch}" = "X"; then
ubranch=`git branch -a | grep "*" | cut -d ' ' -f2`
fi
utracking=`git rev-parse --abbrev-ref --symbolic-full-name @{u}`
#
# gather a list of gfs2 patches from master just in case we can't find it
#
#git log --abbrev-commit --pretty=format:" %h %<|(32)%an %s" master |grep -i -e "gfs2" -e "dlm" > /tmp/gronk
git log --reverse --abbrev-commit --pretty=format:"ms %h %<|(32)%an %s" master fs/gfs2/ > /tmp/gronk.gfs2
# ms = in Linus's master
git log --reverse --abbrev-commit --pretty=format:"ms %h %<|(32)%an %s" master fs/dlm/ > /tmp/gronk.dlm
cd $cwd
LIST=`git log --reverse --abbrev-commit --pretty=oneline $tracking..$branch | cut -d ' ' -f1 |paste -s -d ' '`
for i in $LIST; do patches=$(echo $patches + 1 | bc);done
/usr/bin/echo "-----------------------[" $branch "-" $patches "patches ]-----------------------"
patches=$(echo $patches - 1 | bc);
for i in $LIST; do
if [ $patches -eq 1 ]; then
cnt=" ^"
elif [ $patches -eq 0 ]; then
cnt=" H"
else
if [ $patches -lt 10 ]; then
cnt=" $patches"
else
cnt="$patches"
fi
fi
/usr/bin/git show --abbrev-commit -s --pretty=format:"$cnt %h %<|(32)%an %s" $i
desc=`/usr/bin/git show --abbrev-commit -s --pretty=format:"%s" $i`
cd ~/linux.git
cmp=1
up_eq=`git log --reverse --abbrev-commit --pretty=format:"lo %h %<|(32)%an %s" $utracking..$ubranch | grep "$desc"`
# lo = in local for-next
if test "X$up_eq" = "X"; then
up_eq=`git log --reverse --abbrev-commit --pretty=format:"fn %h %<|(32)%an %s" master..$utracking | grep "$desc"`
# fn = in for-next for next merge window
if test "X$up_eq" = "X"; then
up_eq=`grep "$desc" /tmp/gronk.gfs2`
if test "X$up_eq" = "X"; then
up_eq=`grep "$desc" /tmp/gronk.dlm`
if test "X$up_eq" = "X"; then
up_eq=" Not found upstream"
cmp=0
fi
fi
fi
fi
echo "$up_eq"
if [ $cmp -eq 1 ] ; then
UP_SHA1=`echo $up_eq|cut -d' ' -f2`
echo "compare_them $UP_SHA1 $i" >> $script
fi
cd $cwd
patches=$(echo $patches - 1 | bc)
done
echo "Compare script generated: $script"