0

I'm trying to do some git archeology but I've run into some weirdness with orb-babel and sub-shell expressions:

#+name: get-aggregate-stats-debug
#+header: :dir ~/lsrc/qemu/qemu.git
#+begin_src shell :results output
  d=$SINCE
  n=$(date -I -d "$d + 1 month")
  echo "$d -> $n"
  foo=$(git shortlog -s --since="$d" --until="$n" | wc -l)
  echo "foo is $foo"
#+end_src

#+RESULTS: get-aggregate-stats-debug
: 2003-02-01 -> 2003-03-01

Where as:

#+name: get-aggregate-stats-session
#+header: :dir ~/lsrc/qemu/qemu.git
#+begin_src shell :results output :session debug
  d=$SINCE
  n=$(date -I -d "$d + 1 month")
  echo "$d -> $n"
  foo=$(git shortlog -s --since="$d" --until="$n" | wc -l)
  echo "foo is $foo"
#+end_src

#+RESULTS: get-aggregate-stats-session
:
: alex@zen:~/lsrc/qemu/qemu.git$ alex@zen:~/lsrc/qemu/qemu.git$ alex@zen:~/lsrc/qemu/qemu.git$ alex@zen:~/lsrc/qemu/qemu.git$ alex@zen:~/lsrc/qemu/qemu.git$ 2003-02-01 -> 2$
: alex@zen:~/lsrc/qemu/qemu.git$ foo is 2

Any idea what's going on?

  • Hmm using #+begin_src sh for the first example at least calculates foo - although it gets the number wrong... – stsquad Oct 10 '18 at 7:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.