Giter Club home page Giter Club logo

git-graph's People

Contributors

hovenko avatar jerith666 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

git-graph's Issues

boring commits have commit endpoints in reverse order

Thanks for fixing the other issue where the script wouldn't work if builder 3.0.0 was used. The script is in a usable state now.

I noticed another issue where the boring commits have the commit SHA1s in reverse order. I'd expect the older SHA1 on the left and the newer SHA1 on the right. I think the problem is on line 238 of the script. Do you see this as an issue?

PS: not everyone writes good commit messages. So there can be big commit messages (spanning multiple lines), which would make big ellipses in the output. If you can only the first 50 characters as the commit message, the output graph would look better.

"doesn't know its parents" error message โ€” need to use gitlab-grit

This tools doesn't work in default installation (at least on Cygwin). It just produces
#omitting #xxx that doesn't know its parents
for every item.

The command gem install gitlab-grit solves this problem. It installs GitLab fork of Grit version 2.8.1 (for the moment).

Whereas by default Grit 2.5.0 is installed. But it seems that this version is outdated now and Grit is no longer maintained.

In default installation, ref.parents throws NoMethodError on every item in filtering decorated list:

decorated.reject!{|ref|
begin
  ref.parents
  false
rescue NoMethodError
  puts "#omitting #{ref} that doesn't know its parents"
  true
end}

Actually, repo.branches[0].commit.parents throws error:

NoMethodError: undefined method `>>' for "x":String

Help me to fix this error: undefined method `encode' for Builder, please

$ ruby --version
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]

and, I installed grit-2.5.0 , builder-3.0.0

I can't run git-graph.rb

$ ruby -I/var/lib/gems/1.8/gems/grit-2.5.0/lib git-graph.rb . | dot -Tsvg -ohistory.svg /dev/stdin
git-graph.rb:8:in to_xs': undefined methodencode' for Builder::XChar:Module (NoMethodError)
from git-graph.rb:170:in log_for' from git-graph.rb:204:inmake_node'
from git-graph.rb:56:in plot_tree' from git-graph.rb:299 from git-graph.rb:298:ineach'
from git-graph.rb:298
Error: /dev/stdin:7: syntax error near line 7

undefined method `to_xs' on line 163

The sample command doesn't work. I have the 'grit' gem installed.

./git-graph.rb ~/workspace/bender/| dot -Tsvg -ohistory.svg /dev/stdin
./git-graph.rb:163:in log_for': undefined methodto_xs' for "revving bender gem50dcc3\n":String (NoMethodError)
from ./git-graph.rb:197:in make_node' from ./git-graph.rb:50:inplot_tree'
from ./git-graph.rb:289:in block in <main>' from ./git-graph.rb:288:ineach'
from ./git-graph.rb:288:in `

'
Error: /dev/stdin:34: syntax error near line 34

/usr/lib/ruby/vendor_ruby/grit/commit.rb:152:in `list_from_string': undefined method `split' for nil:NilClass (NoMethodError)

When executing on this git repository: https://android.googlesource.com/kernel/goldfish.git

$ ./git-graph.rb /local/scratch/drt24/android/clones/kernel/goldfish

I get lots of lines like:

unknown header '' in commit de9c9f86be0dc3495de98dc65c80abe6e7c7d643
unknown header '' in commit de9c9f86be0dc3495de98dc65c80abe6e7c7d643
unknown header '' in commit de9c9f86be0dc3495de98dc65c80abe6e7c7d643
unknown header '' in commit de9c9f86be0dc3495de98dc65c80abe6e7c7d643
unknown header '' in commit de9c9f86be0dc3495de98dc65c80abe6e7c7d643
unknown header 'mergetag' in commit ce6fbaf160628df62ec953c701d5fc547484257a

And then:

