Skip to content

Can edit in Pager#1243

Merged
koutcher merged 1 commit intojonas:masterfrom
crisisdice:can-edit-in-pager
Nov 19, 2022
Merged

Can edit in Pager#1243
koutcher merged 1 commit intojonas:masterfrom
crisisdice:can-edit-in-pager

Conversation

@crisisdice
Copy link
Copy Markdown
Contributor

@crisisdice crisisdice commented Oct 27, 2022

When working with pull requests, before merging to master it is nice to get the total diff of all of the commits of the PR, as in the Files changed tab on github. This is possible with tig, i.e. git diff master | tig or :!git diff master, but currently, this view does not support editing.

This PR makes editing in the pager view possible.

int split = 0;

if (request == REQ_EDIT)
return diff_common_edit(view, request, line);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like a good change, thanks. This has bothered me occasionally in the past, although I hardly use the pager view (perhaps because of that?).

One thing that's weird in git log -p | tig is that if my cursor is inside a commit message,
:edit will work - searches upwards for the last file in above commit.
I think we should stop the search at a commit boundary, e.g. the commit: line. I guess this is not a blocker.

Can we also make it work for the log view (e.g. tig log -p)?

One more thing: could you put the PR description in the commit message instead? The commit message will make it into the changelog (via git shortlog)

@koutcher
Copy link
Copy Markdown
Collaborator

Thanks. It will only work when paging diff content but the worst that can happen is a Nothing to edit error message.

@koutcher koutcher merged commit 43a3efa into jonas:master Nov 19, 2022
vxsl pushed a commit to vxsl/tig that referenced this pull request Mar 18, 2026
When working with pull requests, before merging to `master` it is nice to get the total diff of all of the commits of the PR, as in the `Files changed` tab on github. This is possible with `tig`, i.e. `git diff master | tig` or `:!git diff master`, but currently, this view does not support editing.

Make editing in the pager view possible.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants