about summary refs log tree commit diff
path: root/git-fetch-email.sh
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2021-06-05 15:57:32 -0400
committerJune McEnroe <june@causal.agency>2021-06-05 15:57:32 -0400
commit2ed06d33b75c170d997a55de6543b9e206fbf92b (patch)
tree7fb2dbe648aaefd70cdda838aa899def31eb59c7 /git-fetch-email.sh
parentReplace freenode with tilde.chat (diff)
downloadimbox-2ed06d33b75c170d997a55de6543b9e206fbf92b.tar.gz
imbox-2ed06d33b75c170d997a55de6543b9e206fbf92b.zip
Add -H flag to fetch only headers
Basically to quickly test which messages are getting matched without
having to scroll through their bodies.
Diffstat (limited to 'git-fetch-email.sh')
-rw-r--r--git-fetch-email.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-fetch-email.sh b/git-fetch-email.sh
index e3fc953..574d04f 100644
--- a/git-fetch-email.sh
+++ b/git-fetch-email.sh
@@ -18,6 +18,7 @@ set -u
 
 idle=
 apply=
+headers=
 verbose=
 host=$(git config fetchemail.imapServer)
 port=$(git config fetchemail.imapServerPort)
@@ -40,6 +41,7 @@ git fetch-email [<options>]
 --
 C,cc= fetch patches with matching Cc headers
 F,from= fetch patches with matching From headers
+H,headers fetch only patch headers
 M,move-to= move patches to mailbox
 S,subject= fetch patches with matching Subject headers
 T,to= fetch patches with matching To headers
@@ -61,6 +63,7 @@ while [ $# -gt 0 ]; do
 	case "${opt}" in
 		(-C) cc=$1; shift;;
 		(-F) from=$1; shift;;
+		(-H) headers=yes;;
 		(-M) move=$1; shift;;
 		(-S) subject=$1; shift;;
 		(-T) to=$1; shift;;
@@ -76,6 +79,7 @@ while [ $# -gt 0 ]; do
 		(--no-apply) apply=;;
 		(--no-cc) cc=;;
 		(--no-from) from=;;
+		(--no-headers) headers=;;
 		(--no-idle) idle=;;
 		(--no-mark-seen) seen=;;
 		(--no-move-to) move=;;
@@ -107,7 +111,7 @@ fi
 
 fetch() {
 	printf '%s' "${pass}" | imbox -w \
-		${verbose:+-v} ${idle:+-i} ${unseen:+-U} ${seen:+-s} \
+		${verbose:+-v} ${idle:+-i} ${headers:+-H} ${unseen:+-U} ${seen:+-s} \
 		${host:+-h "${host}"} \
 		${port:+-p "${port}"} \
 		${mailbox:+-m "${mailbox}"} \