From d6066ce5df2ff5423a48ce7a2a795f9897eb34b9 Mon Sep 17 00:00:00 2001 From: rick Date: Tue, 19 Nov 2013 08:51:04 -0800 Subject: [PATCH] get the path if its available --- README.md | 77 +++-------------------------------------- cmd/git-media-smudge.go | 9 ++++- 2 files changed, 12 insertions(+), 74 deletions(-) diff --git a/README.md b/README.md index 6a163451..d83690ee 100644 --- a/README.md +++ b/README.md @@ -1,75 +1,6 @@ -GitHub Asset Management System -============================== +Git Media +========= -Large file asset management system for GitHub. +Command line tool for managing large files on GitHub. -CLI ---- - -git-media setup - - setup the git-media files - -git-media clean - - SHA file, see if it has changed, save to file if so, output SHA and instructions - -git-media smudge - - copy file from media center if SHA exists, (otherwise error / queue up download?) - -git-media track *.jpg - -- add file path or glob to .gitassets (and .gitattributes) and initial 'git add' - -git-media sync - -- initialize with defaults if it doesn't exist -- finds untracked large files or large files in the index - - adds entry to .gitassets - - adds filter to .gitattributes - - remove from the db after (?) -- scans for changed assets and sends/checks for lock on server -- downloads assets you don't have yet, but need for your current checkout - - re-smudge file if it was smudged without content -- uploads assets you haven't uploaded yet but have committed - -git-media status - -- lists all asset files in HEAD and upload/download/lock status - - estimated file transfer size for next 'sync' command - - only list files with interesting statuses unless --full specified - -git-media view [file] - -- shows version history and comments for a file - -pre-commit hook that checks for large files, exits non-0 if any are too large -warn if something is committed/pushed and not uploaded - - or post-commit to run `git-media sync` (auto-sync setting) - -.gitassets - - project id - - large file size min limit - - file type filter - - list of assets and SHAs - -git-media convert - -- take an existing git repo and filter-branch the large files out - -SERVER ------- - -- accept/send file contents - - project id, path - - full or binary diff (with base SHA) -- show list of assets in a project -- asset: - - version history - - visual diff if possible (cc render team) - - locks - - download - - revert in project (?) - - or create a new branch with this version - - share (?) - - send to campfire - - email to someone -- keep / check for locks +See the [Git Media overview](https://github.com/github/assets-team/blob/master/git-media). diff --git a/cmd/git-media-smudge.go b/cmd/git-media-smudge.go index 3c82f50f..be68706b 100644 --- a/cmd/git-media-smudge.go +++ b/cmd/git-media-smudge.go @@ -14,7 +14,14 @@ func main() { panic(err) } - fmt.Fprintf(os.Stderr, "Downloading media: %s\n", sha) + var path string + if len(os.Args) > 1 { + path = os.Args[1] + } else { + path = sha + } + + fmt.Fprintf(os.Stderr, "Downloading media: %s\n", path) err = gitmediafilters.Smudge(os.Stdout, sha) if err != nil {