/usr/lib/ruby/vendor_ruby/grit/commit.rb:152:in `list_from_string': undefined method `split' for nil:NilClass (NoMethodError)
    from /usr/lib/ruby/vendor_ruby/grit/commit.rb:125:in `find_all'
    from /usr/lib/ruby/vendor_ruby/grit/commit.rb:93:in `lazy_source'
    from /usr/lib/ruby/vendor_ruby/grit/lazy.rb:31:in `block (2 levels) in lazy_reader'
    from ./git-graph.rb:22:in `find_children'
    from ./git-graph.rb:301:in `block in <main>'
    from ./git-graph.rb:299:in `each'
    from ./git-graph.rb:299:in `<main>'

I am running Ubuntu 14.04.1 LTS 3.13.0-35-generic x86_64 with ruby 1.9.3p484 (2013-11-22 revision 43786) [x86_64-linux], ruby-fast-xs 0.8.0-3build1 and ruby-grit 2.5.0-1.

PackFormatError

efergcz@esekilxxen1814:~/git-graph> ls -lah
total 80K
drwxrwxr-x   3 efergcz rnd 4.0K Feb 13 12:07 .
drwxr-xr-x 119 efergcz rnd  24K Feb 13 11:13 ..
drwxrwxr-x   8 efergcz rnd 4.0K Feb 13 11:54 .git
-rw-rw-r--   1 efergcz rnd   35 Feb 13 11:00 .gitignore
-rw-rw-r--   1 efergcz rnd   84 Feb 13 11:00 Gemfile
-rw-rw-r--   1 efergcz rnd  280 Feb 13 11:16 Gemfile.lock
-rw-rw-r--   1 efergcz rnd  437 Feb 13 11:00 README
-rwxrwxr-x   1 efergcz rnd 8.4K Feb 13 11:00 git-graph.rb
-rw-rw-r--   1 efergcz rnd  104 Feb 13 11:00 test.dot
efergcz@esekilxxen1814:~/git-graph> ./git-graph.rb ./
/home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/internal/pack.rb:135:in `block (2 levels) in init_pack': pack /home/efergcz/git-graph/.git/objects/pack/pack-6fb4fe8c8726ba422fa829803e80c27f33125f41.pack has discontinuous index 1 (Grit::GitRuby::Internal::PackFormatError)
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/internal/pack.rb:132:in `times'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/internal/pack.rb:132:in `block in init_pack'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/internal/pack.rb:73:in `with_idx'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/internal/pack.rb:130:in `init_pack'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/internal/pack.rb:46:in `initialize'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:763:in `new'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:763:in `block (2 levels) in load_packs'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:761:in `each'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:761:in `block in load_packs'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:760:in `open'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:760:in `load_packs'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:743:in `initpacks'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:89:in `get_raw_object_by_sha1'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:334:in `walk_log'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:287:in `log'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby/repository.rb:306:in `rev_list'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby.rb:70:in `block in rev_list'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby.rb:211:in `block in try_run'
    from /app/ruby/2.0.0/LMWP3/lib/ruby/2.0.0/timeout.rb:66:in `timeout'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby.rb:210:in `try_run'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/git-ruby.rb:70:in `rev_list'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/commit.rb:120:in `find_all'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/commit.rb:93:in `lazy_source'
    from /home/efergcz/gems/gems/grit-2.5.0/lib/grit/lazy.rb:31:in `block (2 levels) in lazy_reader'
    from ./git-graph.rb:288:in `block in <main>'
    from ./git-graph.rb:286:in `reject!'
    from ./git-graph.rb:286:in `<main>'
efergcz@esekilxxen1814:~/git-graph> ruby --version
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]

Bug with escaping quotes for svg & another image format

Hi,
First of all, I am using your script and i love it.
But there's a bug i found i think you might want to fix, it's simple:)

you use fast_xs to escape the double qoutes, just for generate a VALID XML file, for the SVG, right?

but, when someone, like me, wants a PNG file, this script will make &amp, &quot shows in the text of the picture. which is not right.

e.g: i have a commit:

commit b5941e3ba596bae219299ca480c8c48683b5b644
Author: sunus <[email protected]>
Date:   Tue Dec 10 21:19:38 2013 +0800

    Revert "remove FILE"

    This reverts commit 163a6d700226b780b7852a79fe1370a6d38c819a.

it shows Revert $quot; remove FILE $quot; (replace $ with &)

and i think it shouldn't

as far as i tested, you all just use this:

wrap_text(commit_msg + " [" + id_for(commit) + "]").gsub(%r|\n|, "
")

both PNG and SVG works fine.

that's what i got with your script.
screen shot 2013-12-11 at 16 40 20

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.