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 8056521
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:43:49+00:00 2026-06-05T08:43:49+00:00

For a project, I need to take a list of git commit Id’s (A

  • 0

For a project, I need to take a list of git commit Id’s (A couple thousand), and compare them two at a time, saving specific information from the return into a file. The only issue I’m having is getting a diff command to work in Java. I’ve spend hours trying to figure this out and I’m still in need of assistance.

  • 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-06-05T08:43:51+00:00Added an answer on June 5, 2026 at 8:43 am

    You can run a command and get its result using this :

        ProcessBuilder processBuilder = new ProcessBuilder(command);
        processBuilder.redirectErrorStream(true);
        Process process = processBuilder.start();
        String output = readOutput(process);
        try {
            if (process.waitFor() != 0) {
                throw new IOException(
                    "command exited in error: " + process.exitValue()
                        + "\n" + output);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        return output;
    

    So you just have to define the most adapted “git diff…” command for your problem and parse the output.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

my project need to read multiple web pages at a time(eg: for a particular
My project need to compare output(only urls) of google and yahoo for a particular
My android app project need to add a new function of saving the click
In my project I need to use third party code, stored in several Git
The Junits I have in my project need to load property files from the
In my project I need to write small WYSIWYG editor (just let users make
For a school project I need to create a program and it'd be nice
For a new project I need to load big XML files (200MB+) to a
In our project we need to import the csv file to postgres. There are
In a current project i need to display PDFs in a webpage. Right now

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.