Redirecting Checkout Output To Variable And Tee StdErr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Assigning the subshell output for a `clone` to a variable, while
simultaneously outputting to the user works.
With `checkout`, it does not.

This was brought up in IRC #git and #bash, and JAA (most of all) and
jast and others have contributed well to this finding.
This came about by my need to clone part of texlive (which supposedly
would otherwise be 6GB (it was already 700MB @ 8%), when I only needed
the source, so I used the great `--filter=blob:none`. (I have been
made aware of (in the tug ML) the nice `git svn` feature, but wanted
something that'd apply to all git repos I come across.)
With this blobless clone, it'll only be like 8MB.
My intent is to be able to have the user know progress is happening as
git `--progress`es, but also grab the output and act on messages that
may come up (like any error, where I act on a string of the error).

Test:
$ cloneVar=$(git clone --progress --branch trunk --depth 1
--filter=blob:none --no-checkout -- git://git.texlive.info/texlive
2>&1 | tee /dev/stderr)
$ checkoutVar=$(git checkout --progress trunk -- Build/source 2>&1 |
tee /dev/stderr)

`GIT_TRACE=1` was also mentioned, and that certainly provides
output... And while I saw `fetch` being mentioned in it, I saw no
reference to `Build/source` in the output to draw on (in case I could
manually use `fetch` itself to only get a subpath (which isn't even
looking like it's an option)).




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux