{"id":13740641,"url":"https://github.com/kiedtl/gfetch","last_synced_at":"2025-03-21T07:30:38.634Z","repository":{"id":54375412,"uuid":"254454878","full_name":"kiedtl/gfetch","owner":"kiedtl","description":"A lightweight, fast Git fetch script written in POSIX sh.","archived":false,"fork":false,"pushed_at":"2021-02-22T13:39:50.000Z","size":239,"stargazers_count":58,"open_issues_count":3,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-01T03:51:16.475Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kiedtl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-04-09T18:59:19.000Z","updated_at":"2024-11-22T03:51:20.000Z","dependencies_parsed_at":"2022-08-13T13:50:16.741Z","dependency_job_id":null,"html_url":"https://github.com/kiedtl/gfetch","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiedtl%2Fgfetch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiedtl%2Fgfetch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiedtl%2Fgfetch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kiedtl%2Fgfetch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kiedtl","download_url":"https://codeload.github.com/kiedtl/gfetch/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244119325,"owners_count":20400976,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-03T04:00:50.837Z","updated_at":"2025-03-21T07:30:38.191Z","avatar_url":"https://github.com/kiedtl.png","language":"Shell","readme":"\u003ch1 align=center\u003egfetch\u003c/h1\u003e\n\u003cp align=center\u003e\u003cb\u003e\u003ca href=\"#what\"\u003ewhat?\u003c/a\u003e | \u003ca href=\"#where\"\u003ewhere?\u003c/a\u003e | \u003ca href=\"#how\"\u003ehow?\u003c/a\u003e | \u003ca href=\"#why\"\u003ewhy?\u003c/a\u003e | \u003ca href=\"#faq\"\u003efaq\u003c/a\u003e | \u003ca href=\"#license\"\u003elicense\u003c/a\u003e\u003c/b\u003e\u003c/p\u003e\n\u003chr\u003e\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"GitHub code size in bytes\" src=\"https://img.shields.io/github/languages/code-size/lptstr/gfetch\"\u003e\n\u003cimg alt=\"Lines of code\" src=\"https://img.shields.io/badge/lines%20of%20code-%3E500-blue\"\u003e\n\u003ca href=\"./COPYING\"\u003e\u003cimg src=\"https://img.shields.io/badge/license-MIT-blue.svg\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/lptstr/gfetch/releases\"\u003e\u003cimg src=\"https://img.shields.io/github/release/lptstr/gfetch.svg\"\u003e\u003c/a\u003e\n\u003cbr\u003e\n\u003cimg alt=\"build with Neovim\" src=\"https://img.shields.io/badge/built%20with-Neovim-green\"\u003e\n\u003c/p\u003e\n\n\u003cbr\u003e\n\n\u003cimg alt=\"scrot\" src=\"img/git-light.png\" align=\"right\" height=\"240px\" width=\"480px\"\u003e\n\n`gfetch` is a tiny, lightweight Git fetch script that can be used as an alternative\nto [`onefetch`](https://github.com/o2sh/onefetch).\n\n## what?\n\n`gfetch` runs a various commands (e.g. `git rev-list --count --all`) to\nretrieve some statistics (e.g. current branch) for the current project.\nIt's just a little convenience utility to prevent having to run ten\ndifferent commands and parsing with grep or sed.\n\nCompared to Onefetch, `gfetch` is\n\n- **small**: the entire script is less than 300 lines of code (not counting\ncomments).\n- **fast**: shows information for the `git` repository in just a few seconds.\n- **POSIX**: runs on just about any modern POSIX shell: `bash`, `dash`, `mksh`,\n`loksh`, anything short of `tcsh` or `mksh`.\n- **less distracting**. `gfetch` does not have and never will have\nhuge, ridiculous ASCII art that takes up half the screen.\n- **configurable**. This fetch script was designed from the ground up to be\ncompletely configurable, down to the order of the information fields. Every\nsingle field -- even the (small) ASCII art -- can be disabled.\n\nNote that `gfetch` is still in very early stages. Expect bugs, incorrect\ninformation, and lots of missing features.\n\n## where?\n\nYou will need:\n\n- a Unix-like system (Windows support is planned)\n- a fairly modern version of Git (duh)\n- a POSIX-compliant shell. (so no fish, tcsh, etc)\n- GNU sed and GNU awk (other sed/awk implementations *might* work, but are\nuntested.)\n- GNU Make (the Makefile is incompatible with `bmake`)\n- SCC (optional, only required for language detection and LOC count)\n\nThen, simply grab a release tarball from the GitHub releases, extract, and run:\n\n```\n$ make clean all\n# make install\n```\n\nNOTE: ensure that the `/usr/local/bin` path is directory is in your path first,\nsince that's where it's installed by default. If you want to install to a\ndifferent location (e.g. `/usr/bin`) you can run `make PREFIX=/usr install`\ninstead.\n\n## how?\n\nEnsure that the `gfe` script is in your path, then execute it.\n\n**Configuration** is done by editing the shell script at\n`~/.config/gfe/config.sh`, which is created by default if it doesn't exist.\nIt is then `source`d by `gfe` on startup.\n\nThe configuration file consists of some environment variable definitions,\nwhich are only set if they are empty. This allows them to be overridden at\nruntime.\n\nThe list of environment variables is as follows:\n\n```\n# ensure that you use the\n# form GFE_VALUE=\\${GFE_VALUE:-othervalue}\n# to ensure that it can be overridden on\n# the command line!!\n#\n# GFE_LOGO: path to file with ASCII art.\n# if it\\'s value is not a valid file, then\n# it is treated as ASCII art itself.\nGFE_LOGO=\\\"\\${GFE_LOGO:-}\\\"\n\n# GFE_ALIGN: number of spaces for padding between\n# name and info columnds\nGFE_ALIGN=\\\"\\${GFE_ALIGN:-13}\\\"\n\n# GFE_COL1: color for the first column (the\n# name column). possible values: 1-7\nGFE_COL1=\\\"\\${GFE_COL1:-1}\\\"\n\n# GFE_COL2: color for the second column (the\n# info column). possible values: 1-7\nGFE_COL2=\\\"\\${GFE_COL2:-7}\\\"\n\n# GFE_COL3: color for the header/title.\n# possible values: 1-7\nGFE_COL3=\\\"\\${GFE_COL3:-1}\\\"\n\n# GFE_SEP: character or text to separate each name\n# and info line.\n# e.g. using the value ':' would become 'name: info'\n# in output.\nGFE_SEP=\\\"\\${GFE_SEP:-}\\\"\n\n# GFE_DIR: directory/repository for gfetch to cd\n# into.\nGFE_DIR=\\\"\\${GFE_DIR:-}\\\"\n\n# GFE_AUTHOR_MAX: maximum number of authors for the\n# AUTHORS gfe field.\nGFE_AUTHORS_MAX=\\\"\\${GFE_AUTHORS_MAX:-2}\\\"\n\n# GFE_LANG_MAX: maximum number of languages for the\n# LANGUAGES gfe field.\nGFE_LANG_MAX=\\\"\\${GFE_LANG_MAX:-2}\\\"\n```\n\nThe config file also contains `gfe_info()` function, which is executed\nby `gfe` to show the information. It looks something like this:\n\n```\ngfe_info() {\n    # print a newline.\n    printf ''\n\n    # print the default ASCII art.\n    # note that the show_ascii() function must be\n    # the FIRST if it is used.\n    show_ascii\n\n    # print a Onefetch-esque header, with the\n    # Git username and Git version.\n    # usage: showheader \u003cleft\u003e \u003cright\u003e \u003csep\u003e\n    showheader \"$(get_user)\" \"$(get_gitver)\" \" ~ \"\n\n    # Each showinfo call prints one row of info.\n    # By default, all available info is printed.\n    # each command inside the \"$()\" is a gfetch\n    # function to get information.\n    #\n    # if you wish, you can even display your own text\n    # with the showinfo function.\n    # e.g. showinfo \"$(hostname)\" \"HOSTNAME\"\n\n    # usage: showinfo \u003cinfo\u003e \u003clabel\u003e\n    showinfo \"$(get_project_name)\" 'PROJECT'\n\n    # note: get_head_long() shows the branch name\n    # as well as latest commit. if you want to see\n    # only the latest commit, you can use the\n    # get_head() function instead.\n    showinfo \"$(get_head_long)\"    'HEAD'\n\n    showinfo \"$(get_version)\"      'VERSION'\n    showinfo \"$(get_created)\"      'CREATED'\n    showinfo \"$(get_languages)\"    'LANGUAGES'\n    showinfo \"$(get_authors)\"      'AUTHORS'\n    showinfo \"$(get_latest)\"       'LAST CHANGE'\n    showinfo \"$(get_upstream)\"     'UPSTREAM'\n    showinfo \"$(get_commit_count)\" 'COMMITS'\n    showinfo \"$(get_loc)\"          'LOC'\n    showinfo \"$(get_srcsize)\"      'SOURCE SIZE'\n\n    # print a newline.\n    printf ''\n}\n```\n\nBy default, all available information is printed.\n\n## why?\n\nSee [ONEFETCH.md](ONEFETCH.md) for a Onefetch vs gfetch comparison.\n\n## faq\n\n- **Q**: Why is a lambda the default ASCII art?\n\t- **A**: well, it's supposed to be a branch. (you know,\n\t`git branch`?) If you think you can do better, feel free to submit an\n\tissue with your ASCII art :)\n- **Q**: Are there any plans to add language-specific ASCII art (as in Onefetch)?\n\t- **A**: Eventually. The goal is to first add other missing info fields\n\tand further optimize the code.\n\n## license\n\n`gfetch` is licensed under the MIT license. See [COPYING](COPYING) for\nmore information.\n","funding_links":[],"categories":["Repository"],"sub_categories":["Other"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiedtl%2Fgfetch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkiedtl%2Fgfetch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkiedtl%2Fgfetch/lists"}