Repository navigation
pointer: Only write the encoded pointer information to Stdout - #1105
Conversation
This allows to create a pointer file by redirecting Stdout like
$ git lfs pointer --file=path/to/file > pointer-to-file
Before this change, "pointer-to-file" would also contain the line saying
"Git LFS pointer for path/to/file"
which makes the pointer file invalid.
|
Please can you agree to the Contributor License Agreement since we can't merge this until you do (I think there's a link to do it if you click Details by the error below). Apart from that this looks good to me but I'd like @technoweenie to OK it as well before merging. |
|
@sinbad Unfortunately, until I saw the bot check I wasn't aware a CLA is required. I need to get the CLA reviewed by our legal department which might take some some. |
|
On a related note, I just had a discussion in upstream Git about what kind of information should go to Stdout vs. Stderr, and here are some good answers:
|
|
Yep, I think that's a pretty good guide. |
|
Hey @sschuberth, thanks for submitting this. I'm certainly not a linux expert, and will usually defer to whatever Git does in cases like this. I think those guidelines make sense for git plumbing commands, but not git porcelain commands. $ git status 2>/dev/null
On branch lfs-repo-usage
Your branch is based on 'origin/lfs-repo-usage', but the upstream is gone.
(use "git branch --unset-upstream" to fixup)
nothing to commit, working directory cleanThe default It looks like this PR declares |
|
Hi @technoweenie. I wouldn't say I'm a Linux expert either (I was mostly working on Git for Windows), but the discussion I was referring to is about
Note how he says "un-Unix", not "un-git-ish" or the like. Your counter-example of
Finally, even if this PR would declare
Again, as mentioned in the linked thread, try |
|
Nice counter point with Any idea what it'll take to get the CLA approved? Seems silly to hold up a trivial patch like this. I can totally ninja-merge this, or recreate the changes personally, but I'd rather not so you can get the sweet credit, and potentially contribute in the future ;) If you can't, or don't feel like going through the hassle, that's totally OK too. I'll just recreate the patch. In the future, you can just open issues for us. |
|
Yeah, I think you can get into pretty vague, opinionated arguments on stdout vs stderr. Basically, we should strive for usefulness. So if something is the "main" output of a command (as it is with Something like I don't think we have to care about plumbing versus porcelain when making this distinction.
tcl is notorious for treating anything on stderr like an error. IMHO that is just insane. |
@technoweenie I just need to push our legal department a bit. Give me a few more days. My patch is not super-urgent, and I'd like to get this sorted out anyway.
@peff Just FYI, PowerShell does the same. But I don't think it's insane per se. It's called standard error after all. |
|
Honestly, it doesn't sound insane to me either. That's why I wanted to clarify. Should we file a PR to change STDERR to STDUSER or something? @sschuberth no worries, I'll wait patiently :) |
|
This is such a common sticking point...in SourceTree for quite a while we coloured stderr output red because it was usually best way to highlight errors in large output based on observed Git behaviour, but it could be confusing when people had verbose mode on but the result code was successful. Our eventual solution was to display everything in standard text while the command runs but remembering which was stdout & stderr & applying the highlighting only when the result code was non-zero. Occasionally we highlight more than required in that case but most of the time in fatal cases it does pick out just the bad stuff. If only there were 3 defined output streams... :) |
|
@technoweenie I was able to accept the CLA now :-) |
The git lfs pointer output was changed in: git-lfs/git-lfs#1105 This was causing Mac Travis runs to fail, as homebrew had updated to 1.2 while Linux was pinned at 1.1 via GIT_LFS_VERSION. The travis builds against 1.1 and 1.2 both on linux. Mac can't do the same as it takes the latest homebrew version regardless.
Git LFS 1.2.0 removed a line from the output of the 'git lfs pointer' command [1] which broke the parsing of this output. Adjust the parser to the new output and add minimum Git LFS version to the docs. [1] git-lfs/git-lfs#1105 Signed-off-by: Lars Schneider <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
This allows to create a pointer file by redirecting Stdout like
Before this change, "pointer-to-file" would also contain the line saying
which makes the pointer file invalid.