Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is git hawser?

Tags:

git

git-config

I recently discovered my .gitconfig had been appended these few additional lines:

[filter "hawser"]
    clean = git hawser clean %f
    smudge = git hawser smudge %f
    required = true

Since it is version-controlled, I am sure I did not add them. It seems I am not the only one to have these lines.

However: git: 'hawser' is not a git command. git help doesn't give any additional information.

So, what is this “hawser” filter?

like image 273
MattiSG Avatar asked Feb 27 '15 11:02

MattiSG


2 Answers

I found the change in my .gitconfig coincided with an update to github for mac exactly, which is why I labeled it as such in my repo.

As to what Hawser actually is, Github for mac has it bundled at the /Applications/GitHub.app/Contents/Resources/hawser/bin/git-hawser path.

running the executable with --help=false yields:

git-hawser/0.4.0 (GitHub; darwin amd64; git 2.3.0; go 1.3)

Usage: 
  git-hawser [flags]
  git-hawser [command]

Available Commands: 
  add                       Add an entry to .gitattributes
  clean                     Implements the Git clean filter
  env                       Show the current environment
  init                      Initialize the default Git Media configuration
  logs                      View error logs
  ls-files                  Show information about hawser files
  path                      Manipulate .gitattributes
  push                      Push files to the hawser endpoint
  rm                        Remove an entry from .gitattributes
  remove                    Remove an entry from .gitattributes
  smudge                    Implements the Git smudge filter
  status                    Show information about hawser files that would be pushed
  update                    Update local hawser configuration
  version                   Show the version number
  help [command]            Help about any command

 Available Flags:
      --help=false: help for git-hawser

Use "git-hawser help [command]" for more information about that command.

Running strings on a few executables in GitHub.app turns up the string git-media|hawser which in addition to the usage message firmly indicates that git-hawser is a fork or reimplementation of git-media used to store large files outside of the git repo, as github has a hard 100MB file size limit. I'm testing now to see what happens if you try and upload a huge file through GitHub.app.

Turns out that GitHub.app doesn't use git-hawser automatically when dealing with large files, but strings reveals that it does have the ability to interact with a git-hawser process.

Installing the command line tools installs the github tool and git-hawser to /usr/local/bin. Running git-hawser version -c gives:

git-hawser/0.4.0 (GitHub; darwin amd64; git 2.3.3; go 1.3)
Nothing may see Gah Lak Tus and survive!

This seems related: https://github.com/blog/1986-announcing-git-large-file-storage-lfs

And lo, hawser filters were duplicated as lfs (large-file-support):

[filter "lfs"]
  clean = git lfs clean %f
  smudge = git lfs smudge %f
  required = true
like image 200
Camden Narzt Avatar answered Oct 14 '22 12:10

Camden Narzt


hawser is an old name for Git LFS (and git-media is the even older name), so I believe that can be dropped.

Googling this is really hard, but I finally found the commit renaming the project from hawser to lfs (https://github.com/github/git-lfs/commit/e37b69547710e2a341bc7904d291029ac594b3be), and another mentioning the old git-media name (https://github.com/github/git-lfs/commit/eac36d7f04074882a7e3c9ad2cfc1d4f4a7b08fd).

So, of these blocks in ~/.gitconfig, removing the "media" and "hawser" blocks should be safe, especially once you install git-lfs. In other words, from this config blocks:

[filter "media"]
        required = true
        clean = git media clean %f
        smudge = git media smudge %f
[filter "hawser"]
        clean = git hawser clean %f
        smudge = git hawser smudge %f
        required = true
[filter "lfs"]
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge -- %f
        required = true

you can go to

[filter "lfs"]
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge -- %f
        required = true
like image 32
Blaisorblade Avatar answered Oct 14 '22 11:10

Blaisorblade