I saw a similar crash here, where bash would start failing around about
500 iterations in such a loop:

```
export GIT_ASKPASS=echo

grep -v '^#' ../gitolite2gitlab.txt |while read gitolite_path gitlab_path; do
    gitolite_url=/srv/git.torproject.org/repositories/$gitolite_path.git 
    gitlab_url=https://gitlab.torproject.org/$gitlab_path.git 
    echo "diff -u $gitolite_url $gitlab_url"
    diff -u <(git ls-remote $gitolite_url) <(git ls-remote $gitlab_url)
done | tee final-remote-diff.patch
```

~500 is not a random number. it's about half of 1024, which i suspect is
the fd limit i'm hitting. i'm betting the shell is just not closing
those file descriptor at all after the pipeline completes.

normally, i would expect the FD to close after the `diff -u` command
returns there, but it seems that's just not happening.

Reply via email to