Git Log issue: date is not showing when oneline option in used












2















I see lots of great answers in Pretty git branch graphs that show the oneline option for git log being used with dates. However, when I run these commands my output is different, I don't see the dates. The options --oneline and --date=<relative or iso> seem to be incompatible.



Result for git log --date=iso:



enter image description here



Result for git log --date=iso --oneline:



enter image description here



I tried this on three different computers with similar results.



Update:



@phd suggested that this is a duplicate. I don't believe that it is. The linked question asks "How to commit date". Perhaps they mean "How to show the commit date", but as it stands the question is not clear. Also, in the possible duplicate the OP asks about several options simultaneously. I am specifically asking how to show or print dates (author date or commit date) when using the oneline option. The other OP is also concerned with the size of the commit history, which is also outside the scope of my question.



Perhaps the other question could be edited to match this question, but it didn't come up when I searched for this issue (although I didn't use the git-log tag specifically, because I didn't notice that tag until I was searching for appropriate tags for my question).



@phd also apparently downvoted me because "screenshots". I know of no other effective way to show the results of printed formatting without using screenshots, especially because they have color. By the way, the linked question also uses screenshots. Perhaps @phd can help improve that question if they truly believe the cause of not using screenshots on StackOverflow.



@phd also downvoted me because "no research". Actually, I spent quite a bit of time researching this question and reading the man page, thank you very much, and going through the linked question and other linked questions. I edited my question to keep it concise to increase the value to future readers. The brevity is an indication of the time invested in the editing, not an indication of a lack of effort in researching.










share|improve this question




















  • 1





    The --oneline format does not select any date formatting options, so the --date setting for those format options has no effect. Use a different format, that has a date-formatting option in it. (Note: --oneline is exactly the same as --pretty=oneline --abbrev-commit.)

    – torek
    Jan 2 at 17:25













  • idownvotedbecau.se/imageofcode

    – phd
    Jan 2 at 17:48











  • idownvotedbecau.se/noresearch

    – phd
    Jan 2 at 17:48






  • 1





    Possible duplicate of How to commit date in "git log --all --graph --oneline --simplify-by-decoration"

    – phd
    Jan 2 at 17:50











  • stackoverflow.com/search?q=%5Bgit-log%5D+oneline+date

    – phd
    Jan 2 at 17:50
















2















I see lots of great answers in Pretty git branch graphs that show the oneline option for git log being used with dates. However, when I run these commands my output is different, I don't see the dates. The options --oneline and --date=<relative or iso> seem to be incompatible.



Result for git log --date=iso:



enter image description here



Result for git log --date=iso --oneline:



enter image description here



I tried this on three different computers with similar results.



Update:



@phd suggested that this is a duplicate. I don't believe that it is. The linked question asks "How to commit date". Perhaps they mean "How to show the commit date", but as it stands the question is not clear. Also, in the possible duplicate the OP asks about several options simultaneously. I am specifically asking how to show or print dates (author date or commit date) when using the oneline option. The other OP is also concerned with the size of the commit history, which is also outside the scope of my question.



Perhaps the other question could be edited to match this question, but it didn't come up when I searched for this issue (although I didn't use the git-log tag specifically, because I didn't notice that tag until I was searching for appropriate tags for my question).



@phd also apparently downvoted me because "screenshots". I know of no other effective way to show the results of printed formatting without using screenshots, especially because they have color. By the way, the linked question also uses screenshots. Perhaps @phd can help improve that question if they truly believe the cause of not using screenshots on StackOverflow.



@phd also downvoted me because "no research". Actually, I spent quite a bit of time researching this question and reading the man page, thank you very much, and going through the linked question and other linked questions. I edited my question to keep it concise to increase the value to future readers. The brevity is an indication of the time invested in the editing, not an indication of a lack of effort in researching.










share|improve this question




















  • 1





    The --oneline format does not select any date formatting options, so the --date setting for those format options has no effect. Use a different format, that has a date-formatting option in it. (Note: --oneline is exactly the same as --pretty=oneline --abbrev-commit.)

    – torek
    Jan 2 at 17:25













  • idownvotedbecau.se/imageofcode

    – phd
    Jan 2 at 17:48











  • idownvotedbecau.se/noresearch

    – phd
    Jan 2 at 17:48






  • 1





    Possible duplicate of How to commit date in "git log --all --graph --oneline --simplify-by-decoration"

    – phd
    Jan 2 at 17:50











  • stackoverflow.com/search?q=%5Bgit-log%5D+oneline+date

    – phd
    Jan 2 at 17:50














2












2








2








I see lots of great answers in Pretty git branch graphs that show the oneline option for git log being used with dates. However, when I run these commands my output is different, I don't see the dates. The options --oneline and --date=<relative or iso> seem to be incompatible.



Result for git log --date=iso:



enter image description here



Result for git log --date=iso --oneline:



enter image description here



I tried this on three different computers with similar results.



Update:



@phd suggested that this is a duplicate. I don't believe that it is. The linked question asks "How to commit date". Perhaps they mean "How to show the commit date", but as it stands the question is not clear. Also, in the possible duplicate the OP asks about several options simultaneously. I am specifically asking how to show or print dates (author date or commit date) when using the oneline option. The other OP is also concerned with the size of the commit history, which is also outside the scope of my question.



Perhaps the other question could be edited to match this question, but it didn't come up when I searched for this issue (although I didn't use the git-log tag specifically, because I didn't notice that tag until I was searching for appropriate tags for my question).



@phd also apparently downvoted me because "screenshots". I know of no other effective way to show the results of printed formatting without using screenshots, especially because they have color. By the way, the linked question also uses screenshots. Perhaps @phd can help improve that question if they truly believe the cause of not using screenshots on StackOverflow.



@phd also downvoted me because "no research". Actually, I spent quite a bit of time researching this question and reading the man page, thank you very much, and going through the linked question and other linked questions. I edited my question to keep it concise to increase the value to future readers. The brevity is an indication of the time invested in the editing, not an indication of a lack of effort in researching.










share|improve this question
















I see lots of great answers in Pretty git branch graphs that show the oneline option for git log being used with dates. However, when I run these commands my output is different, I don't see the dates. The options --oneline and --date=<relative or iso> seem to be incompatible.



Result for git log --date=iso:



enter image description here



Result for git log --date=iso --oneline:



enter image description here



I tried this on three different computers with similar results.



Update:



@phd suggested that this is a duplicate. I don't believe that it is. The linked question asks "How to commit date". Perhaps they mean "How to show the commit date", but as it stands the question is not clear. Also, in the possible duplicate the OP asks about several options simultaneously. I am specifically asking how to show or print dates (author date or commit date) when using the oneline option. The other OP is also concerned with the size of the commit history, which is also outside the scope of my question.



Perhaps the other question could be edited to match this question, but it didn't come up when I searched for this issue (although I didn't use the git-log tag specifically, because I didn't notice that tag until I was searching for appropriate tags for my question).



@phd also apparently downvoted me because "screenshots". I know of no other effective way to show the results of printed formatting without using screenshots, especially because they have color. By the way, the linked question also uses screenshots. Perhaps @phd can help improve that question if they truly believe the cause of not using screenshots on StackOverflow.



@phd also downvoted me because "no research". Actually, I spent quite a bit of time researching this question and reading the man page, thank you very much, and going through the linked question and other linked questions. I edited my question to keep it concise to increase the value to future readers. The brevity is an indication of the time invested in the editing, not an indication of a lack of effort in researching.







git git-log






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 22:43







geneorama

















asked Jan 2 at 17:21









geneoramageneorama

1,71231932




1,71231932








  • 1





    The --oneline format does not select any date formatting options, so the --date setting for those format options has no effect. Use a different format, that has a date-formatting option in it. (Note: --oneline is exactly the same as --pretty=oneline --abbrev-commit.)

    – torek
    Jan 2 at 17:25













  • idownvotedbecau.se/imageofcode

    – phd
    Jan 2 at 17:48











  • idownvotedbecau.se/noresearch

    – phd
    Jan 2 at 17:48






  • 1





    Possible duplicate of How to commit date in "git log --all --graph --oneline --simplify-by-decoration"

    – phd
    Jan 2 at 17:50











  • stackoverflow.com/search?q=%5Bgit-log%5D+oneline+date

    – phd
    Jan 2 at 17:50














  • 1





    The --oneline format does not select any date formatting options, so the --date setting for those format options has no effect. Use a different format, that has a date-formatting option in it. (Note: --oneline is exactly the same as --pretty=oneline --abbrev-commit.)

    – torek
    Jan 2 at 17:25













  • idownvotedbecau.se/imageofcode

    – phd
    Jan 2 at 17:48











  • idownvotedbecau.se/noresearch

    – phd
    Jan 2 at 17:48






  • 1





    Possible duplicate of How to commit date in "git log --all --graph --oneline --simplify-by-decoration"

    – phd
    Jan 2 at 17:50











  • stackoverflow.com/search?q=%5Bgit-log%5D+oneline+date

    – phd
    Jan 2 at 17:50








1




1





The --oneline format does not select any date formatting options, so the --date setting for those format options has no effect. Use a different format, that has a date-formatting option in it. (Note: --oneline is exactly the same as --pretty=oneline --abbrev-commit.)

– torek
Jan 2 at 17:25







The --oneline format does not select any date formatting options, so the --date setting for those format options has no effect. Use a different format, that has a date-formatting option in it. (Note: --oneline is exactly the same as --pretty=oneline --abbrev-commit.)

– torek
Jan 2 at 17:25















idownvotedbecau.se/imageofcode

– phd
Jan 2 at 17:48





idownvotedbecau.se/imageofcode

– phd
Jan 2 at 17:48













idownvotedbecau.se/noresearch

– phd
Jan 2 at 17:48





idownvotedbecau.se/noresearch

– phd
Jan 2 at 17:48




1




1





Possible duplicate of How to commit date in "git log --all --graph --oneline --simplify-by-decoration"

– phd
Jan 2 at 17:50





Possible duplicate of How to commit date in "git log --all --graph --oneline --simplify-by-decoration"

– phd
Jan 2 at 17:50













stackoverflow.com/search?q=%5Bgit-log%5D+oneline+date

– phd
Jan 2 at 17:50





stackoverflow.com/search?q=%5Bgit-log%5D+oneline+date

– phd
Jan 2 at 17:50












2 Answers
2






active

oldest

votes


















2














Should add the date in the format.



For instance:



git log --pretty=format:"%h %s %an %ad" --date=relative


Where %ad means "author date" using --date option value






share|improve this answer
























  • Ah, this makes sense, thanks.

    – geneorama
    Jan 2 at 22:55



















0














You indeed cannot use these two options together. You could, however, emulate this behavior by explicitly stating the format:



$ git log --format='%h (%ai) %s'





share|improve this answer
























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54010580%2fgit-log-issue-date-is-not-showing-when-oneline-option-in-used%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    2














    Should add the date in the format.



    For instance:



    git log --pretty=format:"%h %s %an %ad" --date=relative


    Where %ad means "author date" using --date option value






    share|improve this answer
























    • Ah, this makes sense, thanks.

      – geneorama
      Jan 2 at 22:55
















    2














    Should add the date in the format.



    For instance:



    git log --pretty=format:"%h %s %an %ad" --date=relative


    Where %ad means "author date" using --date option value






    share|improve this answer
























    • Ah, this makes sense, thanks.

      – geneorama
      Jan 2 at 22:55














    2












    2








    2







    Should add the date in the format.



    For instance:



    git log --pretty=format:"%h %s %an %ad" --date=relative


    Where %ad means "author date" using --date option value






    share|improve this answer













    Should add the date in the format.



    For instance:



    git log --pretty=format:"%h %s %an %ad" --date=relative


    Where %ad means "author date" using --date option value







    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jan 2 at 17:27









    Gonzalo MatheuGonzalo Matheu

    3,76242234




    3,76242234













    • Ah, this makes sense, thanks.

      – geneorama
      Jan 2 at 22:55



















    • Ah, this makes sense, thanks.

      – geneorama
      Jan 2 at 22:55

















    Ah, this makes sense, thanks.

    – geneorama
    Jan 2 at 22:55





    Ah, this makes sense, thanks.

    – geneorama
    Jan 2 at 22:55













    0














    You indeed cannot use these two options together. You could, however, emulate this behavior by explicitly stating the format:



    $ git log --format='%h (%ai) %s'





    share|improve this answer




























      0














      You indeed cannot use these two options together. You could, however, emulate this behavior by explicitly stating the format:



      $ git log --format='%h (%ai) %s'





      share|improve this answer


























        0












        0








        0







        You indeed cannot use these two options together. You could, however, emulate this behavior by explicitly stating the format:



        $ git log --format='%h (%ai) %s'





        share|improve this answer













        You indeed cannot use these two options together. You could, however, emulate this behavior by explicitly stating the format:



        $ git log --format='%h (%ai) %s'






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 2 at 17:26









        MureinikMureinik

        186k22138205




        186k22138205






























            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54010580%2fgit-log-issue-date-is-not-showing-when-oneline-option-in-used%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Can a sorcerer learn a 5th-level spell early by creating spell slots using the Font of Magic feature?

            Does disintegrating a polymorphed enemy still kill it after the 2018 errata?

            A Topological Invariant for $pi_3(U(n))$