[PATCH aiaiai 7/9] aiaiai: don't display log output from git-find-base

Keller, Jacob E jacob.e.keller at intel.com
Tue Apr 29 13:11:49 PDT 2014

On Tue, 2014-04-29 at 09:25 +0300, Artem Bityutskiy wrote:
> On Mon, 2014-04-28 at 18:51 +0000, Keller, Jacob E wrote:
> > On Fri, 2014-04-25 at 17:29 -0700, Artem Bityutskiy wrote:
> > > On Wed, 2014-04-09 at 15:26 -0700, Jacob Keller wrote:
> > > > -	commit="$(git --git-dir="$(git_dir "$pcfg_path")" find-base "$pcfg_branch" "${branch_base:-$pcfg_branch}^!" < "$mbox" \
> > > > +	commit="$(git --git-dir="$(git_dir "$pcfg_path")" find-base "$pcfg_branch" "${branch_base:-$pcfg_branch}^!" 2>>"$tmp_find_base" < "$mbox" \
> > > >  		|| verbose "No matching base commit in project $prj" )"
> > > 
> > > I'd made these lines shorter, but this is matter of taste. Pushed,
> > > thanks!
> > > 
> > 
> > I would as well, but I wasn't sure the best way in shell to do this..
> > Any suggestions?
> Defining a temporary variables, may be, like:
> git_dir_opt="--git-dir=$(git_dir "$pcfg_path")"
> branches=""$pcfg_branch" ${branch_base:-$pcfg_branch}^!"
> By the way, I think you wanted 'git merge-base' here.

I am not familiar with git-merge-base.. What does it do?

I can explain what I am doing here:

I need to pass the refs for all commits between the tip of htis branch,
and the tip of origin/master. I wanted a way so that if branch-base was
the same as the branch, then it only shows the top commit. This also
makes it so that if branch_base is undefined, we default to the
pcfg_branch variable.

using ^! means: show every commit reachable from the pcfg_branch except
don't show any reachable from *any* parents of branch_base. This limits
the search for the find-base to be specifically those commits.

I think you seem to misunderstand why I used "find-base" here. Find-base
is a script I wrote myself, that is in aiaiai's path. When git can't
find the command builtin, it searches your path for the command named
git-command. running git find-base will call "git-find-base" if that
executable is in your PATH.

In this way, I am able to properly pass the git directory to find-base
and still run my custom command that does the find-base selection.
find-base is a script that is in one of the other patches I wrote. The
find-base command basically uses the git-diff format to determine which
commit the diff will apply cleanly too (if any).



More information about the aiaiai mailing list