From e37b69547710e2a341bc7904d291029ac594b3be Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Thu, 19 Mar 2015 13:30:55 -0600 Subject: [PATCH] rename hawser => git-lfs --- .gitignore | 2 +- CONTRIBUTING.md | 8 +-- README.md | 46 ++++++------- cmd/{git-hawser.go => git-lfs.go} | 2 +- commands/clean_test.go | 4 +- commands/command_add.go | 8 +-- commands/command_clean.go | 12 ++-- commands/command_env.go | 6 +- commands/command_init.go | 10 +-- commands/command_logs.go | 14 ++-- commands/command_ls_files.go | 8 +-- commands/command_path.go | 10 +-- commands/command_push.go | 50 ++++++-------- commands/command_rm.go | 8 +-- commands/command_smudge.go | 10 +-- commands/command_status.go | 16 ++--- commands/command_update.go | 10 +-- commands/command_version.go | 4 +- commands/commands.go | 18 ++--- commands/commands_test.go | 8 +-- commands/env_test.go | 20 +++--- commands/init_test.go | 14 ++-- commands/ls_files_test.go | 4 +- commands/path_test.go | 10 +-- commands/push_test.go | 4 +- commands/repos/attributes.git/config | 2 +- commands/repos/attributes.git/logs/HEAD | 4 +- .../attributes.git/logs/refs/heads/master | 4 +- .../logs/refs/remotes/origin/HEAD | 1 + .../02/21adc0c938c4933212fa7e63c48f6d1c278ea3 | Bin 0 -> 39 bytes .../02/6bc68c9f081e90c9b7daf0125bba074e244517 | Bin 0 -> 59 bytes .../04/9cd355aae20ed014903b57205a1d75b5cc95de | Bin 42 -> 0 bytes .../06/78d1086582e2f79a2093fe4a14a8fe2126057d | Bin 0 -> 39 bytes .../0a/fe8279f991e5f192acb8ac06cc4838fdd60941 | 1 - .../26/c2ef16bedab25eb4b17ecff2a7af7c931249d2 | Bin 0 -> 86 bytes .../2b/7fd914b578c06d091b78e61d6a080ceaddac79 | Bin 0 -> 87 bytes .../3c/c8ad3c26732ebcbca06133b7d51c2853e29af6 | Bin 42 -> 0 bytes .../56/227c2afc943637c2c285832adae4b10be75e07 | Bin 42 -> 0 bytes .../57/b40745b3d6479ad9d9ad0523c1569e183e38ca | Bin 0 -> 162 bytes .../7a/ae26c4771bac634e5c15484657aa439c4ef7e0 | Bin 0 -> 176 bytes .../8a/c387de6a4b59812cfbf88a2afa15d4897f501e | Bin 0 -> 39 bytes .../8f/3e1199844def499785024883350aa212dbd484 | Bin 87 -> 0 bytes .../b6/c47773868a8ece666dfcc2e76ebc3548b6456a | Bin 0 -> 43 bytes .../e4/c07986883be7d6d9111352aefcf64cd33de2e1 | Bin 0 -> 86 bytes .../e6/1ea30acc377fde7e111c8f8f6ff3e739777ab2 | Bin 59 -> 0 bytes .../f7/26fbd4f3edc5ac35c3f5e412de08d00a80e341 | Bin 86 -> 0 bytes commands/repos/attributes.git/packed-refs | 2 + .../repos/attributes.git/refs/heads/master | 2 +- .../attributes.git/refs/remotes/origin/HEAD | 1 + commands/repos/config_media_url.git/config | 6 -- commands/repos/config_media_url.git/logs/HEAD | 3 +- .../logs/refs/heads/master | 3 +- .../00/df65f30b769b694e2a1ca57e054d45d3d8bf9b | 2 - .../35/029765990c216dd9acc23cb58acb1000f89756 | Bin 0 -> 55 bytes .../4e/85f782eded97338bd56f752f955768c06b9c19 | Bin 55 -> 0 bytes .../5d/80e0f5a37e30789582005dd1b87c7ea0bceac4 | Bin 0 -> 44 bytes .../89/ea2bf17b7a9e86085513d3c78b5197fd13a4c1 | 1 - .../d1/e0a8e1530c458f27d4aac7da7d4f3732e9888b | Bin 0 -> 154 bytes .../f2/b485ceec4858078348d376c56e681b393fe753 | Bin 55 -> 0 bytes .../fa/6808de9cbe61a54b3f5b0576ad9d9471497bed | Bin 47 -> 0 bytes .../fb/997f8b3da8eba5bc99f681ba8767dd885646df | Bin 46 -> 0 bytes .../config_media_url.git/refs/heads/master | 2 +- commands/repos/submodule.git/config | 4 +- commands/repos/submodule.git/logs/HEAD | 2 +- .../submodule.git/logs/refs/heads/master | 2 +- .../logs/refs/remotes/origin/HEAD | 2 +- .../submodule.git/modules/attributes/config | 2 +- .../modules/attributes/logs/HEAD | 2 +- .../modules/attributes/logs/refs/heads/master | 2 +- .../attributes/logs/refs/remotes/origin/HEAD | 2 +- commands/smudge_test.go | 18 ++--- commands/status_test.go | 2 +- commands/version_test.go | 8 +-- docs/api.md | 65 +++++++++--------- docs/linux-build.md | 14 ++-- docs/man/git-hawser-add.1.ronn | 14 ++-- docs/man/git-hawser-clean.1.ronn | 10 +-- docs/man/git-hawser-env.1.ronn | 6 +- docs/man/git-hawser-init.1.ronn | 12 ++-- docs/man/git-hawser-logs.1.ronn | 16 ++--- docs/man/git-hawser-ls-files.1.ronn | 10 +-- docs/man/git-hawser-path.1.ronn | 12 ++-- docs/man/git-hawser-push.1.ronn | 8 +-- docs/man/git-hawser-rm.1.ronn | 14 ++-- docs/man/git-hawser-smudge.1.ronn | 10 +-- docs/man/git-hawser-status.1.ronn | 12 ++-- docs/man/git-hawser.1.ronn | 20 +++--- docs/spec.md | 50 +++++++------- {hawser => lfs}/client.go | 2 +- {hawser => lfs}/client_download_test.go | 8 +-- {hawser => lfs}/client_legacy_test.go | 8 +-- {hawser => lfs}/client_test.go | 8 +-- {hawser => lfs}/client_upload_test.go | 4 +- {hawser => lfs}/config.go | 8 +-- {hawser => lfs}/config_test.go | 18 ++--- {hawser => lfs}/credentials.go | 4 +- {hawser => lfs}/credentials_test.go | 2 +- {hawser => lfs}/errors.go | 2 +- {hawser => lfs}/hawser.go | 14 ++-- {hawser => lfs}/http.go | 2 +- {hawser => lfs}/setup.go | 14 ++-- {hawser => lfs}/util.go | 6 +- {hawser => lfs}/util_test.go | 2 +- pointer/clean.go | 8 +-- pointer/pointer.go | 10 +-- pointer/pointer_test.go | 20 +++--- pointer/smudge.go | 28 ++++---- scanner/scanner.go | 19 +++-- script/bootstrap | 2 +- script/build.go | 6 +- script/install.sh.example | 4 +- script/release.go | 6 +- script/run | 2 +- script/test | 2 +- 114 files changed, 425 insertions(+), 443 deletions(-) rename cmd/{git-hawser.go => git-lfs.go} (58%) mode change 100755 => 100644 commands/repos/attributes.git/config create mode 100644 commands/repos/attributes.git/logs/refs/remotes/origin/HEAD create mode 100644 commands/repos/attributes.git/objects/02/21adc0c938c4933212fa7e63c48f6d1c278ea3 create mode 100644 commands/repos/attributes.git/objects/02/6bc68c9f081e90c9b7daf0125bba074e244517 delete mode 100644 commands/repos/attributes.git/objects/04/9cd355aae20ed014903b57205a1d75b5cc95de create mode 100644 commands/repos/attributes.git/objects/06/78d1086582e2f79a2093fe4a14a8fe2126057d delete mode 100644 commands/repos/attributes.git/objects/0a/fe8279f991e5f192acb8ac06cc4838fdd60941 create mode 100644 commands/repos/attributes.git/objects/26/c2ef16bedab25eb4b17ecff2a7af7c931249d2 create mode 100644 commands/repos/attributes.git/objects/2b/7fd914b578c06d091b78e61d6a080ceaddac79 delete mode 100644 commands/repos/attributes.git/objects/3c/c8ad3c26732ebcbca06133b7d51c2853e29af6 delete mode 100644 commands/repos/attributes.git/objects/56/227c2afc943637c2c285832adae4b10be75e07 create mode 100644 commands/repos/attributes.git/objects/57/b40745b3d6479ad9d9ad0523c1569e183e38ca create mode 100644 commands/repos/attributes.git/objects/7a/ae26c4771bac634e5c15484657aa439c4ef7e0 create mode 100644 commands/repos/attributes.git/objects/8a/c387de6a4b59812cfbf88a2afa15d4897f501e delete mode 100644 commands/repos/attributes.git/objects/8f/3e1199844def499785024883350aa212dbd484 create mode 100644 commands/repos/attributes.git/objects/b6/c47773868a8ece666dfcc2e76ebc3548b6456a create mode 100644 commands/repos/attributes.git/objects/e4/c07986883be7d6d9111352aefcf64cd33de2e1 delete mode 100644 commands/repos/attributes.git/objects/e6/1ea30acc377fde7e111c8f8f6ff3e739777ab2 delete mode 100644 commands/repos/attributes.git/objects/f7/26fbd4f3edc5ac35c3f5e412de08d00a80e341 create mode 100644 commands/repos/attributes.git/packed-refs create mode 100644 commands/repos/attributes.git/refs/remotes/origin/HEAD mode change 100755 => 100644 commands/repos/config_media_url.git/config delete mode 100644 commands/repos/config_media_url.git/objects/00/df65f30b769b694e2a1ca57e054d45d3d8bf9b create mode 100644 commands/repos/config_media_url.git/objects/35/029765990c216dd9acc23cb58acb1000f89756 delete mode 100644 commands/repos/config_media_url.git/objects/4e/85f782eded97338bd56f752f955768c06b9c19 create mode 100644 commands/repos/config_media_url.git/objects/5d/80e0f5a37e30789582005dd1b87c7ea0bceac4 delete mode 100644 commands/repos/config_media_url.git/objects/89/ea2bf17b7a9e86085513d3c78b5197fd13a4c1 create mode 100644 commands/repos/config_media_url.git/objects/d1/e0a8e1530c458f27d4aac7da7d4f3732e9888b delete mode 100644 commands/repos/config_media_url.git/objects/f2/b485ceec4858078348d376c56e681b393fe753 delete mode 100644 commands/repos/config_media_url.git/objects/fa/6808de9cbe61a54b3f5b0576ad9d9471497bed delete mode 100644 commands/repos/config_media_url.git/objects/fb/997f8b3da8eba5bc99f681ba8767dd885646df rename {hawser => lfs}/client.go (99%) rename {hawser => lfs}/client_download_test.go (95%) rename {hawser => lfs}/client_legacy_test.go (93%) rename {hawser => lfs}/client_test.go (95%) rename {hawser => lfs}/client_upload_test.go (97%) rename {hawser => lfs}/config.go (94%) rename {hawser => lfs}/config_test.go (90%) rename {hawser => lfs}/credentials.go (95%) rename {hawser => lfs}/credentials_test.go (99%) rename {hawser => lfs}/errors.go (98%) rename {hawser => lfs}/hawser.go (91%) rename {hawser => lfs}/http.go (99%) rename {hawser => lfs}/setup.go (82%) rename {hawser => lfs}/util.go (93%) rename {hawser => lfs}/util_test.go (98%) diff --git a/.gitignore b/.gitignore index d08fc429..0741d3ed 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,7 @@ bin/ benchmark/ .vendor/pkg servertest -.vendor/src/github.com/hawser/git-hawser +.vendor/src/github.com/github/git-lfs # only allow man/*.\d.ronn files man/* diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 367e4dcc..6c20d8ca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,4 @@ -## Contributing to Git Hawser +## Contributing to Git Large File Storage Hi there! We're thrilled that you'd like to contribute to this project. Your help is essential for keeping it great. @@ -27,7 +27,7 @@ them as separate pull requests. 0. Update `Godeps`. 0. Run `script/vendor` to update the code in the `.vendor/src` directory. -0. Commit the change. Hawser vendors the full source code in the repository. +0. Commit the change. Git LFS vendors the full source code in the repository. 0. Submit a pull request. ## Resources @@ -36,6 +36,6 @@ them as separate pull requests. - [Using Pull Requests](https://help.github.com/articles/using-pull-requests/) - [GitHub Help](https://help.github.com) -[fork]: https://github.com/hawser/git-hawser/fork -[pr]: https://github.com/hawser/git-hawser/compare +[fork]: https://github.com/github/git-lfs/fork +[pr]: https://github.com/github/git-lfs/compare [style]: https://github.com/golang/go/wiki/CodeReviewComments diff --git a/README.md b/README.md index 61caa846..1bdc04fd 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,50 @@ -Git Hawser +Git Large File Storage ====== -Git command line extension for managing large files. Hawser replaces large -files with text pointers inside Git, while storing the actual files in a remote -Hawser server. +Git LFS is a command line extension for managing large files. It replaces +large files with text pointers inside Git, while storing the actual files in a +remote Git LFS server. -The Git Hawser client is written in Go, with pre-compiled binaries available for +The Git LFS client is written in Go, with pre-compiled binaries available for Mac, Windows, Linux, and FreeBSD. -See [CONTRIBUTING.md](CONTRIBUTING.md) for info on working on Hawser and sending -patches. +See [CONTRIBUTING.md](CONTRIBUTING.md) for info on working on Git LFS and +sending patches. ## Getting Started Download the [latest client][rel] and run the included install script. The -installer should run `git hawser init` for you, which sets up Git's global -configuration settings for Hawser. +installer should run `git lfs init` for you, which sets up Git's global +configuration settings for Git LFS. -[rel]: https://github.com/hawser/git-hawser/releases +[rel]: https://github.com/github/git-lfs/releases ### Configuration -Hawser uses `.gitattributes` files to configure which are managed by Hawser. +Git LFS uses `.gitattributes` files to configure which are managed by Git LFS. Here is a sample one that saves zips and mp3s: $ cat .gitattributes - *.mp3 filter=hawser -crlf - *.zip filter=hawser -crlf + *.mp3 filter=lfs -crlf + *.zip filter=lfs -crlf -Hawser can help manage the paths: +Git LFS can help manage the paths: - $ git hawser add "*.mp3" + $ git lfs add "*.mp3" Adding path *.mp3 - $ git hawser add "*.zip" + $ git lfs add "*.zip" Adding path *.zip - $ git hawser path + $ git lfs path Listing paths *.mp3 (.gitattributes) *.zip (.gitattributes) - $ git hawser remove "*.zip" + $ git lfs remove "*.zip" Removing path *.zip - $ git hawser path + $ git lfs path Listing paths *.mp3 (.gitattributes) @@ -55,9 +55,9 @@ Once setup, you're ready to push some commits. $ git add my.zip $ git commit -m "add zip" -You can confirm that Hawser is managing your zip file: +You can confirm that Git LFS is managing your zip file: - $ git hawser ls-files + $ git lfs ls-files my.zip Once you've made your commits, push your files to the Git remote. @@ -70,7 +70,7 @@ Once you've made your commits, push your files to the Git remote. Compressing objects: 100% (5/5), done. Writing objects: 100% (5/5), 548 bytes | 0 bytes/s, done. Total 5 (delta 1), reused 0 (delta 0) - To https://github.com/hawser/hawser-test + To https://github.com/github/git-lfs-test 67fcf6a..47b2002 master -> master -See the [Hawser overview](https://github.com/hawser/git-hawser/tree/master/docs) and [man pages](https://github.com/hawser/git-hawser/tree/master/docs/man). +See the [Git LFS overview](https://github.com/github/git-lfs/tree/master/docs) and [man pages](https://github.com/github/git-lfs/tree/master/docs/man). diff --git a/cmd/git-hawser.go b/cmd/git-lfs.go similarity index 58% rename from cmd/git-hawser.go rename to cmd/git-lfs.go index 04087697..fc0f39c2 100644 --- a/cmd/git-hawser.go +++ b/cmd/git-lfs.go @@ -1,7 +1,7 @@ package main import ( - "github.com/hawser/git-hawser/commands" + "github.com/github/git-lfs/commands" ) func main() { diff --git a/commands/clean_test.go b/commands/clean_test.go index b067509f..149cdea0 100644 --- a/commands/clean_test.go +++ b/commands/clean_test.go @@ -19,7 +19,7 @@ func TestClean(t *testing.T) { cmd := repo.Command("clean", "somefile") cmd.Input = bytes.NewBufferString(content) - cmd.Output = `version https://hawser.github.com/spec/v1 + cmd.Output = `version https://git-lfs.github.com/spec/v1 oid sha256:` + oid + ` size 3` @@ -32,7 +32,7 @@ size 3` cmd = repo.Command("clean") cmd.Input = bytes.NewBufferString(content) - cmd.Output = `version https://hawser.github.com/spec/v1 + cmd.Output = `version https://git-lfs.github.com/spec/v1 oid sha256:` + oid + ` size 3` customHook := []byte("echo 'yo'") diff --git a/commands/command_add.go b/commands/command_add.go index d98c439e..b366bd0b 100644 --- a/commands/command_add.go +++ b/commands/command_add.go @@ -2,7 +2,7 @@ package commands import ( "fmt" - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "github.com/spf13/cobra" "io" "os" @@ -18,10 +18,10 @@ var ( ) func addCommand(cmd *cobra.Command, args []string) { - hawser.InstallHooks(false) + lfs.InstallHooks(false) if len(args) < 1 { - Print("git hawser path add [path]*") + Print("git lfs path add [path]*") return } @@ -52,7 +52,7 @@ func addCommand(cmd *cobra.Command, args []string) { continue } - _, err := attributesFile.WriteString(fmt.Sprintf("%s filter=hawser -crlf\n", t)) + _, err := attributesFile.WriteString(fmt.Sprintf("%s filter=lfs -crlf\n", t)) if err != nil { Print("Error adding path %s", t) continue diff --git a/commands/command_clean.go b/commands/command_clean.go index d6f23e69..e361612b 100644 --- a/commands/command_clean.go +++ b/commands/command_clean.go @@ -1,8 +1,8 @@ package commands import ( - "github.com/hawser/git-hawser/hawser" - "github.com/hawser/git-hawser/pointer" + "github.com/github/git-lfs/lfs" + "github.com/github/git-lfs/pointer" "github.com/spf13/cobra" "os" ) @@ -16,10 +16,10 @@ var ( ) func cleanCommand(cmd *cobra.Command, args []string) { - hawser.InstallHooks(false) + lfs.InstallHooks(false) var filename string - var cb hawser.CopyCallback + var cb lfs.CopyCallback var file *os.File var fileSize int64 if len(args) > 0 { @@ -29,7 +29,7 @@ func cleanCommand(cmd *cobra.Command, args []string) { if err == nil && stat != nil { fileSize = stat.Size() - localCb, localFile, err := hawser.CopyCallbackFile("clean", filename, 1, 1) + localCb, localFile, err := lfs.CopyCallbackFile("clean", filename, 1, 1) if err != nil { Error(err.Error()) } else { @@ -51,7 +51,7 @@ func cleanCommand(cmd *cobra.Command, args []string) { } tmpfile := cleaned.File.Name() - mediafile, err := hawser.LocalMediaPath(cleaned.Oid) + mediafile, err := lfs.LocalMediaPath(cleaned.Oid) if err != nil { Panic(err, "Unable to get local media path.") } diff --git a/commands/command_env.go b/commands/command_env.go index 790820f7..95d17a94 100644 --- a/commands/command_env.go +++ b/commands/command_env.go @@ -1,7 +1,7 @@ package commands import ( - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "github.com/spf13/cobra" ) @@ -14,7 +14,7 @@ var ( ) func envCommand(cmd *cobra.Command, args []string) { - config := hawser.Config + config := lfs.Config if endpoint := config.Endpoint(); len(endpoint) > 0 { Print("Endpoint=%s", endpoint) @@ -24,7 +24,7 @@ func envCommand(cmd *cobra.Command, args []string) { Print("Endpoint (%s)=%s", remote, config.RemoteEndpoint(remote)) } - for _, env := range hawser.Environ() { + for _, env := range lfs.Environ() { Print(env) } } diff --git a/commands/command_init.go b/commands/command_init.go index 7f7734b8..9197fd95 100644 --- a/commands/command_init.go +++ b/commands/command_init.go @@ -1,7 +1,7 @@ package commands import ( - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "github.com/spf13/cobra" ) @@ -20,19 +20,19 @@ var ( ) func initCommand(cmd *cobra.Command, args []string) { - if err := hawser.InstallFilters(); err != nil { + if err := lfs.InstallFilters(); err != nil { Error(err.Error()) } - if hawser.InRepo() { + if lfs.InRepo() { initHooksCommand(cmd, args) } - Print("git hawser initialized") + Print("git lfs initialized") } func initHooksCommand(cmd *cobra.Command, args []string) { - if err := hawser.InstallHooks(false); err != nil { + if err := lfs.InstallHooks(false); err != nil { Error(err.Error()) } } diff --git a/commands/command_logs.go b/commands/command_logs.go index 8f1c3bba..9d32b1da 100644 --- a/commands/command_logs.go +++ b/commands/command_logs.go @@ -2,7 +2,7 @@ package commands import ( "errors" - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "github.com/spf13/cobra" "io/ioutil" "os" @@ -64,7 +64,7 @@ func logsShowCommand(cmd *cobra.Command, args []string) { } name := args[0] - by, err := ioutil.ReadFile(filepath.Join(hawser.LocalLogDir, name)) + by, err := ioutil.ReadFile(filepath.Join(lfs.LocalLogDir, name)) if err != nil { Exit("Error reading log: %s", name) } @@ -74,23 +74,23 @@ func logsShowCommand(cmd *cobra.Command, args []string) { } func logsClearCommand(cmd *cobra.Command, args []string) { - err := os.RemoveAll(hawser.LocalLogDir) + err := os.RemoveAll(lfs.LocalLogDir) if err != nil { - Panic(err, "Error clearing %s", hawser.LocalLogDir) + Panic(err, "Error clearing %s", lfs.LocalLogDir) } - Print("Cleared %s", hawser.LocalLogDir) + Print("Cleared %s", lfs.LocalLogDir) } func logsBoomtownCommand(cmd *cobra.Command, args []string) { Debug("Debug message") - err := hawser.Errorf(errors.New("Inner error message!"), "Error!") + err := lfs.Errorf(errors.New("Inner error message!"), "Error!") Panic(err, "Welcome to Boomtown") Debug("Never seen") } func sortedLogs() []string { - fileinfos, err := ioutil.ReadDir(hawser.LocalLogDir) + fileinfos, err := ioutil.ReadDir(lfs.LocalLogDir) if err != nil { return []string{} } diff --git a/commands/command_ls_files.go b/commands/command_ls_files.go index dbb8563b..aeaf9a65 100644 --- a/commands/command_ls_files.go +++ b/commands/command_ls_files.go @@ -1,15 +1,15 @@ package commands import ( - "github.com/hawser/git-hawser/git" - "github.com/hawser/git-hawser/scanner" + "github.com/github/git-lfs/git" + "github.com/github/git-lfs/scanner" "github.com/spf13/cobra" ) var ( lsFilesCmd = &cobra.Command{ Use: "ls-files", - Short: "Show information about hawser files", + Short: "Show information about Git LFS files", Run: lsFilesCommand, } ) @@ -29,7 +29,7 @@ func lsFilesCommand(cmd *cobra.Command, args []string) { pointers, err := scanner.Scan(ref, "") if err != nil { - Panic(err, "Could not scan for hawser files") + Panic(err, "Could not scan for Git LFS files") } for _, p := range pointers { diff --git a/commands/command_path.go b/commands/command_path.go index 349d0f5b..d53c06bb 100644 --- a/commands/command_path.go +++ b/commands/command_path.go @@ -2,7 +2,7 @@ package commands import ( "bufio" - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "github.com/spf13/cobra" "os" "path/filepath" @@ -18,7 +18,7 @@ var ( ) func pathCommand(cmd *cobra.Command, args []string) { - hawser.InstallHooks(false) + lfs.InstallHooks(false) Print("Listing paths") knownPaths := findPaths() @@ -35,12 +35,12 @@ type mediaPath struct { func findAttributeFiles() []string { paths := make([]string, 0) - repoAttributes := filepath.Join(hawser.LocalGitDir, "info", "attributes") + repoAttributes := filepath.Join(lfs.LocalGitDir, "info", "attributes") if _, err := os.Stat(repoAttributes); err == nil { paths = append(paths, repoAttributes) } - filepath.Walk(hawser.LocalWorkingDir, func(path string, info os.FileInfo, err error) error { + filepath.Walk(lfs.LocalWorkingDir, func(path string, info os.FileInfo, err error) error { if err != nil { return err } @@ -71,7 +71,7 @@ func findPaths() []mediaPath { continue } - if strings.Contains(line, "filter=hawser") { + if strings.Contains(line, "filter=lfs") { fields := strings.Fields(line) relPath, _ := filepath.Rel(wd, path) paths = append(paths, mediaPath{Path: fields[0], Source: relPath}) diff --git a/commands/command_push.go b/commands/command_push.go index 3bbd9e90..2a8451a1 100644 --- a/commands/command_push.go +++ b/commands/command_push.go @@ -2,10 +2,10 @@ package commands import ( "fmt" - "github.com/hawser/git-hawser/git" - "github.com/hawser/git-hawser/hawser" - "github.com/hawser/git-hawser/pointer" - "github.com/hawser/git-hawser/scanner" + "github.com/github/git-lfs/git" + "github.com/github/git-lfs/lfs" + "github.com/github/git-lfs/pointer" + "github.com/github/git-lfs/scanner" "github.com/rubyist/tracerx" "github.com/spf13/cobra" "io/ioutil" @@ -17,7 +17,7 @@ import ( var ( pushCmd = &cobra.Command{ Use: "push", - Short: "Push files to the hawser endpoint", + Short: "Push files to the Git LFS endpoint", Run: pushCommand, } dryRun = false @@ -25,7 +25,7 @@ var ( deleteBranch = "(delete)" ) -// pushCommand is the command that's run via `git hawser push`. It has two modes +// pushCommand is the command that's run via `git lfs push`. It has two modes // of operation. The primary mode is run via the git pre-push hook. The pre-push // hook passes two arguments on the command line: // 1. Name of the remote to which the push is being done @@ -38,20 +38,15 @@ var ( // by using the following: // git rev-list --objects ^ // -// If any of those git objects are associated with hawser objects, those hawser -// objects will be pushed to the hawser endpoint. +// If any of those git objects are associated with Git LFS objects, those +// objects will be pushed to the Git LFS API. // // In the case of pushing a new branch, the list of git objects will be all of // the git objects in this branch. // -// In the case of deleting a branch, no attempts to push hawser objects will be +// In the case of deleting a branch, no attempts to push Git LFS objects will be // made. // -// When pushing hawser objects, the client will first perform an OPTIONS command -// which will determine not only whether or not the client is authorized, but also -// whether or not that hawser endpoint already has the hawser object. If it -// does, the object will not be pushed. -// // The other mode of operation is the dry run mode. In this mode, the repo // and refspec are passed on the command line. pushCommand will calculate the // git objects that would be pushed in a similar manner as above and will print @@ -60,11 +55,11 @@ func pushCommand(cmd *cobra.Command, args []string) { var left, right string if len(args) == 0 { - Print("The git hawser pre-push hook is out of date. Please run `git hawser update`") + Print("The git lfs pre-push hook is out of date. Please run `git lfs update`") os.Exit(1) } - hawser.Config.CurrentRemote = args[0] + lfs.Config.CurrentRemote = args[0] if useStdin { refsData, err := ioutil.ReadAll(os.Stdin) @@ -84,7 +79,7 @@ func pushCommand(cmd *cobra.Command, args []string) { var repo, refspec string if len(args) < 1 { - Print("Usage: git hawser push --dry-run [refspec]") + Print("Usage: git lfs push --dry-run [refspec]") return } @@ -112,7 +107,7 @@ func pushCommand(cmd *cobra.Command, args []string) { // Just use scanner here pointers, err := scanner.Scan(left, right) if err != nil { - Panic(err, "Error scanning for hawser files") + Panic(err, "Error scanning for Git LFS files") } for i, pointer := range pointers { @@ -130,22 +125,19 @@ func pushCommand(cmd *cobra.Command, args []string) { } } -// pushAsset pushes the asset with the given oid to the hawser endpoint. It will -// first make an OPTIONS call. If OPTIONS returns a 200 status, it indicates that the -// hawser endpoint already has a hawser object for that oid. The object will -// not be pushed again. -func pushAsset(oid, filename string, index, totalFiles int) *hawser.WrappedError { +// pushAsset pushes the asset with the given oid to the Git LFS API. +func pushAsset(oid, filename string, index, totalFiles int) *lfs.WrappedError { tracerx.Printf("checking_asset: %s %s %d/%d", oid, filename, index, totalFiles) - path, err := hawser.LocalMediaPath(oid) + path, err := lfs.LocalMediaPath(oid) if err != nil { - return hawser.Errorf(err, "Error uploading file %s (%s)", filename, oid) + return lfs.Errorf(err, "Error uploading file %s (%s)", filename, oid) } if err := ensureFile(filename, path); err != nil { - return hawser.Errorf(err, "Error uploading file %s (%s)", filename, oid) + return lfs.Errorf(err, "Error uploading file %s (%s)", filename, oid) } - cb, file, cbErr := hawser.CopyCallbackFile("push", filename, index, totalFiles) + cb, file, cbErr := lfs.CopyCallbackFile("push", filename, index, totalFiles) if cbErr != nil { Error(cbErr.Error()) } @@ -154,7 +146,7 @@ func pushAsset(oid, filename string, index, totalFiles int) *hawser.WrappedError defer file.Close() } - return hawser.Upload(path, filename, cb) + return lfs.Upload(path, filename, cb) } // ensureFile makes sure that the cleanPath exists before pushing it. If it @@ -165,7 +157,7 @@ func ensureFile(smudgePath, cleanPath string) error { } expectedOid := filepath.Base(cleanPath) - localPath := filepath.Join(hawser.LocalWorkingDir, smudgePath) + localPath := filepath.Join(lfs.LocalWorkingDir, smudgePath) file, err := os.Open(localPath) if err != nil { return err diff --git a/commands/command_rm.go b/commands/command_rm.go index b5b103c1..d59c9dad 100644 --- a/commands/command_rm.go +++ b/commands/command_rm.go @@ -2,7 +2,7 @@ package commands import ( "bufio" - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "github.com/spf13/cobra" "io/ioutil" "os" @@ -24,10 +24,10 @@ var ( ) func removeCommand(cmd *cobra.Command, args []string) { - hawser.InstallHooks(false) + lfs.InstallHooks(false) if len(args) < 1 { - Print("git hawser path rm [path]*") + Print("git lfs path rm [path]*") return } @@ -47,7 +47,7 @@ func removeCommand(cmd *cobra.Command, args []string) { scanner := bufio.NewScanner(attributes) for scanner.Scan() { line := scanner.Text() - if strings.Contains(line, "filter=hawser") { + if strings.Contains(line, "filter=lfs") { fields := strings.Fields(line) removeThisPath := false for _, t := range args { diff --git a/commands/command_smudge.go b/commands/command_smudge.go index 920aa404..244cfe2e 100644 --- a/commands/command_smudge.go +++ b/commands/command_smudge.go @@ -2,8 +2,8 @@ package commands import ( "bytes" - "github.com/hawser/git-hawser/hawser" - "github.com/hawser/git-hawser/pointer" + "github.com/github/git-lfs/lfs" + "github.com/github/git-lfs/pointer" "github.com/spf13/cobra" "io" "os" @@ -20,7 +20,7 @@ var ( ) func smudgeCommand(cmd *cobra.Command, args []string) { - hawser.InstallHooks(false) + lfs.InstallHooks(false) b := &bytes.Buffer{} r := io.TeeReader(os.Stdin, b) @@ -36,7 +36,7 @@ func smudgeCommand(cmd *cobra.Command, args []string) { } if smudgeInfo { - localPath, err := hawser.LocalMediaPath(ptr.Oid) + localPath, err := lfs.LocalMediaPath(ptr.Oid) if err != nil { Exit(err.Error()) } @@ -51,7 +51,7 @@ func smudgeCommand(cmd *cobra.Command, args []string) { } filename := smudgeFilename(args, err) - cb, file, err := hawser.CopyCallbackFile("smudge", filename, 1, 1) + cb, file, err := lfs.CopyCallbackFile("smudge", filename, 1, 1) if err != nil { Error(err.Error()) } diff --git a/commands/command_status.go b/commands/command_status.go index e560d7b2..170e004d 100644 --- a/commands/command_status.go +++ b/commands/command_status.go @@ -2,15 +2,15 @@ package commands import ( "fmt" - "github.com/hawser/git-hawser/git" - "github.com/hawser/git-hawser/scanner" + "github.com/github/git-lfs/git" + "github.com/github/git-lfs/scanner" "github.com/spf13/cobra" ) var ( statusCmd = &cobra.Command{ Use: "status", - Short: "Show information about hawser files that would be pushed", + Short: "Show information about Git LFS objects that would be pushed", Run: statusCommand, } porcelain = false @@ -24,7 +24,7 @@ func statusCommand(cmd *cobra.Command, args []string) { stagedPointers, err := scanner.ScanIndex() if err != nil { - Panic(err, "Could not scan staging for hawser files") + Panic(err, "Could not scan staging for Git LFS objects") } if porcelain { @@ -52,7 +52,7 @@ func statusCommand(cmd *cobra.Command, args []string) { pointers, err := scanner.Scan(ref, "^"+remoteRef) if err != nil { - Panic(err, "Could not scan for hawser files") + Panic(err, "Could not scan for Git LFS objects") } remote, err := git.CurrentRemote() @@ -60,13 +60,13 @@ func statusCommand(cmd *cobra.Command, args []string) { Panic(err, "Could not get current remote branch") } - Print("Hawser file changes to be pushed to %s:\n", remote) + Print("Git LFS objects to be pushed to %s:\n", remote) for _, p := range pointers { Print("\t%s (%s)", p.Name, humanizeBytes(p.Size)) } } - Print("\nHawser file changes to be committed:\n") + Print("\nGit LFS objects to be committed:\n") for _, p := range stagedPointers { switch p.Status { case "R", "C": @@ -77,7 +77,7 @@ func statusCommand(cmd *cobra.Command, args []string) { } } - Print("\nHawser file changes not staged for commit:\n") + Print("\nGit LFS objects not staged for commit:\n") for _, p := range stagedPointers { if p.Status == "M" { Print("\t%s", p.Name) diff --git a/commands/command_update.go b/commands/command_update.go index f9dbf25a..9c599d72 100644 --- a/commands/command_update.go +++ b/commands/command_update.go @@ -1,27 +1,27 @@ package commands import ( - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "github.com/spf13/cobra" ) var ( updateCmd = &cobra.Command{ Use: "update", - Short: "Update local hawser configuration", + Short: "Update local Git LFS configuration", Run: updateCommand, } ) -// updateCommand is used for updating parts of hawser that reside -// under .git/hawser. +// updateCommand is used for updating parts of Git LFS that reside under +// .git/lfs. func updateCommand(cmd *cobra.Command, args []string) { updatePrePushHook() } // updatePrePushHook will force an update of the pre-push hook. func updatePrePushHook() { - hawser.InstallHooks(true) + lfs.InstallHooks(true) Print("Updated pre-push hook") } diff --git a/commands/command_version.go b/commands/command_version.go index 734e8066..309aa386 100644 --- a/commands/command_version.go +++ b/commands/command_version.go @@ -1,7 +1,7 @@ package commands import ( - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "github.com/spf13/cobra" ) @@ -16,7 +16,7 @@ var ( ) func versionCommand(cmd *cobra.Command, args []string) { - Print(hawser.UserAgent) + Print(lfs.UserAgent) if lovesComics { Print("Nothing may see Gah Lak Tus and survive!") diff --git a/commands/commands.go b/commands/commands.go index 2e271bfc..93b6521f 100644 --- a/commands/commands.go +++ b/commands/commands.go @@ -3,7 +3,7 @@ package commands import ( "bytes" "fmt" - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "github.com/spf13/cobra" "io" "log" @@ -20,8 +20,8 @@ var ( ErrorWriter = io.MultiWriter(os.Stderr, ErrorBuffer) OutputWriter = io.MultiWriter(os.Stdout, ErrorBuffer) RootCmd = &cobra.Command{ - Use: "git-hawser", - Short: "Hawser provides large file support to Git.", + Use: "git-lfs", + Short: "Git LFS provides large file storage to Git.", Run: func(cmd *cobra.Command, args []string) { versionCommand(cmd, args) cmd.Usage() @@ -65,7 +65,7 @@ func LoggedError(err error, format string, args ...interface{}) { file := handlePanic(err) if len(file) > 0 { - fmt.Fprintf(os.Stderr, "\nErrors logged to %s.\nUse `git hawser logs last` to view the log.\n", file) + fmt.Fprintf(os.Stderr, "\nErrors logged to %s.\nUse `git lfs logs last` to view the log.\n", file) } } @@ -101,7 +101,7 @@ func handlePanic(err error) string { } func logEnv(w io.Writer) { - for _, env := range hawser.Environ() { + for _, env := range lfs.Environ() { fmt.Fprintln(w, env) } } @@ -109,14 +109,14 @@ func logEnv(w io.Writer) { func logPanic(loggedError error, recursive bool) string { var fmtWriter io.Writer = os.Stderr - if err := os.MkdirAll(hawser.LocalLogDir, 0755); err != nil { - fmt.Fprintf(fmtWriter, "Unable to log panic to %s: %s\n\n", hawser.LocalLogDir, err.Error()) + if err := os.MkdirAll(lfs.LocalLogDir, 0755); err != nil { + fmt.Fprintf(fmtWriter, "Unable to log panic to %s: %s\n\n", lfs.LocalLogDir, err.Error()) return "" } now := time.Now() name := now.Format("20060102T150405.999999999") - full := filepath.Join(hawser.LocalLogDir, name+".log") + full := filepath.Join(lfs.LocalLogDir, name+".log") file, err := os.Create(full) if err == nil { @@ -145,7 +145,7 @@ func logPanic(loggedError error, recursive bool) string { } fmtWriter.Write(wErr.Stack()) } else { - fmtWriter.Write(hawser.Stack()) + fmtWriter.Write(lfs.Stack()) } if err != nil && !recursive { diff --git a/commands/commands_test.go b/commands/commands_test.go index 227a86cc..5b039b4e 100644 --- a/commands/commands_test.go +++ b/commands/commands_test.go @@ -149,7 +149,7 @@ type TestCommand struct { } func (c *TestCommand) Run(path string) { - fmt.Println("$ git hawser", strings.Join(c.Args, " ")) + fmt.Println("$ git lfs", strings.Join(c.Args, " ")) for _, cb := range c.BeforeCallbacks { cb() @@ -221,7 +221,7 @@ func clone(t *testing.T, name, path string) { cmd(t, "git", "clone", name, path) e(t, os.Chdir(path)) cmd(t, "git", "remote", "remove", "origin") - cmd(t, "git", "remote", "add", "origin", "https://example.com/git/hawser") + cmd(t, "git", "remote", "add", "origin", "https://example.com/git/lfs") } func init() { @@ -231,8 +231,8 @@ func init() { } Root = filepath.Join(wd, "..") - Bin = filepath.Join(Root, "bin", "git-hawser") - TempDir = filepath.Join(os.TempDir(), "hawser-tests") + Bin = filepath.Join(Root, "bin", "git-lfs") + TempDir = filepath.Join(os.TempDir(), "git-lfs-tests") env := os.Environ() GitEnv = make([]string, 0, len(env)) diff --git a/commands/env_test.go b/commands/env_test.go index c75f1969..f05d804e 100644 --- a/commands/env_test.go +++ b/commands/env_test.go @@ -16,11 +16,11 @@ func TestEnv(t *testing.T) { cmd := repo.Command("env") SetConfigOutput(cmd, map[string]string{ - "Endpoint": "https://example.com/git/hawser.git/info/media", + "Endpoint": "https://example.com/git/lfs.git/info/media", "LocalWorkingDir": repo.Path, "LocalGitDir": filepath.Join(repo.Path, ".git"), - "LocalMediaDir": filepath.Join(repo.Path, ".git", "hawser", "objects"), - "TempDir": filepath.Join(repo.Path, ".git", "hawser", "tmp"), + "LocalMediaDir": filepath.Join(repo.Path, ".git", "lfs", "objects"), + "TempDir": filepath.Join(repo.Path, ".git", "lfs", "tmp"), }) } @@ -33,8 +33,8 @@ func TestEnvWithMediaUrl(t *testing.T) { "Endpoint": "http://foo/bar", "LocalWorkingDir": repo.Path, "LocalGitDir": filepath.Join(repo.Path, ".git"), - "LocalMediaDir": filepath.Join(repo.Path, ".git", "hawser", "objects"), - "TempDir": filepath.Join(repo.Path, ".git", "hawser", "tmp"), + "LocalMediaDir": filepath.Join(repo.Path, ".git", "lfs", "objects"), + "TempDir": filepath.Join(repo.Path, ".git", "lfs", "tmp"), }) } @@ -44,11 +44,11 @@ func TestEnvWithSubmoduleFromRepository(t *testing.T) { cmd := repo.Command("env") SetConfigOutput(cmd, map[string]string{ - "Endpoint": "https://example.com/git/hawser.git/info/media", + "Endpoint": "https://example.com/git/lfs.git/info/media", "LocalWorkingDir": repo.Path, "LocalGitDir": filepath.Join(repo.Path, ".git"), - "LocalMediaDir": filepath.Join(repo.Path, ".git", "hawser", "objects"), - "TempDir": filepath.Join(repo.Path, ".git", "hawser", "tmp"), + "LocalMediaDir": filepath.Join(repo.Path, ".git", "lfs", "objects"), + "TempDir": filepath.Join(repo.Path, ".git", "lfs", "tmp"), }) cmd.Before(func() { @@ -88,8 +88,8 @@ func TestEnvWithConfiguredSubmodule(t *testing.T) { "Endpoint": "http://foo/bar", "LocalWorkingDir": filepath.Join(repo.Path, "config_media_url"), "LocalGitDir": filepath.Join(repo.Path, ".git", "modules", "config_media_url"), - "LocalMediaDir": filepath.Join(repo.Path, ".git", "modules", "config_media_url", "hawser", "objects"), - "TempDir": filepath.Join(repo.Path, ".git", "modules", "config_media_url", "hawser", "tmp"), + "LocalMediaDir": filepath.Join(repo.Path, ".git", "modules", "config_media_url", "lfs", "objects"), + "TempDir": filepath.Join(repo.Path, ".git", "modules", "config_media_url", "lfs", "tmp"), }) cmd.Before(func() { diff --git a/commands/init_test.go b/commands/init_test.go index 62a478fe..e76c902c 100644 --- a/commands/init_test.go +++ b/commands/init_test.go @@ -17,7 +17,7 @@ func TestInit(t *testing.T) { repo.AddPath(repo.Path, "subdir") cmd := repo.Command("init") - cmd.Output = "git hawser initialized" + cmd.Output = "git lfs initialized" prePushHookFile := filepath.Join(repo.Path, ".git", "hooks", "pre-push") @@ -27,14 +27,14 @@ func TestInit(t *testing.T) { }) cmd.After(func() { - // assert hawser filter config + // assert filter config configs := GlobalGitConfig(t) - AssertIncludeString(t, "filter.hawser.clean=git hawser clean %f", configs) - AssertIncludeString(t, "filter.hawser.smudge=git hawser smudge %f", configs) - AssertIncludeString(t, "filter.hawser.required=true", configs) + AssertIncludeString(t, "filter.lfs.clean=git lfs clean %f", configs) + AssertIncludeString(t, "filter.lfs.smudge=git lfs smudge %f", configs) + AssertIncludeString(t, "filter.lfs.required=true", configs) found := 0 for _, line := range configs { - if strings.HasPrefix(line, "filter.hawser") { + if strings.HasPrefix(line, "filter.lfs") { found += 1 } } @@ -47,7 +47,7 @@ func TestInit(t *testing.T) { }) cmd = repo.Command("init") - cmd.Output = "Hook already exists: pre-push\ngit hawser initialized" + cmd.Output = "Hook already exists: pre-push\ngit lfs initialized" customHook := []byte("echo 'yo'") cmd.Before(func() { diff --git a/commands/ls_files_test.go b/commands/ls_files_test.go index 03210e1c..251be495 100644 --- a/commands/ls_files_test.go +++ b/commands/ls_files_test.go @@ -14,9 +14,9 @@ func TestLsFiles(t *testing.T) { cmd.Before(func() { path := filepath.Join(".git", "info", "attributes") - repo.WriteFile(path, "*.dat filter=hawser -crlf\n") + repo.WriteFile(path, "*.dat filter=lfs -crlf\n") - // Add a hawser file + // Add a Git LFS object repo.WriteFile(filepath.Join(repo.Path, "a.dat"), "some data") repo.GitCmd("add", "a.dat") repo.GitCmd("commit", "-m", "a") diff --git a/commands/path_test.go b/commands/path_test.go index a7b4998d..1d4f7f06 100644 --- a/commands/path_test.go +++ b/commands/path_test.go @@ -25,7 +25,7 @@ func TestPath(t *testing.T) { cmd.Before(func() { // write attributes file in .git path := filepath.Join(".git", "info", "attributes") - repo.WriteFile(path, "*.mov filter=hawser -crlf\n") + repo.WriteFile(path, "*.mov filter=lfs -crlf\n") // add hook err := ioutil.WriteFile(prePushHookFile, customHook, 0755) @@ -51,12 +51,12 @@ func TestPathOnEmptyRepository(t *testing.T) { cmd.Before(func() { // write attributes file in .git path := filepath.Join(".gitattributes") - repo.WriteFile(path, "*.mov filter=hawser -crlf\n") + repo.WriteFile(path, "*.mov filter=lfs -crlf\n") }) cmd.After(func() { // assert path was added - assert.Equal(t, "*.mov filter=hawser -crlf\n*.gif filter=hawser -crlf\n", repo.ReadFile(".gitattributes")) + assert.Equal(t, "*.mov filter=lfs -crlf\n*.gif filter=lfs -crlf\n", repo.ReadFile(".gitattributes")) expected := "Listing paths\n *.mov (.gitattributes)\n *.gif (.gitattributes)\n" @@ -84,12 +84,12 @@ func TestAddPathWithoutTrailingLinebreak(t *testing.T) { cmd.Before(func() { // write attributes file in .git path := filepath.Join(".gitattributes") - repo.WriteFile(path, "*.mov filter=hawser -crlf") + repo.WriteFile(path, "*.mov filter=lfs -crlf") }) cmd.After(func() { // assert path was added - assert.Equal(t, "*.mov filter=hawser -crlf\n*.gif filter=hawser -crlf\n", repo.ReadFile(".gitattributes")) + assert.Equal(t, "*.mov filter=lfs -crlf\n*.gif filter=lfs -crlf\n", repo.ReadFile(".gitattributes")) expected := "Listing paths\n *.mov (.gitattributes)\n *.gif (.gitattributes)\n" diff --git a/commands/push_test.go b/commands/push_test.go index 2ad574ec..3b801e9b 100644 --- a/commands/push_test.go +++ b/commands/push_test.go @@ -28,7 +28,7 @@ func TestPushToMaster(t *testing.T) { repo.GitCmd("fetch") - repo.WriteFile(filepath.Join(repo.Path, ".gitattributes"), "*.dat filter=hawser -crlf\n") + repo.WriteFile(filepath.Join(repo.Path, ".gitattributes"), "*.dat filter=lfs -crlf\n") // Add a hawser file repo.WriteFile(filepath.Join(repo.Path, "a.dat"), "some data") @@ -52,7 +52,7 @@ func TestPushToNewBranch(t *testing.T) { repo.GitCmd("fetch") - repo.WriteFile(filepath.Join(repo.Path, ".gitattributes"), "*.dat filter=hawser -crlf\n") + repo.WriteFile(filepath.Join(repo.Path, ".gitattributes"), "*.dat filter=lfs -crlf\n") repo.GitCmd("add", ".gitattributes") repo.GitCmd("commit", "-m", "attributes") diff --git a/commands/repos/attributes.git/config b/commands/repos/attributes.git/config old mode 100755 new mode 100644 index 43ad437e..637fd2b4 --- a/commands/repos/attributes.git/config +++ b/commands/repos/attributes.git/config @@ -6,7 +6,7 @@ ignorecase = true precomposeunicode = true [remote "origin"] - url = file:///Users/scott/github/git-hawser/commands/repos/attributes.git/ + url = /Users/rick/github/git-hawser/commands/repos/attributes.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin diff --git a/commands/repos/attributes.git/logs/HEAD b/commands/repos/attributes.git/logs/HEAD index 34397890..bc1623da 100644 --- a/commands/repos/attributes.git/logs/HEAD +++ b/commands/repos/attributes.git/logs/HEAD @@ -1,2 +1,2 @@ -0000000000000000000000000000000000000000 f554c0ff0e7525ec508b489a720a89819cd5d84a rubyist 1422646325 -0500 clone: from file:///Users/scott/github/git-hawser/commands/repos/attributes.git/ -f554c0ff0e7525ec508b489a720a89819cd5d84a 0afe8279f991e5f192acb8ac06cc4838fdd60941 rubyist 1422646583 -0500 commit: update attributes +0000000000000000000000000000000000000000 57b40745b3d6479ad9d9ad0523c1569e183e38ca Rick Olson 1426793357 -0600 clone: from /Users/rick/github/git-hawser/commands/repos/attributes.git +57b40745b3d6479ad9d9ad0523c1569e183e38ca 7aae26c4771bac634e5c15484657aa439c4ef7e0 Rick Olson 1426793389 -0600 commit: add .gitattributes for ./a diff --git a/commands/repos/attributes.git/logs/refs/heads/master b/commands/repos/attributes.git/logs/refs/heads/master index 34397890..bc1623da 100644 --- a/commands/repos/attributes.git/logs/refs/heads/master +++ b/commands/repos/attributes.git/logs/refs/heads/master @@ -1,2 +1,2 @@ -0000000000000000000000000000000000000000 f554c0ff0e7525ec508b489a720a89819cd5d84a rubyist 1422646325 -0500 clone: from file:///Users/scott/github/git-hawser/commands/repos/attributes.git/ -f554c0ff0e7525ec508b489a720a89819cd5d84a 0afe8279f991e5f192acb8ac06cc4838fdd60941 rubyist 1422646583 -0500 commit: update attributes +0000000000000000000000000000000000000000 57b40745b3d6479ad9d9ad0523c1569e183e38ca Rick Olson 1426793357 -0600 clone: from /Users/rick/github/git-hawser/commands/repos/attributes.git +57b40745b3d6479ad9d9ad0523c1569e183e38ca 7aae26c4771bac634e5c15484657aa439c4ef7e0 Rick Olson 1426793389 -0600 commit: add .gitattributes for ./a diff --git a/commands/repos/attributes.git/logs/refs/remotes/origin/HEAD b/commands/repos/attributes.git/logs/refs/remotes/origin/HEAD new file mode 100644 index 00000000..f5198abc --- /dev/null +++ b/commands/repos/attributes.git/logs/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +0000000000000000000000000000000000000000 57b40745b3d6479ad9d9ad0523c1569e183e38ca Rick Olson 1426793357 -0600 clone: from /Users/rick/github/git-hawser/commands/repos/attributes.git diff --git a/commands/repos/attributes.git/objects/02/21adc0c938c4933212fa7e63c48f6d1c278ea3 b/commands/repos/attributes.git/objects/02/21adc0c938c4933212fa7e63c48f6d1c278ea3 new file mode 100644 index 0000000000000000000000000000000000000000..6c9213d9e9e86de89acb3262efea08dec752ade0 GIT binary patch literal 39 vcmbTWvgsU3E~SMQYPV4VlXr?Ff%bx&`ZxONh~QT%1kOPNiAkzQe1oBq{WfRMnb>p Rl8^M~%Bc4(1^}Io5_(%P7svnr literal 0 HcmV?d00001 diff --git a/commands/repos/attributes.git/objects/04/9cd355aae20ed014903b57205a1d75b5cc95de b/commands/repos/attributes.git/objects/04/9cd355aae20ed014903b57205a1d75b5cc95de deleted file mode 100644 index 4a7057cd638633b02dd6e692c319d8c15aff92ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 42 ycmbTWvgp`-7o8+5@}@090bCWd`^+y(%D{SgcR diff --git a/commands/repos/attributes.git/objects/06/78d1086582e2f79a2093fe4a14a8fe2126057d b/commands/repos/attributes.git/objects/06/78d1086582e2f79a2093fe4a14a8fe2126057d new file mode 100644 index 0000000000000000000000000000000000000000..ef5431dc24388907161d3c7e915e3e16891e512a GIT binary patch literal 39 xcmV+?0NDR{0ZYosPf{>4X3)~hDo9sI%giZBEwar?D^}1=F3L&c0sxw?3FKAI5jOw; literal 0 HcmV?d00001 diff --git a/commands/repos/attributes.git/objects/0a/fe8279f991e5f192acb8ac06cc4838fdd60941 b/commands/repos/attributes.git/objects/0a/fe8279f991e5f192acb8ac06cc4838fdd60941 deleted file mode 100644 index 53943618..00000000 --- a/commands/repos/attributes.git/objects/0a/fe8279f991e5f192acb8ac06cc4838fdd60941 +++ /dev/null @@ -1 +0,0 @@ -xAn! @Ѯ9hd)rń1>9C_zү8v1/{rfĦsޘ "sJ"1V2L}DXwЍ"i%e 9ڨ1e1\o?:.EnU.u?>`W' >h/֫ez7_pJ[ \ No newline at end of file diff --git a/commands/repos/attributes.git/objects/26/c2ef16bedab25eb4b17ecff2a7af7c931249d2 b/commands/repos/attributes.git/objects/26/c2ef16bedab25eb4b17ecff2a7af7c931249d2 new file mode 100644 index 0000000000000000000000000000000000000000..17fe9306f0a0e537287bdb8d446bcc88d3222265 GIT binary patch literal 86 zcmV-c0IC0Y0V^p=O;s>AU@$Z=Ff%bx&`ZxONh~QT%1kOPNiAmRI^2FQ%R91B=l72; stzV*7I_m@EObmcPA&G%0`&iF>4!H>@x8M386upbxPsLRn09>^leO|L7ng9R* literal 0 HcmV?d00001 diff --git a/commands/repos/attributes.git/objects/2b/7fd914b578c06d091b78e61d6a080ceaddac79 b/commands/repos/attributes.git/objects/2b/7fd914b578c06d091b78e61d6a080ceaddac79 new file mode 100644 index 0000000000000000000000000000000000000000..ba99b48490cc71ee756320455fcb53c7230b8af9 GIT binary patch literal 87 zcmV-d0I2_X0V^p=O;s>AU@$Z=Ff%bx&`ZxONh~QT%1kOPNiAkztGLLK+VtrAEQQJc tyhK*~Q&eNEH8B7Jg+vCmL+{1*-P#nlWnPs`WWOcwII1OP}ZAFuY&CWZh2 literal 0 HcmV?d00001 diff --git a/commands/repos/attributes.git/objects/3c/c8ad3c26732ebcbca06133b7d51c2853e29af6 b/commands/repos/attributes.git/objects/3c/c8ad3c26732ebcbca06133b7d51c2853e29af6 deleted file mode 100644 index eb5ee90322130ec74467fc2cb6f96742ce3f17db..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 42 ycmbTWvgp`-7o8+5@}@090bCWgJd+=>8$0ua9d diff --git a/commands/repos/attributes.git/objects/56/227c2afc943637c2c285832adae4b10be75e07 b/commands/repos/attributes.git/objects/56/227c2afc943637c2c285832adae4b10be75e07 deleted file mode 100644 index c5e22be6d42bf2e575b9e3d3feff52d7d7f62a56..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 42 ycmbTWvgp`-7o8+5@}@090bCWd`H+&Tb%SrDZF diff --git a/commands/repos/attributes.git/objects/57/b40745b3d6479ad9d9ad0523c1569e183e38ca b/commands/repos/attributes.git/objects/57/b40745b3d6479ad9d9ad0523c1569e183e38ca new file mode 100644 index 0000000000000000000000000000000000000000..637059c32495cf88949667632511d77839b49b50 GIT binary patch literal 162 zcmV;T0A2rh0iBP_3BxcDL~~XZ+dzyyj%-5+=^&5}B<Cd@vh_FR=%t!Q%>4Y_=o?OBA3)vGQA;bb_ Q^SNS6G<0740E9P8B}6eu>;M1& literal 0 HcmV?d00001 diff --git a/commands/repos/attributes.git/objects/7a/ae26c4771bac634e5c15484657aa439c4ef7e0 b/commands/repos/attributes.git/objects/7a/ae26c4771bac634e5c15484657aa439c4ef7e0 new file mode 100644 index 0000000000000000000000000000000000000000..e27e1351fa9a3fe422430f4168fc371385da7bc9 GIT binary patch literal 176 zcmV;h08jsT0iDiUY6CG0h2cJX71}_i^7sy+WCw-rK$exnG&3#}g>JuILtoCr4+lOT z+tw9UAKvs3fwiV3t$K*qGE&5cbl{N>% z>ez-@#AYWhGZ}j6eH`%B`5QhT&#}W(`iybGg6?Bchpg eB31r*H`5Hutt+V>y}neQaGjRroy;HE(@t)so>y%E literal 0 HcmV?d00001 diff --git a/commands/repos/attributes.git/objects/8a/c387de6a4b59812cfbf88a2afa15d4897f501e b/commands/repos/attributes.git/objects/8a/c387de6a4b59812cfbf88a2afa15d4897f501e new file mode 100644 index 0000000000000000000000000000000000000000..06df42397bae579f4007de61bbf5cbad8e6c3888 GIT binary patch literal 39 xcmV+?0NDR{0ZYosPf{>4X3)}0&rDND%giZBEwar?D^}1=F3L&c0sxuO3E5d|5pnAU@$Z=Ff%bx&`ZxONh~QT%1kOPNiAjwQ>xMWGsVpO(4p35 tty@nvazBq_H!%PLg+zw$YQL|1etUF{>EW+Wgzj-%;A(j62mobMAkd=bB)5U|`6=)T+X^>`k)mXUivQbMDl=ZVvdOS7t97UdV9v9S=7EP&E*+ literal 0 HcmV?d00001 diff --git a/commands/repos/attributes.git/objects/e4/c07986883be7d6d9111352aefcf64cd33de2e1 b/commands/repos/attributes.git/objects/e4/c07986883be7d6d9111352aefcf64cd33de2e1 new file mode 100644 index 0000000000000000000000000000000000000000..530a3cd26b8bbee82e9c1eedc8fcae62e3080f8c GIT binary patch literal 86 zcmV-c0IC0Y0V^p=O;s>AU@$Z=Ff%bx&`ZxONh~QT%1kOPNiAkztGLLK+VtrAEQQJc syhK*~Q&eNEH8B7Jg+zvJN6L%ay86zg<^DPJJa3Pw$2Qk207woWIM=`>(EtDd literal 0 HcmV?d00001 diff --git a/commands/repos/attributes.git/objects/e6/1ea30acc377fde7e111c8f8f6ff3e739777ab2 b/commands/repos/attributes.git/objects/e6/1ea30acc377fde7e111c8f8f6ff3e739777ab2 deleted file mode 100644 index 9c6b556695bf7e49ca8dc69feee9c4b584498198..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 59 zcmV-B0L1@z0V^p=O;s>4VlXr?Ff%bx&`ZxONh~QT%1kOPNiAkznR7XG)g!(OA``5` R6{2KIx1O1L4*;9m5~m~g6r}(F diff --git a/commands/repos/attributes.git/objects/f7/26fbd4f3edc5ac35c3f5e412de08d00a80e341 b/commands/repos/attributes.git/objects/f7/26fbd4f3edc5ac35c3f5e412de08d00a80e341 deleted file mode 100644 index c4d0be0c84362b2b217d96ffe2a7bf094bd4d9f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 86 zcmV-c0IC0Y0V^p=O;s>AU@$Z=Ff%bx&`ZxONh~QT%1kOPNiAluIkDD8typi*o&|}< s+po%K1V5Vf&BOo*6p|R8$t~tOV_tu+PEe-5KmYS{%krvC078Tws(4)_d;kCd diff --git a/commands/repos/attributes.git/packed-refs b/commands/repos/attributes.git/packed-refs new file mode 100644 index 00000000..392c62ed --- /dev/null +++ b/commands/repos/attributes.git/packed-refs @@ -0,0 +1,2 @@ +# pack-refs with: peeled fully-peeled +57b40745b3d6479ad9d9ad0523c1569e183e38ca refs/remotes/origin/master diff --git a/commands/repos/attributes.git/refs/heads/master b/commands/repos/attributes.git/refs/heads/master index dfb94298..0dd3765a 100644 --- a/commands/repos/attributes.git/refs/heads/master +++ b/commands/repos/attributes.git/refs/heads/master @@ -1 +1 @@ -0afe8279f991e5f192acb8ac06cc4838fdd60941 +7aae26c4771bac634e5c15484657aa439c4ef7e0 diff --git a/commands/repos/attributes.git/refs/remotes/origin/HEAD b/commands/repos/attributes.git/refs/remotes/origin/HEAD new file mode 100644 index 00000000..6efe28ff --- /dev/null +++ b/commands/repos/attributes.git/refs/remotes/origin/HEAD @@ -0,0 +1 @@ +ref: refs/remotes/origin/master diff --git a/commands/repos/config_media_url.git/config b/commands/repos/config_media_url.git/config old mode 100755 new mode 100644 index 2a814a67..6c9406b7 --- a/commands/repos/config_media_url.git/config +++ b/commands/repos/config_media_url.git/config @@ -5,9 +5,3 @@ logallrefupdates = true ignorecase = true precomposeunicode = true -[remote "origin"] - url = /Users/scott/github/git-hawser/commands/repos/config_media_url.git/ - fetch = +refs/heads/*:refs/remotes/origin/* -[branch "master"] - remote = origin - merge = refs/heads/master diff --git a/commands/repos/config_media_url.git/logs/HEAD b/commands/repos/config_media_url.git/logs/HEAD index 44d16bcc..c75e8260 100644 --- a/commands/repos/config_media_url.git/logs/HEAD +++ b/commands/repos/config_media_url.git/logs/HEAD @@ -1,2 +1 @@ -0000000000000000000000000000000000000000 00df65f30b769b694e2a1ca57e054d45d3d8bf9b rubyist 1422648036 -0500 clone: from /Users/scott/github/git-hawser/commands/repos/config_media_url.git/ -00df65f30b769b694e2a1ca57e054d45d3d8bf9b 89ea2bf17b7a9e86085513d3c78b5197fd13a4c1 rubyist 1422648050 -0500 commit: Update config +0000000000000000000000000000000000000000 d1e0a8e1530c458f27d4aac7da7d4f3732e9888b Rick Olson 1426793050 -0600 commit (initial): add .gitconfig with custom Git LFS url diff --git a/commands/repos/config_media_url.git/logs/refs/heads/master b/commands/repos/config_media_url.git/logs/refs/heads/master index 44d16bcc..c75e8260 100644 --- a/commands/repos/config_media_url.git/logs/refs/heads/master +++ b/commands/repos/config_media_url.git/logs/refs/heads/master @@ -1,2 +1 @@ -0000000000000000000000000000000000000000 00df65f30b769b694e2a1ca57e054d45d3d8bf9b rubyist 1422648036 -0500 clone: from /Users/scott/github/git-hawser/commands/repos/config_media_url.git/ -00df65f30b769b694e2a1ca57e054d45d3d8bf9b 89ea2bf17b7a9e86085513d3c78b5197fd13a4c1 rubyist 1422648050 -0500 commit: Update config +0000000000000000000000000000000000000000 d1e0a8e1530c458f27d4aac7da7d4f3732e9888b Rick Olson 1426793050 -0600 commit (initial): add .gitconfig with custom Git LFS url diff --git a/commands/repos/config_media_url.git/objects/00/df65f30b769b694e2a1ca57e054d45d3d8bf9b b/commands/repos/config_media_url.git/objects/00/df65f30b769b694e2a1ca57e054d45d3d8bf9b deleted file mode 100644 index a61ef7d9..00000000 --- a/commands/repos/config_media_url.git/objects/00/df65f30b769b694e2a1ca57e054d45d3d8bf9b +++ /dev/null @@ -1,2 +0,0 @@ -x[ - @~@&tFRK߬A9}tnHirk&Y=&5Y=*/§o| ,pk%jjj[Wig="C.;)7U|?ckU~Cw8!TY?9=ehIVr+v~paw|TR7S44%dPS}6Mz?j=E3r3~ Lr7R4YHbUnZJ+r>scE#(ZduD!X+|{0b NwGp0iBOQ3c@fD06pgw`vJ=~HE9DPp7bIJ`hs+`w!tQWc1yo+-{5s%7=}tp zQ9z?R$jl6lLG4;=oI}#J4Z(RL-B52jPkoJupU$<$D!Fv>l!o&N3@7)r+ZZRPhI&CpcnZmBDdu&c4K@-uBU~Woze7 NDfFy<3jkoM5qpQ28J_?E diff --git a/commands/repos/config_media_url.git/objects/fa/6808de9cbe61a54b3f5b0576ad9d9471497bed b/commands/repos/config_media_url.git/objects/fa/6808de9cbe61a54b3f5b0576ad9d9471497bed deleted file mode 100644 index 4d7dea01364c5de78433bb2c02f473440881519f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 47 zcmV+~0MP$<0ZYosPf{>8WQfj4EH6$iisj-gEy_`_RmdnQDX`MlPs`8OPf9G}0s!|u F3{&Tj6qx`3 diff --git a/commands/repos/config_media_url.git/objects/fb/997f8b3da8eba5bc99f681ba8767dd885646df b/commands/repos/config_media_url.git/objects/fb/997f8b3da8eba5bc99f681ba8767dd885646df deleted file mode 100644 index 0be9a9800ab0608ffb45377b2f919badb8a7e05c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 46 zcmV+}0MY+=0ZYosPf{>8V2I95P037*<>D+Y%2BXY$S5f(u+rC0%g@(ON-W|60Ob7( E$o32tNB{r; diff --git a/commands/repos/config_media_url.git/refs/heads/master b/commands/repos/config_media_url.git/refs/heads/master index 460edd73..41adea7e 100644 --- a/commands/repos/config_media_url.git/refs/heads/master +++ b/commands/repos/config_media_url.git/refs/heads/master @@ -1 +1 @@ -89ea2bf17b7a9e86085513d3c78b5197fd13a4c1 +d1e0a8e1530c458f27d4aac7da7d4f3732e9888b diff --git a/commands/repos/submodule.git/config b/commands/repos/submodule.git/config index 3c5acfbd..e2541eba 100644 --- a/commands/repos/submodule.git/config +++ b/commands/repos/submodule.git/config @@ -6,10 +6,10 @@ ignorecase = true precomposeunicode = true [remote "origin"] - url = /Users/rick/hawser/git-hawser/commands/repos/submodule.git + url = /Users/rick/github/git-lfs/commands/repos/submodule.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin merge = refs/heads/master [submodule "attributes"] - url = /Users/rick/hawser/git-hawser/commands/repos/attributes.git + url = /Users/rick/github/git-lfs/commands/repos/attributes.git diff --git a/commands/repos/submodule.git/logs/HEAD b/commands/repos/submodule.git/logs/HEAD index 64c15bc1..cc5527eb 100644 --- a/commands/repos/submodule.git/logs/HEAD +++ b/commands/repos/submodule.git/logs/HEAD @@ -1,2 +1,2 @@ -0000000000000000000000000000000000000000 b608e68155fac7a7d9bfa126de62ba3f10a33e30 Rick Olson 1402007980 -0600 clone: from /Users/rick/hawser/git-hawser/commands/repos/submodule.git +0000000000000000000000000000000000000000 b608e68155fac7a7d9bfa126de62ba3f10a33e30 Rick Olson 1402007980 -0600 clone: from /Users/rick/github/git-lfs/commands/repos/submodule.git b608e68155fac7a7d9bfa126de62ba3f10a33e30 862c32b0f154e2f48374c9bb66811732bce51fce Rick Olson 1402008046 -0600 commit (amend): add submodule diff --git a/commands/repos/submodule.git/logs/refs/heads/master b/commands/repos/submodule.git/logs/refs/heads/master index 64c15bc1..cc5527eb 100644 --- a/commands/repos/submodule.git/logs/refs/heads/master +++ b/commands/repos/submodule.git/logs/refs/heads/master @@ -1,2 +1,2 @@ -0000000000000000000000000000000000000000 b608e68155fac7a7d9bfa126de62ba3f10a33e30 Rick Olson 1402007980 -0600 clone: from /Users/rick/hawser/git-hawser/commands/repos/submodule.git +0000000000000000000000000000000000000000 b608e68155fac7a7d9bfa126de62ba3f10a33e30 Rick Olson 1402007980 -0600 clone: from /Users/rick/github/git-lfs/commands/repos/submodule.git b608e68155fac7a7d9bfa126de62ba3f10a33e30 862c32b0f154e2f48374c9bb66811732bce51fce Rick Olson 1402008046 -0600 commit (amend): add submodule diff --git a/commands/repos/submodule.git/logs/refs/remotes/origin/HEAD b/commands/repos/submodule.git/logs/refs/remotes/origin/HEAD index 2a888cc4..c69d993a 100644 --- a/commands/repos/submodule.git/logs/refs/remotes/origin/HEAD +++ b/commands/repos/submodule.git/logs/refs/remotes/origin/HEAD @@ -1 +1 @@ -0000000000000000000000000000000000000000 b608e68155fac7a7d9bfa126de62ba3f10a33e30 Rick Olson 1402007980 -0600 clone: from /Users/rick/hawser/git-hawser/commands/repos/submodule.git +0000000000000000000000000000000000000000 b608e68155fac7a7d9bfa126de62ba3f10a33e30 Rick Olson 1402007980 -0600 clone: from /Users/rick/github/git-lfs/commands/repos/submodule.git diff --git a/commands/repos/submodule.git/modules/attributes/config b/commands/repos/submodule.git/modules/attributes/config index 2e36ec49..c1580d02 100644 --- a/commands/repos/submodule.git/modules/attributes/config +++ b/commands/repos/submodule.git/modules/attributes/config @@ -7,7 +7,7 @@ ignorecase = true precomposeunicode = true [remote "origin"] - url = /Users/rick/hawser/git-hawser/commands/repos/attributes.git + url = /Users/rick/github/git-lfs/commands/repos/attributes.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "master"] remote = origin diff --git a/commands/repos/submodule.git/modules/attributes/logs/HEAD b/commands/repos/submodule.git/modules/attributes/logs/HEAD index 5539381a..0744189e 100644 --- a/commands/repos/submodule.git/modules/attributes/logs/HEAD +++ b/commands/repos/submodule.git/modules/attributes/logs/HEAD @@ -1 +1 @@ -0000000000000000000000000000000000000000 f554c0ff0e7525ec508b489a720a89819cd5d84a Rick Olson 1402008021 -0600 clone: from /Users/rick/hawser/git-hawser/commands/repos/attributes.git +0000000000000000000000000000000000000000 f554c0ff0e7525ec508b489a720a89819cd5d84a Rick Olson 1402008021 -0600 clone: from /Users/rick/github/git-lfs/commands/repos/attributes.git diff --git a/commands/repos/submodule.git/modules/attributes/logs/refs/heads/master b/commands/repos/submodule.git/modules/attributes/logs/refs/heads/master index 5539381a..0744189e 100644 --- a/commands/repos/submodule.git/modules/attributes/logs/refs/heads/master +++ b/commands/repos/submodule.git/modules/attributes/logs/refs/heads/master @@ -1 +1 @@ -0000000000000000000000000000000000000000 f554c0ff0e7525ec508b489a720a89819cd5d84a Rick Olson 1402008021 -0600 clone: from /Users/rick/hawser/git-hawser/commands/repos/attributes.git +0000000000000000000000000000000000000000 f554c0ff0e7525ec508b489a720a89819cd5d84a Rick Olson 1402008021 -0600 clone: from /Users/rick/github/git-lfs/commands/repos/attributes.git diff --git a/commands/repos/submodule.git/modules/attributes/logs/refs/remotes/origin/HEAD b/commands/repos/submodule.git/modules/attributes/logs/refs/remotes/origin/HEAD index 5539381a..0744189e 100644 --- a/commands/repos/submodule.git/modules/attributes/logs/refs/remotes/origin/HEAD +++ b/commands/repos/submodule.git/modules/attributes/logs/refs/remotes/origin/HEAD @@ -1 +1 @@ -0000000000000000000000000000000000000000 f554c0ff0e7525ec508b489a720a89819cd5d84a Rick Olson 1402008021 -0600 clone: from /Users/rick/hawser/git-hawser/commands/repos/attributes.git +0000000000000000000000000000000000000000 f554c0ff0e7525ec508b489a720a89819cd5d84a Rick Olson 1402008021 -0600 clone: from /Users/rick/github/git-lfs/commands/repos/attributes.git diff --git a/commands/smudge_test.go b/commands/smudge_test.go index 63ad548f..05acfc9a 100644 --- a/commands/smudge_test.go +++ b/commands/smudge_test.go @@ -18,12 +18,12 @@ func TestSmudge(t *testing.T) { // simple smudge example cmd := repo.Command("smudge", "somefile") - cmd.Input = bytes.NewBufferString("version https://hawser.github.com/spec/v1\noid sha256:SOMEOID\nsize 9\n") + cmd.Input = bytes.NewBufferString("version https://git-lfs.github.com/spec/v1\noid sha256:SOMEOID\nsize 9\n") cmd.Output = "whatever" - cmd.Env = append(cmd.Env, "HAWSER_PROGRESS="+progressFile) + cmd.Env = append(cmd.Env, "GIT_LFS_PROGRESS="+progressFile) cmd.Before(func() { - path := filepath.Join(repo.Path, ".git", "hawser", "objects", "SO", "ME") + path := filepath.Join(repo.Path, ".git", "lfs", "objects", "SO", "ME") file := filepath.Join(path, "SOMEOID") assert.Equal(t, nil, os.MkdirAll(path, 0755)) assert.Equal(t, nil, ioutil.WriteFile(file, []byte("whatever\n"), 0755)) @@ -51,7 +51,7 @@ func TestSmudge(t *testing.T) { customHook := []byte("echo 'yo'") cmd.Before(func() { - path := filepath.Join(repo.Path, ".git", "hawser", "objects", "4d", "7a") + path := filepath.Join(repo.Path, ".git", "lfs", "objects", "4d", "7a") file := filepath.Join(path, "4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393") assert.Equal(t, nil, os.MkdirAll(path, 0755)) assert.Equal(t, nil, ioutil.WriteFile(file, []byte("whatever\n"), 0755)) @@ -70,7 +70,7 @@ func TestSmudgeInfo(t *testing.T) { repo := NewRepository(t, "empty") defer repo.Test() - mediaPath := filepath.Join(repo.Path, ".git", "hawser", "objects", "4d", "7a") + mediaPath := filepath.Join(repo.Path, ".git", "lfs", "objects", "4d", "7a") mediaFile := filepath.Join(mediaPath, "4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393") // smudge --info with old pointer format, without local file @@ -103,14 +103,14 @@ func TestSmudgeInfo(t *testing.T) { assert.Equal(t, nil, ioutil.WriteFile(mediaFile, []byte("whatever\n"), 0755)) }) - // smudge --info with hawser pointer format, without local file + // smudge --info with Git LFS pointer format, without local file cmd = repo.Command("smudge", "--info") - cmd.Input = bytes.NewBufferString("version https://hawser.github.com/spec/v1\noid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393\nsize 123\n") + cmd.Input = bytes.NewBufferString("version https://git-lfs.github.com/spec/v1\noid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393\nsize 123\n") cmd.Output = "123 --" - // smudge --info with hawser pointer format, with local file + // smudge --info with Git LFS pointer format, with local file cmd = repo.Command("smudge", "--info") - cmd.Input = bytes.NewBufferString("version https://hawser.github.com/spec/v1\noid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393\nsize 123\n") + cmd.Input = bytes.NewBufferString("version https://git-lfs.github.com/spec/v1\noid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393\nsize 123\n") cmd.Output = "9 " + mediaFile cmd.Before(func() { diff --git a/commands/status_test.go b/commands/status_test.go index 1f6fb1fa..93d1b95b 100644 --- a/commands/status_test.go +++ b/commands/status_test.go @@ -14,7 +14,7 @@ func TestStatus(t *testing.T) { cmd.Before(func() { path := filepath.Join(".git", "info", "attributes") - repo.WriteFile(path, "*.dat filter=hawser -crlf\n") + repo.WriteFile(path, "*.dat filter=lfs -crlf\n") // Add a hawser file repo.WriteFile(filepath.Join(repo.Path, "file1.dat"), "some data") diff --git a/commands/version_test.go b/commands/version_test.go index e7770a9d..fa366f46 100644 --- a/commands/version_test.go +++ b/commands/version_test.go @@ -2,7 +2,7 @@ package commands import ( "fmt" - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "testing" ) @@ -14,11 +14,11 @@ func TestVersionOnEmptyRepository(t *testing.T) { repo.AddPath(repo.Path, "subdir") cmd := repo.Command("version") - cmd.Output = hawser.UserAgent + cmd.Output = lfs.UserAgent cmd = repo.Command("version", "--comics") - cmd.Output = fmt.Sprintf("%s\nNothing may see Gah Lak Tus and survive!", hawser.UserAgent) + cmd.Output = fmt.Sprintf("%s\nNothing may see Gah Lak Tus and survive!", lfs.UserAgent) cmd = repo.Command("version", "-c") - cmd.Output = fmt.Sprintf("%s\nNothing may see Gah Lak Tus and survive!", hawser.UserAgent) + cmd.Output = fmt.Sprintf("%s\nNothing may see Gah Lak Tus and survive!", lfs.UserAgent) } diff --git a/docs/api.md b/docs/api.md index 9acaff73..dd1a68e1 100644 --- a/docs/api.md +++ b/docs/api.md @@ -1,13 +1,13 @@ -# Hawser API +# Git LFS API The server implements a simple API for uploading and downloading binary content. -Git repositories that use Hawser will specify a URI endpoint. See the +Git repositories that use Git LFS will specify a URI endpoint. See the [specification](spec.md) for how Git Media determines the server endpoint to use. Use that endpoint as a base, and append the following relative paths to upload -and download from the Hawser server. +and download from the Git LFS server. -All requests should send an Accept header of `application/vnd.hawser+json`. +All requests should send an Accept header of `application/vnd.git-lfs+json`. This may change in the future as the API evolves. ## API Responses @@ -30,7 +30,7 @@ repository or requested object does not exist. The following status codes can optionally be returned from the API, depending on the server implementation. -* 406 - The Accept header is invalid. It should be `application/vnd.hawser+json`. +* 406 - The Accept header is invalid. It should be `application/vnd.git-lfs+json`. * 429 - The user has hit a rate limit with the server. Though the API does not specify any rate limits, implementors are encouraged to set some for availability reasons. @@ -47,15 +47,15 @@ If the server returns a JSON error object, the client can display this message to users. ``` -> GET https://hawser-server.com/objects/{OID} HTTP/1.1 -> Accept: application/vnd.hawser+json +> GET https://git-lfs-server.com/objects/{OID} HTTP/1.1 +> Accept: application/vnd.git-lfs+json > < HTTP/1.1 200 OK -< Content-Type: application/vnd.hawser+json +< Content-Type: application/vnd.git-lfs+json < < { < "message": "Bad credentials", -< "documentation_url": "https://hawser-server.com/docs/errors", +< "documentation_url": "https://git-lfs-server.com/docs/errors", < "request_id": "123" < } ``` @@ -65,7 +65,7 @@ they are displayed to the user. ## Hypermedia -The Hawser API uses hypermedia hints to instruct the client what to do next. +The Git LFS API uses hypermedia hints to instruct the client what to do next. These links are included in a `_links` property. Possible relations for objects include: @@ -79,18 +79,18 @@ See the "Verification" section below for more. Link relations specify the `href`, and optionally a collection of header values to set for the request. These are optional, and depend on the backing object -store that the Hawser API is using. +store that the Git LFS API is using. -The Hawser client will automatically send the same credentials to the followed +The Git LFS client will automatically send the same credentials to the followed link relation as Basic Authentication IF: -* The url scheme, host, and port all match the Hawser API endpoint's. +* The url scheme, host, and port all match the Git LFS API endpoint's. * The link relation does not specify an Authorization header. -If the host name is different, the Hawser API needs to send enough information +If the host name is different, the Git LFS API needs to send enough information through the href query or header values to authenticate the request. -The Hawser client expects a 200 or 201 response from these hypermedia requests. +The Git LFS client expects a 200 or 201 response from these hypermedia requests. Any other response code is treated as an error. ## GET /objects/{oid} @@ -98,19 +98,19 @@ Any other response code is treated as an error. This gets the object's meta data. The OID is the value from the object pointer. ``` -> GET https://hawser-server.com/objects/{OID} HTTP/1.1 -> Accept: application/vnd.hawser+json +> GET https://git-lfs-server.com/objects/{OID} HTTP/1.1 +> Accept: application/vnd.git-lfs+json > Authorization: Basic ... (if authentication is needed) > < HTTP/1.1 200 OK -< Content-Type: application/vnd.hawser+json +< Content-Type: application/vnd.git-lfs+json < < { < "oid": "the-sha-256-signature", < "size": 123456, < "_links": { < "self": { -< "href": "https://hawser-server.com/objects/OID", +< "href": "https://git-lfs-server.com/objects/OID", < }, < "download": { < "href": "https://some-download.com", @@ -129,12 +129,12 @@ access the object content. See the "Hypermedia" section above for more. Here's a sample response for a request with an authorization error: ``` -> GET https://hawser-server.com/objects/{OID} HTTP/1.1 -> Accept: application/vnd.hawser+json +> GET https://git-lfs-server.com/objects/{OID} HTTP/1.1 +> Accept: application/vnd.git-lfs+json > Authorization: Basic ... (if authentication is needed) > < HTTP/1.1 404 Not found -< Content-Type: application/vnd.hawser+json +< Content-Type: application/vnd.git-lfs+json < < { < "message": "Not found" @@ -153,9 +153,9 @@ This request initiates the upload of an object, given a JSON body with the oid and size of the object to upload. ``` -> POST https://hawser-server.com/objects/ HTTP/1.1 -> Accept: application/vnd.hawser+json -> Content-Type: application/vnd.hawser+json +> POST https://git-lfs-server.com/objects/ HTTP/1.1 +> Accept: application/vnd.git-lfs+json +> Content-Type: application/vnd.git-lfs+json > Authorization: Basic ... (if authentication is needed) > > { @@ -164,7 +164,7 @@ and size of the object to upload. > } > < HTTP/1.1 202 Accepted -< Content-Type: application/vnd.hawser+json +< Content-Type: application/vnd.git-lfs+json < < { < "_links": { @@ -206,18 +206,17 @@ only appears on a 200 status. ## Verification -When Hawser clients issue a POST request to initiate an object upload, the -response can potentially return a "verify" link relation. If given, The Hawser -server expects a POST to the href after a successful upload. Hawser -clients send: +When Git LFS clients issue a POST request to initiate an object upload, the +response can potentially return a "verify" link relation. If given, The Git LFS +API expects a POST to the href after a successful upload. Git LFS clients send: * `oid` - The String OID of the Git Media object. * `size` - The integer size of the Git Media object. ``` -> POST https://hawser-server.com/callback -> Accept: application/vnd.hawser -> Content-Type: application/vnd.hawser+json +> POST https://git-lfs-server.com/callback +> Accept: application/vnd.git-lfs +> Content-Type: application/vnd.git-lfs+json > Content-Length: 123 > > {"oid": "{oid}", "size": 10000} diff --git a/docs/linux-build.md b/docs/linux-build.md index 04b23531..ff0ee022 100644 --- a/docs/linux-build.md +++ b/docs/linux-build.md @@ -10,21 +10,21 @@ sudo apt-get install golang-go git ./script/bootstrap ``` -That will place a git-hawser binary in the `bin/` directory. Copy the binary to a directory in your path: +That will place a git-lfs binary in the `bin/` directory. Copy the binary to a directory in your path: ``` -sudo cp bin/git-hawser /usr/local/bin +sudo cp bin/git-lfs /usr/local/bin ``` Try it: ``` -[949][rubiojr@octox] git hawser -git-hawser v0.0.1 +[949][rubiojr@octox] git lfs +git-lfs v0.0.1 [~] -[949][rubiojr@octox] git hawser init -git hawser initialized +[949][rubiojr@octox] git lfs init +git lfs initialized ``` ### Installing the man pages @@ -40,4 +40,4 @@ sudo mkdir -p /usr/local/share/man/man1 sudo cp man/*.1 /usr/local/share/man/man1 ``` -`git help hawser` should show the git-hawser manpage now. +`git help lfs` should show the git-lfs man pages now. diff --git a/docs/man/git-hawser-add.1.ronn b/docs/man/git-hawser-add.1.ronn index 8eae0dfb..3590548e 100644 --- a/docs/man/git-hawser-add.1.ronn +++ b/docs/man/git-hawser-add.1.ronn @@ -1,24 +1,24 @@ -git-hawser-add(1) - Add Hawser paths to Git Attributes. +git-lfs-add(1) - Add Git LFS paths to Git Attributes. ====================================================================== ## SYNOPSIS -`git hawser add` [path]* +`git lfs add` [path]* ## DESCRIPTION -The "path" command helps view and modify Git attributes for the "hawser" +The "path" command helps view and modify Git attributes for the "lfs" clean and smudge filters. The "path" argument can be a file extension, or a path. ## EXAMPLES -* Configure a path to use the Hawser clean and smudge filters. +* Configure a path to use the Git LFS clean and smudge filters. - `git hawser add *.gif` + `git lfs add *.gif` ## SEE ALSO -git-hawser-rm(1), git-hawser-path(1), git-hawser-init(1), gitattributes(5). +git-lfs-rm(1), git-lfs-path(1), git-lfs-init(1), gitattributes(5). -Part of the git-hawser(1) suite. +Part of the git-lfs(1) suite. diff --git a/docs/man/git-hawser-clean.1.ronn b/docs/man/git-hawser-clean.1.ronn index b585ba87..fb3ba4ff 100644 --- a/docs/man/git-hawser-clean.1.ronn +++ b/docs/man/git-hawser-clean.1.ronn @@ -1,21 +1,21 @@ -git-hawser-clean(1) -- Git clean filter that converts large files to pointers. +git-lfs-clean(1) -- Git clean filter that converts large files to pointers. ============================================================================= ## SYNOPSIS -`git hawser clean` +`git lfs clean` ## DESCRIPTION Clean calculates a SHA-256 signature of the data from STDOUT, and outputs a Git Media pointer file. It also queues the file to be pushed by -git-hawser-push(1). +git-lfs-push(1). Clean is typicall run by Git's clean filter, configured by the repository's Git attributes. ## SEE ALSO -git-hawser-init(1), git-hawser-push(1), gitattributes(5). +git-lfs-init(1), git-lfs-push(1), gitattributes(5). -Part of the git-hawser(1) suite. +Part of the git-lfs(1) suite. diff --git a/docs/man/git-hawser-env.1.ronn b/docs/man/git-hawser-env.1.ronn index 369bc362..06026be8 100644 --- a/docs/man/git-hawser-env.1.ronn +++ b/docs/man/git-hawser-env.1.ronn @@ -1,9 +1,9 @@ -git-hawser-env(1) -- Display the Git Media environment. +git-lfs-env(1) -- Display the Git Media environment. ========================================================= ## SYNOPSIS -`git hawser env` +`git lfs env` ## DESCRIPTION @@ -11,4 +11,4 @@ Displays the current Git Media environment. ## SEE ALSO -Part of the git-hawser(1) suite. +Part of the git-lfs(1) suite. diff --git a/docs/man/git-hawser-init.1.ronn b/docs/man/git-hawser-init.1.ronn index f3306ee6..0c7f9e20 100644 --- a/docs/man/git-hawser-init.1.ronn +++ b/docs/man/git-hawser-init.1.ronn @@ -1,17 +1,17 @@ -git-hawser-init(1) -- Ensure Hawser is configured properly. +git-lfs-init(1) -- Ensure Git LFS is configured properly. ============================================================= ## SYNOPSIS -`git hawser init` +`git lfs init` ## DESCRIPTION -Init performs the following actions to ensure Hawser is setup properly: +Init performs the following actions to ensure Git LFS is setup properly: -* Sets up the clean and smudge filters under the name "hawser". -* Installs a pre-push hook to run git-hawser-push(1) +* Sets up the clean and smudge filters under the name "lfs". +* Installs a pre-push hook to run git-lfs-push(1) ## SEE ALSO -Part of the git-hawser(1) suite. +Part of the git-lfs(1) suite. diff --git a/docs/man/git-hawser-logs.1.ronn b/docs/man/git-hawser-logs.1.ronn index 06a2b5bb..1d577b4c 100644 --- a/docs/man/git-hawser-logs.1.ronn +++ b/docs/man/git-hawser-logs.1.ronn @@ -1,21 +1,21 @@ -git-hawser-logs(1) - Show errors from the git-hawser command. +git-lfs-logs(1) - Show errors from the git-lfs command. =========================================================== ## SYNOPSIS -`git hawser logs`
-`git hawser logs`
-`git hawser logs` --clear
-`git hawser logs` --boomtown
+`git lfs logs`
+`git lfs logs`
+`git lfs logs` --clear
+`git lfs logs` --boomtown
## DESCRIPTION -The "logs" command displays errors from the git-hawser command. Any time it -crashes, the details are saved to ".git/hawser/logs". +The "logs" command displays errors from the git-lfs command. Any time it +crashes, the details are saved to ".git/lfs/logs". ## OPTIONS -Without any options, `git hawser logs` will simply show the list of error logs. +Without any options, `git lfs logs` will simply show the list of error logs. * : Shows the specified error log. Use "last" to show the most recent error. diff --git a/docs/man/git-hawser-ls-files.1.ronn b/docs/man/git-hawser-ls-files.1.ronn index 2918a880..47536470 100644 --- a/docs/man/git-hawser-ls-files.1.ronn +++ b/docs/man/git-hawser-ls-files.1.ronn @@ -1,17 +1,17 @@ -git-hawser-ls-files(1) -- Show information about git hawser files in the index and working tree +git-lfs-ls-files(1) -- Show information about git lfs files in the index and working tree ============================================================================================= ## SYNOPSIS -`git hawser ls-files` [refspec] +`git lfs ls-files` [refspec] ## DESCRIPTION -Displays paths of hawser files that are found in the refspec. If no refspec is given, +Displays paths of Git LFS files that are found in the refspec. If no refspec is given, the current checked out branch will be scanned. ## SEE ALSO -git-hawser-status(1). +git-lfs-status(1). -Part of the git-hawser(1) suite. +Part of the git-lfs(1) suite. diff --git a/docs/man/git-hawser-path.1.ronn b/docs/man/git-hawser-path.1.ronn index 0cdb6a6d..ef21215f 100644 --- a/docs/man/git-hawser-path.1.ronn +++ b/docs/man/git-hawser-path.1.ronn @@ -1,13 +1,13 @@ -git-hawser-path(1) - View Hawser paths in Git attributes. +git-lfs-path(1) - View Git LFS paths in Git attributes. ====================================================================== ## SYNOPSIS -`git hawser path` +`git lfs path` ## DESCRIPTION -The "path" command helps view and modify Git attributes for the "hawser" +The "path" command helps view and modify Git attributes for the "lfs" clean and smudge filters. The "path" argument can be a file extension, or a path. @@ -15,10 +15,10 @@ path. * View the current Git attributes. - `git hawser path` + `git lfs path` ## SEE ALSO -git-hawser-add(1), git-hawser-rm(1), git-hawser-init(1), gitattributes(5). +git-lfs-add(1), git-lfs-rm(1), git-lfs-init(1), gitattributes(5). -Part of the git-hawser(1) suite. +Part of the git-lfs(1) suite. diff --git a/docs/man/git-hawser-push.1.ronn b/docs/man/git-hawser-push.1.ronn index 43d99115..5de6ef4e 100644 --- a/docs/man/git-hawser-push.1.ronn +++ b/docs/man/git-hawser-push.1.ronn @@ -1,9 +1,9 @@ -git-hawser-push(1) -- Push queued large files to the Git Media endpoint. +git-lfs-push(1) -- Push queued large files to the Git Media endpoint. ======================================================================= ## SYNOPSIS -`git hawser push` [refspec] +`git lfs push` [refspec] ## DESCRIPTION @@ -25,6 +25,6 @@ Push is typically run by Git's pre-push hook. ## SEE ALSO -git-hawser-clean(1). +git-lfs-clean(1). -Part of the git-hawser(1) suite. +Part of the git-lfs(1) suite. diff --git a/docs/man/git-hawser-rm.1.ronn b/docs/man/git-hawser-rm.1.ronn index 190ec755..df99dad8 100644 --- a/docs/man/git-hawser-rm.1.ronn +++ b/docs/man/git-hawser-rm.1.ronn @@ -1,24 +1,24 @@ -git-hawser-rm(1) - Remove Hawser paths from Git Attributes. +git-lfs-rm(1) - Remove Git LFS paths from Git Attributes. ====================================================================== ## SYNOPSIS -`git hawser rm` [path]* +`git lfs rm` [path]* ## DESCRIPTION -The "path" command helps view and modify Git attributes for the "hawser" +The "path" command helps view and modify Git attributes for the "lfs" clean and smudge filters. The "path" argument can be a file extension, or a path. ## EXAMPLES -* Prevent a path from using Hawser clean and smudge filters. +* Prevent a path from using Git LFS clean and smudge filters. - `git hawser rm *.gif` + `git lfs rm *.gif` ## SEE ALSO -git-hawser-add(1), git-hawser-path(1), git-hawser-init(1), gitattributes(5). +git-lfs-add(1), git-lfs-path(1), git-lfs-init(1), gitattributes(5). -Part of the git-hawser(1) suite. +Part of the git-lfs(1) suite. diff --git a/docs/man/git-hawser-smudge.1.ronn b/docs/man/git-hawser-smudge.1.ronn index 14556ff4..03062c88 100644 --- a/docs/man/git-hawser-smudge.1.ronn +++ b/docs/man/git-hawser-smudge.1.ronn @@ -1,9 +1,9 @@ -git-hawser-smudge(1) -- Git smudge filter that converts pointer in blobs to the actual content. +git-lfs-smudge(1) -- Git smudge filter that converts pointer in blobs to the actual content. ============================================================================================== ## SYNOPSIS -`git hawser smudge` +`git lfs smudge` ## DESCRIPTION @@ -17,7 +17,7 @@ Git attributes. ## OPTIONS -Without any options, `git hawser smudge` will output the raw hawser content to +Without any options, `git lfs smudge` will output the raw hawser content to STDOUT. * `--info`: @@ -26,6 +26,6 @@ STDOUT. ## SEE ALSO -git-hawser-init(1), gitattributes(5). +git-lfs-init(1), gitattributes(5). -Part of the git-hawser(1) suite. +Part of the git-lfs(1) suite. diff --git a/docs/man/git-hawser-status.1.ronn b/docs/man/git-hawser-status.1.ronn index 025e1cc5..fb6fdf66 100644 --- a/docs/man/git-hawser-status.1.ronn +++ b/docs/man/git-hawser-status.1.ronn @@ -1,14 +1,14 @@ -git-hawser-status(1) -- Show the status of hawser files in the working tree +git-lfs-status(1) -- Show the status of Git LFS files in the working tree ============================================================================ ## SYNOPSIS -`git hawser status` [] +`git lfs status` [] ## DESCRIPTION -Displays paths of hawser files that have not been pushed to the hawser server, -have differences between the index file and the current HEAD commit, +Displays paths of Git LFS objects that have not been pushed to the Git LFS +server, have differences between the index file and the current HEAD commit, and paths that have differences between the working tree and the index file. Thi first are what you would push by running git push; the second are what you would commit by running git commit; the third are what you could commit @@ -21,6 +21,6 @@ by running git add before running git commit. ## SEE ALSO -git-hawser-ls-files(1). +git-lfs-ls-files(1). -Part of the git-hawser(1) suite. +Part of the git-lfs(1) suite. diff --git a/docs/man/git-hawser.1.ronn b/docs/man/git-hawser.1.ronn index 8a3795c2..9f3dc02a 100644 --- a/docs/man/git-hawser.1.ronn +++ b/docs/man/git-hawser.1.ronn @@ -1,9 +1,9 @@ -git-hawser(1) -- Work with large files in Git repositories. +git-lfs(1) -- Work with large files in Git repositories. ========================================================== ## SYNOPSIS -`git hawser` [] +`git lfs` [] ## DESCRIPTION @@ -20,20 +20,20 @@ commands and low level ("plumbing") commands. ### High-level commands (porcelain) -* git-hawser-config(1): +* git-lfs-config(1): Display the Git Media environment. -* git-hawser-init(1): +* git-lfs-init(1): Ensure Git Media is configured properly. -* git-hawser-logs(1): - Show errors from the git-hawser command. -* git-hawser-path(1): +* git-lfs-logs(1): + Show errors from the git-lfs command. +* git-lfs-path(1): View and modify Git Media paths in Git attributes. -* git-hawser-push(1): +* git-lfs-push(1): Push queued large files to the Git Media endpoint. ### Low level commands (plumbing) -* git-hawser-clean(1): +* git-lfs-clean(1): Git clean filter that converts large files to pointers. -* git-hawser-smudge(1): +* git-lfs-smudge(1): Git smudge filter that converts pointer in blobs to the actual content. diff --git a/docs/spec.md b/docs/spec.md index e9aa2d1e..21ee572e 100644 --- a/docs/spec.md +++ b/docs/spec.md @@ -1,16 +1,16 @@ -# Hawser Specification +# Git LFS Specification -This is a general guide for Hawser clients. Typically it should be -implemented by a command line `git-hawser` tool, but the details may be useful +This is a general guide for Git LFS clients. Typically it should be +implemented by a command line `git-lfs` tool, but the details may be useful for other tools. ## The Pointer -The core Hawser idea is that instead of writing large blobs to a Git repository, +The core Git LFS idea is that instead of writing large blobs to a Git repository, only a pointer file is written. ``` -version https://hawser.github.com/spec/v1 +version https://git-lfs.github.com/spec/v1 oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393 size 12345 (ending \n) @@ -24,7 +24,7 @@ translate to the same Git blob OID. This means: * Use properties "version", "oid", and "size" in that order. * Separate the property from its value with a single space. * Oid has a "sha256:" prefix. No other hashing methods are currently supported -for Hawser oids. +for Git LFS oids. * Size is in bytes. Note: Earlier versions only contained the OID, with a `# comment` above it. @@ -47,38 +47,38 @@ generated from the SHA-256 signature of the file's contents. ## The Server -Hawser needs a URL endpoint to talk to a remote server. A Git repository -can have different hawser endpoints for different remotes. Here is the list +Git LFS needs a URL endpoint to talk to a remote server. A Git repository +can have different Git LFS endpoints for different remotes. Here is the list of rules that Git Media uses to determine a repository's Git Media server: -1. The `hawser.url` string. -2. The `remote.{name}.hawser` string. +1. The `lfs.url` string. +2. The `remote.{name}.lfs` string. 3. Append `/info/media` to the remote URL. Only works with HTTPS URLs. -Here's a sample Git config file with the optional remote and hawser configuration -options: +Here's a sample Git config file with the optional remote and Git LFS +configuration options: ``` [core] repositoryformatversion = 0 -[hawser] +[lfs] endpoint = "https://github.com/github/assets-team/info/media" [remote "origin"] url = https://github.com/github/assets-team fetch = +refs/heads/*:refs/remotes/origin/* - hawser = "https://github.com/github/assets-team/info/media" + lfs = "https://github.com/github/assets-team/info/media" ``` -Hawser uses `git credential` to fetch credentials for HTTPS requests. Setup +Git LFS uses `git credential` to fetch credentials for HTTPS requests. Setup a credential cache helper to save passwords for future users. ## Intercepting Git -Hawser uses the `clean` and `smudge` filters to decide which files use -Hawser. The global filters can be set up with `git hawser init`: +Git LFS uses the `clean` and `smudge` filters to decide which files use it. The +global filters can be set up with `git lfs init`: ``` -$ git hawser init +$ git lfs init ``` The `clean` filter runs as files are added to repositories. Git sends the @@ -87,15 +87,15 @@ to Git as STDOUT. * Stream binary content from STDIN to a temp file, while calculating its SHA-256 signature. -* Check for the file at `.git/hawser/objects/{OID}`. +* Check for the file at `.git/lfs/objects/{OID}`. * If it does not exist: * Queue the OID to be uploaded. - * Move the temp file to `.git/hawser/objects/{OID}`. + * Move the temp file to `.git/lfs/objects/{OID}`. * Delete the temp file. * Write the pointer file to STDOUT. Note that the `clean` filter does not push the file to the server. Use the -`git hawser sync` command to do that. +`git lfs sync` command to do that. The `smudge` filter runs as files are being checked out from the Git repository to the working directory. Git sends the content of the Git blob as STDIN, and @@ -103,7 +103,7 @@ expects the content to write to the working directory as STDOUT. * Read 100 bytes. * If the content is ASCII and matches the pointer file format: - * Look for the file in `.git/hawser/objects/{OID}`. + * Look for the file in `.git/lfs/objects/{OID}`. * If it's not there, download it from the server. * Read its contents to STDOUT * Otherwise, simply pass the STDIN out through STDOUT. @@ -113,8 +113,8 @@ runs all mp3 and zip files through Git Media: ``` $ cat .gitattributes -*.mp3 filter=hawser -crlf -*.zip filter=hawser -crlf +*.mp3 filter=lfs -crlf +*.zip filter=lfs -crlf ``` -Use the `git hawser path` command to view and add to `.gitattributes`. +Use the `git lfs path` command to view and add to `.gitattributes`. diff --git a/hawser/client.go b/lfs/client.go similarity index 99% rename from hawser/client.go rename to lfs/client.go index 59cce9b7..7f44b35a 100644 --- a/hawser/client.go +++ b/lfs/client.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "bytes" diff --git a/hawser/client_download_test.go b/lfs/client_download_test.go similarity index 95% rename from hawser/client_download_test.go rename to lfs/client_download_test.go index 8abff2d0..d36ffcff 100644 --- a/hawser/client_download_test.go +++ b/lfs/client_download_test.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "encoding/json" @@ -29,7 +29,7 @@ func TestDownload(t *testing.T) { w.Write([]byte("test")) }) - Config.SetConfig("hawser.url", server.URL+"/media") + Config.SetConfig("lfs.url", server.URL+"/media") reader, size, wErr := Download("whatever/oid") if wErr != nil { t.Fatalf("unexpected error: %s", wErr) @@ -100,7 +100,7 @@ func TestDownloadFromMeta(t *testing.T) { w.Write([]byte("test")) }) - Config.SetConfig("hawser.url", server.URL+"/media") + Config.SetConfig("lfs.url", server.URL+"/media") reader, size, wErr := Download("whatever/oid") if wErr != nil { t.Fatalf("unexpected error: %s", wErr) @@ -152,7 +152,7 @@ func TestDownloadWithRedirect(t *testing.T) { w.Write([]byte("test")) }) - Config.SetConfig("hawser.url", server.URL+"/media") + Config.SetConfig("lfs.url", server.URL+"/media") reader, size, wErr := Download("whatever/oid") if wErr != nil { t.Fatalf("unexpected error: %s", wErr) diff --git a/hawser/client_legacy_test.go b/lfs/client_legacy_test.go similarity index 93% rename from hawser/client_legacy_test.go rename to lfs/client_legacy_test.go index 3b846942..675c3edb 100644 --- a/hawser/client_legacy_test.go +++ b/lfs/client_legacy_test.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "io/ioutil" @@ -29,7 +29,7 @@ func TestDownloadWithMediaHeader(t *testing.T) { w.Write([]byte("--download-header\ntest")) }) - Config.SetConfig("hawser.url", server.URL+"/media") + Config.SetConfig("lfs.url", server.URL+"/media") reader, size, wErr := Download("whatever/oid") if wErr != nil { t.Fatalf("unexpected error: %s", wErr) @@ -76,7 +76,7 @@ func TestPut(t *testing.T) { w.WriteHeader(200) }) - Config.SetConfig("hawser.url", server.URL+"/media") + Config.SetConfig("lfs.url", server.URL+"/media") oidPath := filepath.Join(tmp, "oid") if err := ioutil.WriteFile(oidPath, []byte("test"), 0744); err != nil { t.Fatalf("Unable to write oid file: %s", err) @@ -103,7 +103,7 @@ func TestOptions(t *testing.T) { w.WriteHeader(200) }) - Config.SetConfig("hawser.url", server.URL+"/media") + Config.SetConfig("lfs.url", server.URL+"/media") oidPath := filepath.Join(tmp, "oid") if err := ioutil.WriteFile(oidPath, []byte("test"), 0744); err != nil { t.Fatalf("Unable to write oid file: %s", err) diff --git a/hawser/client_test.go b/lfs/client_test.go similarity index 95% rename from hawser/client_test.go rename to lfs/client_test.go index 29bbc85c..08e341df 100644 --- a/hawser/client_test.go +++ b/lfs/client_test.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "encoding/json" @@ -22,7 +22,7 @@ func TestExternalPut(t *testing.T) { defer server.Close() defer os.RemoveAll(tmp) - Config.SetConfig("hawser.url", server.URL+"/media") + Config.SetConfig("lfs.url", server.URL+"/media") oidPath := filepath.Join(tmp, "oid") if err := ioutil.WriteFile(oidPath, []byte("test"), 0744); err != nil { t.Fatalf("Unable to write oid file: %s", err) @@ -161,7 +161,7 @@ func TestPost(t *testing.T) { }`)) }) - Config.SetConfig("hawser.url", server.URL+"/media") + Config.SetConfig("lfs.url", server.URL+"/media") oidPath := filepath.Join(tmp, "oid") if err := ioutil.WriteFile(oidPath, []byte("test"), 0744); err != nil { t.Fatalf("Unable to write oid file: %s", err) @@ -207,7 +207,7 @@ func TestPost(t *testing.T) { } func tempdir(t *testing.T) string { - dir, err := ioutil.TempDir("", "hawser-test-hawser") + dir, err := ioutil.TempDir("", "git-lfs-test") if err != nil { t.Fatalf("Error getting temp dir: %s", err) } diff --git a/hawser/client_upload_test.go b/lfs/client_upload_test.go similarity index 97% rename from hawser/client_upload_test.go rename to lfs/client_upload_test.go index 881eb730..ad0d79ae 100644 --- a/hawser/client_upload_test.go +++ b/lfs/client_upload_test.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "encoding/json" @@ -125,7 +125,7 @@ func TestUploadWithVerify(t *testing.T) { w.WriteHeader(200) }) - Config.SetConfig("hawser.url", server.URL+"/media") + Config.SetConfig("lfs.url", server.URL+"/media") oidPath := filepath.Join(tmp, "oid") if err := ioutil.WriteFile(oidPath, []byte("test"), 0744); err != nil { t.Fatalf("Unable to write oid file: %s", err) diff --git a/hawser/config.go b/lfs/config.go similarity index 94% rename from hawser/config.go rename to lfs/config.go index 2f753546..39e5786c 100644 --- a/hawser/config.go +++ b/lfs/config.go @@ -1,8 +1,8 @@ -package hawser +package lfs import ( "fmt" - "github.com/hawser/git-hawser/git" + "github.com/github/git-lfs/git" "net/http" "net/url" "os" @@ -36,7 +36,7 @@ func NewConfig() *Configuration { } func (c *Configuration) Endpoint() string { - if url, ok := c.GitConfig("hawser.url"); ok { + if url, ok := c.GitConfig("lfs.url"); ok { return url } @@ -54,7 +54,7 @@ func (c *Configuration) RemoteEndpoint(remote string) string { remote = defaultRemote } - if url, ok := c.GitConfig("remote." + remote + ".hawser"); ok { + if url, ok := c.GitConfig("remote." + remote + ".lfs"); ok { return url } diff --git a/hawser/config_test.go b/lfs/config_test.go similarity index 90% rename from hawser/config_test.go rename to lfs/config_test.go index 63ac8f71..3535be84 100644 --- a/hawser/config_test.go +++ b/lfs/config_test.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "github.com/bmizerany/assert" @@ -7,7 +7,7 @@ import ( func TestEndpointDefaultsToOrigin(t *testing.T) { config := &Configuration{ - gitConfig: map[string]string{"remote.origin.hawser": "abc"}, + gitConfig: map[string]string{"remote.origin.lfs": "abc"}, remotes: []string{}, } @@ -17,8 +17,8 @@ func TestEndpointDefaultsToOrigin(t *testing.T) { func TestEndpointOverridesOrigin(t *testing.T) { config := &Configuration{ gitConfig: map[string]string{ - "hawser.url": "abc", - "remote.origin.hawser": "def", + "lfs.url": "abc", + "remote.origin.lfs": "def", }, remotes: []string{}, } @@ -29,8 +29,8 @@ func TestEndpointOverridesOrigin(t *testing.T) { func TestEndpointNoOverrideDefaultRemote(t *testing.T) { config := &Configuration{ gitConfig: map[string]string{ - "remote.origin.hawser": "abc", - "remote.other.hawser": "def", + "remote.origin.lfs": "abc", + "remote.other.lfs": "def", }, remotes: []string{}, } @@ -41,8 +41,8 @@ func TestEndpointNoOverrideDefaultRemote(t *testing.T) { func TestEndpointUseAlternateRemote(t *testing.T) { config := &Configuration{ gitConfig: map[string]string{ - "remote.origin.hawser": "abc", - "remote.other.hawser": "def", + "remote.origin.lfs": "abc", + "remote.other.lfs": "def", }, remotes: []string{}, } @@ -116,7 +116,7 @@ func TestObjectUrl(t *testing.T) { } for endpoint, expected := range tests { - Config.SetConfig("hawser.url", endpoint) + Config.SetConfig("lfs.url", endpoint) assert.Equal(t, expected, Config.ObjectUrl(oid).String()) } } diff --git a/hawser/credentials.go b/lfs/credentials.go similarity index 95% rename from hawser/credentials.go rename to lfs/credentials.go index 13485b91..660dbd47 100644 --- a/hawser/credentials.go +++ b/lfs/credentials.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "bytes" @@ -43,7 +43,7 @@ func NewCommand(input Creds, subCommand string) *CredentialCmd { process is the process that fires up the daemon, it will wait forever (until the daemon exits, really) trying to read from stderr. - See https://github.com/hawser/git-hawser/issues/117 for more details. + See https://github.com/github/git-lfs/issues/117 for more details. */ return &CredentialCmd{buf1, subCommand, cmd} diff --git a/hawser/credentials_test.go b/lfs/credentials_test.go similarity index 99% rename from hawser/credentials_test.go rename to lfs/credentials_test.go index e7c86188..37987001 100644 --- a/hawser/credentials_test.go +++ b/lfs/credentials_test.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "encoding/base64" diff --git a/hawser/errors.go b/lfs/errors.go similarity index 98% rename from hawser/errors.go rename to lfs/errors.go index ddf667ea..c66a8c4f 100644 --- a/hawser/errors.go +++ b/lfs/errors.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "fmt" diff --git a/hawser/hawser.go b/lfs/hawser.go similarity index 91% rename from hawser/hawser.go rename to lfs/hawser.go index 355372c6..0227ec70 100644 --- a/hawser/hawser.go +++ b/lfs/hawser.go @@ -1,8 +1,8 @@ -package hawser +package lfs import ( "fmt" - "github.com/hawser/git-hawser/git" + "github.com/github/git-lfs/git" "github.com/rubyist/tracerx" "io/ioutil" "os" @@ -15,7 +15,7 @@ const Version = "0.4.1" var ( LargeSizeThreshold = 5 * 1024 * 1024 - TempDir = filepath.Join(os.TempDir(), "hawser") + TempDir = filepath.Join(os.TempDir(), "git-lfs") UserAgent string LocalWorkingDir string LocalGitDir string @@ -75,13 +75,13 @@ func init() { var err error tracerx.DefaultKey = "GIT" - tracerx.Prefix = "trace hawser: " + tracerx.Prefix = "trace git-lfs: " LocalWorkingDir, LocalGitDir, err = resolveGitDir() if err == nil { - LocalMediaDir = filepath.Join(LocalGitDir, "hawser", "objects") + LocalMediaDir = filepath.Join(LocalGitDir, "lfs", "objects") LocalLogDir = filepath.Join(LocalMediaDir, "logs") - TempDir = filepath.Join(LocalGitDir, "hawser", "tmp") + TempDir = filepath.Join(LocalGitDir, "lfs", "tmp") if err := os.MkdirAll(LocalMediaDir, 0744); err != nil { panic(fmt.Errorf("Error trying to create objects directory in '%s': %s", LocalMediaDir, err)) @@ -102,7 +102,7 @@ func init() { gitVersion = "unknown" } - UserAgent = fmt.Sprintf("git-hawser/%s (GitHub; %s %s; git %s; go %s)", Version, + UserAgent = fmt.Sprintf("git-lfs/%s (GitHub; %s %s; git %s; go %s)", Version, runtime.GOOS, runtime.GOARCH, strings.Replace(gitVersion, "git version ", "", 1), diff --git a/hawser/http.go b/lfs/http.go similarity index 99% rename from hawser/http.go rename to lfs/http.go index fb6948de..ff689280 100644 --- a/hawser/http.go +++ b/lfs/http.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "crypto/tls" diff --git a/hawser/setup.go b/lfs/setup.go similarity index 82% rename from hawser/setup.go rename to lfs/setup.go index 0fd2cad2..0e68ceee 100644 --- a/hawser/setup.go +++ b/lfs/setup.go @@ -1,9 +1,9 @@ -package hawser +package lfs import ( "errors" "fmt" - "github.com/hawser/git-hawser/git" + "github.com/github/git-lfs/git" "io/ioutil" "os" "path/filepath" @@ -12,7 +12,7 @@ import ( var ( valueRegexp = regexp.MustCompile("\\Agit[\\-\\s]media") - prePushHook = []byte("#!/bin/sh\ngit hawser push --stdin $*\n") + prePushHook = []byte("#!/bin/sh\ngit lfs push --stdin $*\n") NotInARepositoryError = errors.New("Not in a repository") ) @@ -55,8 +55,8 @@ func InstallFilters() error { } func setFilter(filterName string) error { - key := fmt.Sprintf("filter.hawser.%s", filterName) - value := fmt.Sprintf("git hawser %s %%f", filterName) + key := fmt.Sprintf("filter.lfs.%s", filterName) + value := fmt.Sprintf("git lfs %s %%f", filterName) existing := git.Config.Find(key) if shouldReset(existing) { @@ -70,7 +70,7 @@ func setFilter(filterName string) error { } func requireFilters() error { - key := "filter.hawser.required" + key := "filter.lfs.required" value := "true" existing := git.Config.Find(key) @@ -78,7 +78,7 @@ func requireFilters() error { git.Config.UnsetGlobal(key) git.Config.SetGlobal(key, value) } else if existing != value { - return errors.New("Hawser filters should be required but are not.") + return errors.New("Git LFS filters should be required but are not.") } return nil diff --git a/hawser/util.go b/lfs/util.go similarity index 93% rename from hawser/util.go rename to lfs/util.go index 86252803..a004a1f7 100644 --- a/hawser/util.go +++ b/lfs/util.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "fmt" @@ -44,13 +44,13 @@ func CopyWithCallback(writer io.Writer, reader io.Reader, totalSize int64, cb Co } func CopyCallbackFile(event, filename string, index, totalFiles int) (CopyCallback, *os.File, error) { - logPath := os.Getenv("HAWSER_PROGRESS") + logPath := os.Getenv("GIT_LFS_PROGRESS") if len(logPath) == 0 || len(filename) == 0 || len(event) == 0 { return nil, nil, nil } if !filepath.IsAbs(logPath) { - return nil, nil, fmt.Errorf("HAWSER_PROGRESS must be an absolute path") + return nil, nil, fmt.Errorf("GIT_LFS_PROGRESS must be an absolute path") } cbDir := filepath.Dir(logPath) diff --git a/hawser/util_test.go b/lfs/util_test.go similarity index 98% rename from hawser/util_test.go rename to lfs/util_test.go index 5d0d31dd..5c8880bc 100644 --- a/hawser/util_test.go +++ b/lfs/util_test.go @@ -1,4 +1,4 @@ -package hawser +package lfs import ( "bytes" diff --git a/pointer/clean.go b/pointer/clean.go index 36bbe1ee..2eec9cc4 100644 --- a/pointer/clean.go +++ b/pointer/clean.go @@ -3,7 +3,7 @@ package pointer import ( "crypto/sha256" "encoding/hex" - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "io" "os" ) @@ -14,8 +14,8 @@ type cleanedAsset struct { *Pointer } -func Clean(reader io.Reader, size int64, cb hawser.CopyCallback) (*cleanedAsset, error) { - tmp, err := hawser.TempFile("") +func Clean(reader io.Reader, size int64, cb lfs.CopyCallback) (*cleanedAsset, error) { + tmp, err := lfs.TempFile("") if err != nil { return nil, err } @@ -27,7 +27,7 @@ func Clean(reader io.Reader, size int64, cb hawser.CopyCallback) (*cleanedAsset, cb = nil } - written, err := hawser.CopyWithCallback(writer, reader, size, cb) + written, err := lfs.CopyWithCallback(writer, reader, size, cb) pointer := NewPointer(hex.EncodeToString(oidHash.Sum(nil)), written) return &cleanedAsset{tmp, "", pointer}, err diff --git a/pointer/pointer.go b/pointer/pointer.go index a8445b69..9b7579f2 100644 --- a/pointer/pointer.go +++ b/pointer/pointer.go @@ -5,7 +5,7 @@ import ( "bytes" "errors" "fmt" - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "io" "regexp" "strconv" @@ -16,7 +16,7 @@ var ( MediaWarning = []byte("# git-media\n") alpha = "http://git-media.io/v/1" beta = "http://git-media.io/v/2" - latest = "https://hawser.github.com/spec/v1" + latest = "https://git-lfs.github.com/spec/v1" oidType = "sha256" alphaHeaderRE = regexp.MustCompile(`\A# (.*git-media|external)`) oidRE = regexp.MustCompile(`\A[0-9a-fA-F]{64}`) @@ -24,7 +24,7 @@ var ( oid sha256:%s size %d ` - matcherRE = regexp.MustCompile("git-media|hawser") + matcherRE = regexp.MustCompile("git-media|hawser|git-lfs") pointerKeys = []string{"version", "oid", "size"} ) @@ -39,7 +39,7 @@ func NewPointer(oid string, size int64) *Pointer { return &Pointer{latest, oid, size, oidType} } -func (p *Pointer) Smudge(writer io.Writer, cb hawser.CopyCallback) error { +func (p *Pointer) Smudge(writer io.Writer, cb lfs.CopyCallback) error { return Smudge(writer, p, cb) } @@ -117,7 +117,7 @@ func decodeKVData(data []byte) (map[string]string, error) { m := make(map[string]string) if !matcherRE.Match(data) { - return m, fmt.Errorf("Not a valid Git Media pointer file.") + return m, fmt.Errorf("Not a valid Git LFS pointer file.") } scanner := bufio.NewScanner(bytes.NewBuffer(data)) diff --git a/pointer/pointer_test.go b/pointer/pointer_test.go index b915b888..8d0e9e4b 100644 --- a/pointer/pointer_test.go +++ b/pointer/pointer_test.go @@ -15,7 +15,7 @@ func TestEncode(t *testing.T) { assert.Equal(t, nil, err) bufReader := bufio.NewReader(&buf) - assertLine(t, bufReader, "version https://hawser.github.com/spec/v1\n") + assertLine(t, bufReader, "version https://git-lfs.github.com/spec/v1\n") assertLine(t, bufReader, "oid sha256:booya\n") assertLine(t, bufReader, "size 12345\n") @@ -32,8 +32,8 @@ func assertLine(t *testing.T, r *bufio.Reader, expected string) { assert.Equal(t, expected, actual) } -func TestHawserIniDecode(t *testing.T) { - ex := `version https://hawser.github.com/spec/v1 +func TestLFSIniDecode(t *testing.T) { + ex := `version https://git-lfs.github.com/spec/v1 oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393 size 12345` @@ -80,12 +80,12 @@ func TestDecodeInvalid(t *testing.T) { "# git-media", // bad oid type - `version https://hawser.github.com/spec/v1 + `version https://git-lfs.github.com/spec/v1 oid shazam:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393 size 12345`, // no oid - `version https://hawser.github.com/spec/v1 + `version https://git-lfs.github.com/spec/v1 size 12345`, // bad version @@ -98,16 +98,16 @@ size 12345`, size 12345`, // bad size - `version https://hawser.github.com/spec/v1 + `version https://git-lfs.github.com/spec/v1 oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393 size fif`, // no size - `version https://hawser.github.com/spec/v1 + `version https://git-lfs.github.com/spec/v1 oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393`, // bad `key value` format - `version=https://hawser.github.com/spec/v1 + `version=https://git-lfs.github.com/spec/v1 oid=sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393 size=fif`, @@ -117,13 +117,13 @@ oid=sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393 size=fif`, // extra key - `version https://hawser.github.com/spec/v1 + `version https://git-lfs.github.com/spec/v1 oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393 size 12345 wat wat`, // keys out of order - `version https://hawser.github.com/spec/v1 + `version https://git-lfs.github.com/spec/v1 size 12345 oid sha256:4d7a214614ab2935c943f9e0ff69d22eadbb8f32b1258daaa5e2ca24d17e2393`, } diff --git a/pointer/smudge.go b/pointer/smudge.go index aed78dcb..1b9ab3d0 100644 --- a/pointer/smudge.go +++ b/pointer/smudge.go @@ -1,19 +1,19 @@ package pointer import ( - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "github.com/technoweenie/go-contentaddressable" "io" "os" ) -func Smudge(writer io.Writer, ptr *Pointer, cb hawser.CopyCallback) error { - mediafile, err := hawser.LocalMediaPath(ptr.Oid) +func Smudge(writer io.Writer, ptr *Pointer, cb lfs.CopyCallback) error { + mediafile, err := lfs.LocalMediaPath(ptr.Oid) if err != nil { return err } - var wErr *hawser.WrappedError + var wErr *lfs.WrappedError if stat, statErr := os.Stat(mediafile); statErr != nil || stat == nil { wErr = downloadFile(writer, ptr, mediafile, cb) } else { @@ -27,8 +27,8 @@ func Smudge(writer io.Writer, ptr *Pointer, cb hawser.CopyCallback) error { } } -func downloadFile(writer io.Writer, ptr *Pointer, mediafile string, cb hawser.CopyCallback) *hawser.WrappedError { - reader, size, wErr := hawser.Download(mediafile) +func downloadFile(writer io.Writer, ptr *Pointer, mediafile string, cb lfs.CopyCallback) *lfs.WrappedError { + reader, size, wErr := lfs.Download(mediafile) if reader != nil { defer reader.Close() } @@ -44,26 +44,26 @@ func downloadFile(writer io.Writer, ptr *Pointer, mediafile string, cb hawser.Co mediaFile, err := contentaddressable.NewFile(mediafile) if err != nil { - return hawser.Errorf(err, "Error opening media file buffer.") + return lfs.Errorf(err, "Error opening media file buffer.") } - _, err = hawser.CopyWithCallback(mediaFile, reader, ptr.Size, cb) + _, err = lfs.CopyWithCallback(mediaFile, reader, ptr.Size, cb) if err == nil { err = mediaFile.Accept() } mediaFile.Close() if err != nil { - return hawser.Errorf(err, "Error buffering media file.") + return lfs.Errorf(err, "Error buffering media file.") } return readLocalFile(writer, ptr, mediafile, nil) } -func readLocalFile(writer io.Writer, ptr *Pointer, mediafile string, cb hawser.CopyCallback) *hawser.WrappedError { +func readLocalFile(writer io.Writer, ptr *Pointer, mediafile string, cb lfs.CopyCallback) *lfs.WrappedError { reader, err := os.Open(mediafile) if err != nil { - return hawser.Errorf(err, "Error opening media file.") + return lfs.Errorf(err, "Error opening media file.") } defer reader.Close() @@ -73,12 +73,12 @@ func readLocalFile(writer io.Writer, ptr *Pointer, mediafile string, cb hawser.C } } - _, err = hawser.CopyWithCallback(writer, reader, ptr.Size, cb) - return hawser.Errorf(err, "Error reading from media file.") + _, err = lfs.CopyWithCallback(writer, reader, ptr.Size, cb) + return lfs.Errorf(err, "Error reading from media file.") } type SmudgeError struct { Oid string Filename string - *hawser.WrappedError + *lfs.WrappedError } diff --git a/scanner/scanner.go b/scanner/scanner.go index f3160fff..81628289 100644 --- a/scanner/scanner.go +++ b/scanner/scanner.go @@ -3,7 +3,7 @@ package scanner import ( "bufio" "bytes" - "github.com/hawser/git-hawser/pointer" + "github.com/github/git-lfs/pointer" "github.com/rubyist/tracerx" "io" "os/exec" @@ -14,15 +14,15 @@ import ( ) const ( - // blobSizeCutoff is used to determine which files to scan for hawser pointers. - // Any file with a size below this cutoff will be scanned. + // blobSizeCutoff is used to determine which files to scan for Git LFS + // pointers. Any file with a size below this cutoff will be scanned. blobSizeCutoff = 140 // stdoutBufSize is the size of the buffers given to a sub-process stdout stdoutBufSize = 16384 - // chanBufSize is the size of the channels used to pass data from one sub-process - // to another. + // chanBufSize is the size of the channels used to pass data from one + // sub-process to another. chanBufSize = 100 ) @@ -50,7 +50,7 @@ type indexFile struct { var z40 = regexp.MustCompile(`\^?0{40}`) // Scan takes a ref and returns a slice of wrappedPointer objects -// for all hawser pointers it finds for that ref. +// for all Git LFS pointers it finds for that ref. func Scan(refLeft, refRight string) ([]*wrappedPointer, error) { nameMap := make(map[string]string, 0) start := time.Now() @@ -84,7 +84,7 @@ func Scan(refLeft, refRight string) ([]*wrappedPointer, error) { } // ScanIndex returns a slice of wrappedPointer objects for all -// hawser pointers it finds in the index. +// Git LFS pointers it finds in the index. func ScanIndex() ([]*wrappedPointer, error) { nameMap := make(map[string]*indexFile, 0) start := time.Now() @@ -282,9 +282,8 @@ func catFileBatchCheck(revs chan string) (chan string, error) { // catFileBatch uses git cat-file --batch to get the object contents // of a git object, given its sha1. The contents will be decoded into -// a hawser pointer. revs is a channel over which strings containing -// git sha1s will be sent. It returns a channel from which point.Pointers -// can be read. +// a Git LFS pointer. revs is a channel over which strings containing Git SHA1s +// will be sent. It returns a channel from which point.Pointers can be read. func catFileBatch(revs chan string) (chan *wrappedPointer, error) { cmd, err := startCommand("git", "cat-file", "--batch") if err != nil { diff --git a/script/bootstrap b/script/bootstrap index 1d1ebfef..ad26bdd4 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -5,7 +5,7 @@ script/fmt rm -rf `pwd`/bin/* rm -rf `pwd`/.vendor/pkg -export LOCALSRCDIR=`pwd`/.vendor/src/github.com/hawser/git-hawser +export LOCALSRCDIR=`pwd`/.vendor/src/github.com/github/git-lfs mkdir -p `dirname $LOCALSRCDIR` rm -f $LOCALSRCDIR ln -s `pwd` $LOCALSRCDIR diff --git a/script/build.go b/script/build.go index d43ab4e6..15911c41 100644 --- a/script/build.go +++ b/script/build.go @@ -4,7 +4,7 @@ import ( "encoding/json" "flag" "fmt" - "github.com/hawser/git-hawser/hawser" + "github.com/github/git-lfs/lfs" "os" "os/exec" "path/filepath" @@ -88,7 +88,7 @@ func mainBuild() { func build(buildos, buildarch string, buildMatrix map[string]Release) error { addenv := len(buildos) > 0 && len(buildarch) > 0 - name := "hawser-" + hawser.Version + name := "git-lfs-" + lfs.Version dir := "bin" if addenv { @@ -224,7 +224,7 @@ func logAndRun(cmd *exec.Cmd) error { } func zipName(os, arch string) string { - return fmt.Sprintf("hawser-%s-%s-%s", os, arch, hawser.Version) + return fmt.Sprintf("git-lfs-%s-%s-%s", os, arch, lfs.Version) } func releaseLabel(buildos, buildarch string) string { diff --git a/script/install.sh.example b/script/install.sh.example index 2fbb22fc..e7647560 100644 --- a/script/install.sh.example +++ b/script/install.sh.example @@ -8,9 +8,9 @@ fi mkdir -p $prefix/bin -rm -rf $prefix/bin/git-hawser* +rm -rf $prefix/bin/git-lfs* for g in git*; do cp $g "$prefix/bin/$g" done -git hawser init +git lfs init diff --git a/script/release.go b/script/release.go index 705ce7e5..496f9571 100644 --- a/script/release.go +++ b/script/release.go @@ -11,13 +11,13 @@ import ( ) var ( - ReleaseId = flag.Int("id", 0, "github/hawser Release ID") - uploadUrlFmt = "https://uploads.github.com/repos/hawser/git-hawser/releases/%d/assets?%s" + ReleaseId = flag.Int("id", 0, "github/git-lfs Release ID") + uploadUrlFmt = "https://uploads.github.com/repos/github/git-lfs/releases/%d/assets?%s" ) func mainRelease() { if *ReleaseId < 1 { - fmt.Println("Need a valid github/hawser release id.") + fmt.Println("Need a valid github/git-lfs release id.") fmt.Println("usage: script/release -id") os.Exit(1) } diff --git a/script/run b/script/run index 48a37a9e..e3db43ef 100755 --- a/script/run +++ b/script/run @@ -1,2 +1,2 @@ script/fmt -GOPATH="`pwd`/.vendor" go run cmd/git-hawser.go "$@" +GOPATH="`pwd`/.vendor" go run cmd/git-lfs.go "$@" diff --git a/script/test b/script/test index b8d66725..8fc18397 100755 --- a/script/test +++ b/script/test @@ -5,7 +5,7 @@ script/fmt script/bootstrap -export LOCALSRCDIR=`pwd`/.vendor/src/github.com/hawser/git-hawser +export LOCALSRCDIR=`pwd`/.vendor/src/github.com/github/git-lfs mkdir -p `dirname $LOCALSRCDIR` rm -f $LOCALSRCDIR ln -s `pwd` $LOCALSRCDIR