git-lfs / git-lfs

Git extension for versioning large files
https://git-lfs.com
Other
12.64k stars 2.01k forks source link

git-lfs prune does not show all info if redirect the output to file. #5710

Closed smallp closed 2 months ago

smallp commented 2 months ago

Describe the bug git-lfs prune does not show all info if redirect the output to file.

To Reproduce Steps to reproduce the behavior:

  1. Run git-lfs prune -d -v > test.txt
  2. Open test.txt.
  3. The result is prune: 12025 local objects, 11188 retained, done.\n* 55fc5f47eaf86ed829e2e4fa1b6e1201d7a1f3607cdf03ff2d53d03f2454666b (6.0 KB), done.

Expected behavior Show all the files that will be deleted.

System environment Windows 10

Output of git lfs env git-lfs/3.5.1 (GitHub; windows amd64; go 1.21.7; git e237bb3a) git version 2.37.1.windows.1

Endpoint=http://127.0.0.1:9999/ (auth=none) LocalWorkingDir= LocalGitDir=.git LocalGitStorageDir=.git LocalMediaDir=.git\lfs\objects LocalReferenceDirs= TempDir=.git\lfs\tmp ConcurrentTransfers=8 TusTransfers=false BasicTransfersOnly=false SkipDownloadErrors=false FetchRecentAlways=false FetchRecentRefsDays=7 FetchRecentCommitsDays=0 FetchRecentRefsIncludeRemotes=true PruneOffsetDays=3 PruneVerifyRemoteAlways=false PruneVerifyUnreachableAlways=false PruneRemoteName=origin LfsStorageDir=.git\lfs AccessDownload=none AccessUpload=none DownloadTransfers=basic,lfs-standalone-file,ssh UploadTransfers=basic,lfs-standalone-file,ssh GIT_ASKPASS=c:\Program Files\Microsoft VS Code\resources\app\extensions\git\dist\askpass.sh git config filter.lfs.process = "git-lfs filter-process" git config filter.lfs.smudge = "git-lfs smudge -- %f" git config filter.lfs.clean = "git-lfs clean -- %f"

bk2204 commented 2 months ago

Hey,

This is because this is considered a progress output and most progress output isn't listed unless standard output is a TTY. If you want to see progress output when standard output isn't a TTY, then you can set GIT_LFS_FORCE_PROGRESS=1 in the environment and all of the progress output will be printed as it would on the terminal.

smallp commented 2 months ago

Got it. Thanks.