Giter VIP home page Giter VIP logo

Comments (12)

cjappl avatar cjappl commented on July 22, 2024 1

There is no way to do this via a config value, but you could add it to the line here possibly

eval "git log --follow $graph --color=always --format='$log_format' $* $_forgit_emojify" |

We could consider adding it as an option in the future, like we do for --graph if enough people think it would be useful

from forgit.

sandr01d avatar sandr01d commented on July 22, 2024

Does glo --follow -- FILESPEC not work? Forgit passes the options on to git log with $*. Or am I missing something here?

from forgit.

cjappl avatar cjappl commented on July 22, 2024

Interesting, maybe true! We use the argv variable $* a couple times in the function

     files=$(sed -nE 's/.* -- (.*)/\1/p' <<< "$*") # extract files parameters for `git show` command 

     eval "git log $graph --color=always --format='$log_format' $* $_forgit_emojify" | 

I'm not sure if the first one would choke on that flag? It's worth a try though @Clumsy-Coder . Do report back if you find out :)

from forgit.

Clumsy-Coder avatar Clumsy-Coder commented on July 22, 2024

I tried the command to display the entire history of a file.

glo --follow <file>

I got this.

image

Not sure what the ... thing is. When using the arrow keys to navigate the commits, ... display nothing on the right side

from forgit.

sandr01d avatar sandr01d commented on July 22, 2024

That's git telling you that it left out some commits because the file you specified wasn't modified in those. We could make sure that only lines actually containing a commit get displayed by adding a grep command like this

    eval "git log $graph --color=always --format='$log_format' $* $_forgit_emojify" |
        grep '\*' |
        FZF_DEFAULT_OPTS="$opts" fzf

This would also get rid of lines containing only things like |/. Before the change glo looks like this

image

After the change like this:

image

I'd personally prefer the second one and can provide a PR if this is the behavior we want. Opinions?

from forgit.

sandr01d avatar sandr01d commented on July 22, 2024

Interesting, maybe true! We use the argv variable $* a couple times in the function

     files=$(sed -nE 's/.* -- (.*)/\1/p' <<< "$*") # extract files parameters for `git show` command 

     eval "git log $graph --color=always --format='$log_format' $* $_forgit_emojify" | 

I'm not sure if the first one would choke on that flag? It's worth a try though @Clumsy-Coder . Do report back if you find out :)

Should be fine. The sed command only matches when there is a space after the --.

from forgit.

carlfriedrich avatar carlfriedrich commented on July 22, 2024

@Clumsy-Coder Do I understand it right that calling glo --follow <file> actually answers your question?

from forgit.

carlfriedrich avatar carlfriedrich commented on July 22, 2024

That's git telling you that it left out some commits because the file you specified wasn't modified in those. We could make sure that only lines actually containing a commit get displayed by adding a grep command like this

    eval "git log $graph --color=always --format='$log_format' $* $_forgit_emojify" |
        grep '\*' |
        FZF_DEFAULT_OPTS="$opts" fzf

This would also get rid of lines containing only things like |/. Before the change glo looks like this

image

After the change like this:

image

I'd personally prefer the second one and can provide a PR if this is the behavior we want. Opinions?

@sandr01d I personally prefer the first one and would like to keep this information in the log. So if you want to provide a PR for this, I would prefer to have it as an opt-in option.

from forgit.

Clumsy-Coder avatar Clumsy-Coder commented on July 22, 2024

@carlfriedrich It mostly solves it, but a small issue remains where you have ... on commits that are not related to the file being viewed.

#281 (comment)

image

from forgit.

sandr01d avatar sandr01d commented on July 22, 2024

@carlfriedrich It mostly solves it, but a small issue remains where you have ... on commits that are not related to the file being viewed.

#281 (comment)

image

Does FORGIT_LOG_GRAPH_ENABLE=false glo --follow FILESPEC provide your desired output?

from forgit.

sandr01d avatar sandr01d commented on July 22, 2024

That's git telling you that it left out some commits because the file you specified wasn't modified in those. We could make sure that only lines actually containing a commit get displayed by adding a grep command like this

    eval "git log $graph --color=always --format='$log_format' $* $_forgit_emojify" |
        grep '\*' |
        FZF_DEFAULT_OPTS="$opts" fzf

This would also get rid of lines containing only things like |/. Before the change glo looks like this
image
After the change like this:
image
I'd personally prefer the second one and can provide a PR if this is the behavior we want. Opinions?

@sandr01d I personally prefer the first one and would like to keep this information in the log. So if you want to provide a PR for this, I would prefer to have it as an opt-in option.

Found this to be solved by FORGIT_LOG_GRAPH_ENABLE already, so no additional changes are necessary.

from forgit.

Clumsy-Coder avatar Clumsy-Coder commented on July 22, 2024

Does FORGIT_LOG_GRAPH_ENABLE=false glo --follow FILESPEC provide your desired output?

@sandr01d
This solves the issue. maybe sometime later I could use it with the graph as well.

from forgit.

Related Issues (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.