I working on Git now and having a big problem.
The command git bisect run needs to be like that:
$ git bisect run <my_script> $arguments
But I need to work with git bisect run only in one script.
I know that my solution with 2 scripts works but I can't find a way to combine them.
What can I do that will resolve the problem?
I tried to use:
git bisect run sh -c
As example: In working on git and writing: bash ../bisecter.sh 102. When bisecter.sh is the name of the script and 102 is something we need to search in the commits. And this script I'm trying to write. With bisect and bash commands.
You could check to see if the program is being run in "interactive mode" and run the appropriate command. If it's interactive, run
git bisect. If it isn't, you're being run bygit bisect.In bash you can check if file descriptor 1 (stdout) is outputting to a terminal.
But I seriously doubt that's what your professor intends you to do. The requirement to pass the same program to
git bisectas runsgit bisectdoesn't make sense. Either the professor has an odd requirement, a distinct possibility, or perhaps you've misunderstood how to solve the problem.git bisectis not for searching like that. It is for finding which commit caused a bug.If you want to find which commit made a particular change, either in the log messages or in the changes, use
git log -Sorgit log -G. That makes sense to do it in a single file.