Skip to content
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

It is not clear which git commands are supported when acting as pager #1

Closed
djromero opened this issue May 4, 2010 · 0 comments
Closed

Comments

@djromero
Copy link

djromero commented May 4, 2010

For instance:
git blame some-file | tig

or
git config core.pager 'fmt|tig'
git blame some-file

Doesn't open the proper tig blame view.

It will be great to have this clarified in the docs.

@jonas jonas closed this as completed in cda9ed3 Sep 5, 2013
@sarices sarices mentioned this issue Sep 19, 2014
jonas added a commit that referenced this issue Jun 9, 2015
The second call to shift_left() in graph_generate_symbols() passes as
the index `pos + 1` where `pos` is bounded by `row->size` and will
therefore be an invalid for the last index. The fix is to check the
bounds of `pos + 1` and only conditionally invoke shift_left().

The stacktrace as reported in issue #402:

    #0 0x00000c47bba3a095 in shift_left (row=0xc4a76750c50, prev_row=0xc4a76750c70, pos=64) at src/graph-v2.c:493
    493 if (!graph_column_has_commit(&row->columns[pos]))
    (gdb) bt
    #0 0x00000c47bba3a095 in shift_left (row=0xc4a76750c50, prev_row=0xc4a76750c70, pos=64) at src/graph-v2.c:493
    #1 0x00000c47bba3aad7 in graph_generate_symbols (graph=0xc4a76750c00, canvas=0xc4a5c144450) at src/graph-v2.c:671
    #2 0x00000c47bba3ac86 in graph_render_parents (graph_ref=0xc4a76750c00, canvas=0xc4a5c144450) at src/graph-v2.c:701
jonas added a commit that referenced this issue Sep 1, 2015
Escape space in sed command argument causing:

    sed: -e expression #1, char 13: unterminated `s' command
jonas added a commit that referenced this issue Sep 1, 2015
Remove space from sed command argument due to:

    sed: -e expression #1, char 13: unterminated `s' command
abhinav added a commit to abhinav/tig that referenced this issue Aug 2, 2023
update_view_title can be called with a `struct view`
where `line` is NULL, and `lines` is 0.

Specifically, along this call stack:

    #0  update_view_title (view=0x3fdb88 <main_view>) at [...]/tig/src/view.c:690
    jonas#1  0x0000000000338018 in report_clear () at [...]/tig/src/display.c:565
    jonas#2  0x00000000003cfe5b in load_view (view=0x3fdb88 <main_view>, prev=0x3fdb88 <main_view>, flags=OPEN_
        at [...]/tig/src/view.c:857
    jonas#3  0x00000000003d0bc0 in open_view (prev=0x0, view=0x3fdb88 <main_view>, flags=OPEN_DEFAULT)
        at [...]/tig/src/view.c:894
    jonas#4  0x00000000003b2932 in open_main_view (prev=0x0, flags=OPEN_DEFAULT) at include/tig/main.h:57
    jonas#5  0x00000000003b0cca in view_driver (view=0x0, request=REQ_VIEW_MAIN) at [...]/tig/src/tig.c:179
    jonas#6  0x00000000003af96a in main (argc=1, argv=0x7fffffffddb8) at [...]/tig/src/tig.c:864

Specifically, load_view calls report_clear when `view->lines == 0`,
which calls `update_view_title`, which attempts `&view->line[...]`
on a null `line`.

It's not clear why this doesn't explode today.
I caught it when I ran tig compiled with Zig in debug mode
and it failed with an illegal instruction on the line:

    struct line *line = &view->line[view->pos.lineno];

Adding a check for `NULL` or `lines == 0` resolves the issue.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant