Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6682325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T04:41:34+00:00 2026-05-26T04:41:34+00:00

So, the following bash oneliner will generate similar output as git log git rev-list

  • 0

So, the following bash oneliner will generate similar output as git log

git rev-list --reverse HEAD | while read rev; do git log -1 $rev; done

What I want to know is, what is the purpose of read rev in this context? Is there another way this could be written without read rev perhapse with xargs?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T04:41:35+00:00Added an answer on May 26, 2026 at 4:41 am

    Yes you can use xargs in this case:

    git rev-list --reverse HEAD | xargs -L 1 -J % git log -1 %
    

    To explain how read rev works here, the loop reads one line from its input (in this case, from the output of the git rev-list --reverse HEAD command) and stores it in the variable rev. Then, any commands within the loop can use the variable rev. As an example:

    seq 1 5 | while read x; do echo "value is $x"; done
    

    will show

    value is 1
    value is 2
    value is 3
    value is 4
    value is 5
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following bash script: tail -F -n0 /private/var/log/system.log | while read line
Can I embed the following bash shell code: for name in $(git diff --name-only
Possible Duplicate: The following bash command will spawn processes to kernel death. Can you
Say the following Bash script: #!/bin/bash export TEXTDOMAINDIR=./locale export TEXTDOMAIN=test-gettext-read . gettext.sh echo -n
I have the following bash script which I will use to analyze all report
I use the following Bash Shell script to list the .txt files recursively under
I am facing with the following bash script: #! /bin/bash processname=$1 x=1 while [
When I enter the following (BASH): rdesktop -r disk:bacon=~/bacon host It does not expand
I need to change the following Bash code to Zsh TODO_OPTIONS=--timeout --summary cd ()
When the following two lines of code are executed in a bash script, ls

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.