Skip to content

Update git-status-tree #14

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 64 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
version: 2.1

jobs:
build_ruby_2_6:
docker:
- image: 'cimg/ruby:2.6'
steps:
- checkout
- run: 'bundle install'
- run: './test/test_git_status_tree'
build_ruby_2_7:
docker:
- image: 'cimg/ruby:2.7'
steps:
- checkout
- run: 'bundle install'
- run: './test/test_git_status_tree'
build_ruby_3_0:
docker:
- image: 'cimg/ruby:3.0'
steps:
- checkout
- run: 'bundle install'
- run: './test/test_git_status_tree'
build_ruby_3_1:
docker:
- image: 'cimg/ruby:3.1'
steps:
- checkout
- run: 'bundle install'
- run: './test/test_git_status_tree'
build_ruby_3_2:
docker:
- image: 'cimg/ruby:3.2'
steps:
- checkout
- run: 'bundle install'
- run: './test/test_git_status_tree'
build_rubocop:
docker:
- image: 'cimg/ruby:3.2'
steps:
- checkout
- run: 'bundle install'
- run: 'rubocop .'
workflows:
build_ruby_2_6:
jobs:
- build_ruby_2_6
build_ruby_2_7:
jobs:
- build_ruby_2_7
build_ruby_3_0:
jobs:
- build_ruby_3_0
build_ruby_3_1:
jobs:
- build_ruby_3_1
build_ruby_3_2:
jobs:
- build_ruby_3_2
build_rubocop:
jobs:
- build_rubocop
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
ruby-2.7.7
26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

6 changes: 4 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# frozen_string_literal: true

source 'https://rubygems.org'

group :test do
gem 'test-unit' if ENV['RUBY_VERSION'][0..9] >= 'ruby-2.2.0'
gem 'cane', :require => false if ENV['RUBY_VERSION'][0..9] >= 'ruby-1.9.3'
gem 'rubocop', require: false
gem 'test-unit'
end
45 changes: 31 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Build Status](https://app.travis-ci.com/knugie/git-status-tree.svg?branch=master)](https://app.travis-ci.com/github/knugie/git-status-tree)
[![CircleCI Status](https://circleci.com/gh/knugie/git-status-tree/tree/master.svg?style=svg)](https://circleci.com/gh/knugie/git-status-tree/tree/master)
[![Gem Version](https://img.shields.io/gem/v/git-status-tree.svg)](https://rubygems.org/gems/git-status-tree)

# git-status-tree
Expand All @@ -10,30 +10,27 @@ and files. Run `git tree` in the command line to list all files in your git repo
untracked (?) or have been added (A), modified (M) or deleted (D). The colored output
shows whether a file has been added/staged (green)(+) or not (red). The current status
of each file is appended to it.
___
## Installation
**git-status-tree** is available on [rubygems.org](https://rubygems.org/gems/git-status-tree). Install git-status-tree running:
```
gem install git-status-tree
```

## Example
![image](https://user-images.githubusercontent.com/1446195/134486179-290820c6-4a8c-4cf3-8707-43adacb77b4d.png)

## Requirements
## Compatibility
**git-status-tree** supports:
* Git (http://git-scm.com): version 1.8+
* Ruby (http://www.ruby-lang.org): version 1.8+
* Ruby (http://www.ruby-lang.org): version 2.7+

## Install
```
gem install git-status-tree
```

## Config
## Configuration
Set the indentation as you like, default is 4.
```
git config --global status-tree.indent <indent>
```

## Uninstall
```
gem uninstall git-status-tree
```

## Try it
```
gem install git-status-tree
Expand All @@ -58,3 +55,23 @@ git tree
git reset HEAD --hard
git clean -xdf
```

## Uninstall
```
gem uninstall git-status-tree
```
___
## Development

1. Clone this repository
* `git clone https://github.com/knugie/git-status-tree.git`
* `cd git-status-tree`
2. Install dependencies
* `bundle install`
3. Run tests
* `./test/test_git_status_tree`
4. Run git-status-tree from repository
* `./bin/git-status-tree`
5. Build and install local gem
* `gem build git-status-tree.gemspec`
* `gem install git-status-tree-2.0.0.gem`
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
2.0.0
4 changes: 2 additions & 2 deletions bin/git-status-tree
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
# encoding: utf-8
# frozen_string_literal: true

require File.join File.dirname(__FILE__), '../src/git-status-tree'
require File.join File.dirname(__FILE__), '../src/git_status_tree'

puts GitStatusTree.new.to_s
8 changes: 5 additions & 3 deletions ext/git_tree/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# frozen_string_literal: true

require 'mkmf'

find_executable('bash')
find_executable('git')
find_executable('make')

# Trick Rubygems into thinking the generated Makefile was executed
compile = File.join(Dir.pwd, 'git_tree.' + RbConfig::CONFIG['DLEXT'])
File.open(compile, "w") {}
compile = File.join(Dir.pwd, "git_tree.#{RbConfig::CONFIG['DLEXT']}")
File.open(compile, 'w') {}

# Install "git tree"
puts `../../bin/git_add_alias_tree`

# Trick Rubygems into thinking the Makefile was executed
$makefile_created = true
$makefile_created = true # rubocop:disable Style/GlobalVars
30 changes: 16 additions & 14 deletions git-status-tree.gemspec
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# frozen_string_literal: true

Gem::Specification.new do |s|
s.name = 'git-status-tree'
s.version = '1.0.1'
s.summary = 'counts bits'
s.licenses = ['MIT', 'GPL-2.0']
s.summary = "git status in file tree format"
s.description = 'git-status-tree is a command line tool that shows git repository changes in a file tree.'
s.authors = ["Wolfgang Teuber"]
s.email = 'knugie@gmx.net'
s.files = Dir['{lib/*.rb,src/*.rb,bin/*}'] + Dir['ext/git_tree/Makefile']
s.require_paths = ['lib']
s.executables = ['git-status-tree']
s.extensions = Dir['ext/git_tree/extconf.rb']
s.homepage = 'https://github.com/knugie/git-status-tree'
s.metadata = { "source_code_uri" => "https://github.com/knugie/git-status-tree" }
s.name = 'git-status-tree'
s.required_ruby_version = '>= 2.7'
s.version = '2.0.0'
s.licenses = ['MIT', 'GPL-2.0']
s.summary = 'git status in file tree format'
s.description = 'git-status-tree is a command line tool that shows git repository changes in a file tree.'
s.authors = ['Wolfgang Teuber']
s.email = 'knugie@gmx.net'
s.files = Dir['{lib/*.rb,src/*.rb,bin/*}'] + Dir['ext/git_tree/Makefile']
s.require_paths = ['lib']
s.executables = ['git-status-tree']
s.extensions = Dir['ext/git_tree/extconf.rb']
s.homepage = 'https://github.com/knugie/git-status-tree'
s.metadata = { 'source_code_uri' => 'https://github.com/knugie/git-status-tree' }
end
2 changes: 1 addition & 1 deletion lib/bash_color.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# encoding: utf-8
# frozen_string_literal: true

module BashColor
NONE = "\033[0m"
Expand Down
Loading