git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Re: [PATCH v2 4/4] implement automatic fast forward merge for submodules

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Jul 7, 2010, 13:35 UTC
Message-ID
<20100707133557.GA35678@book.hvoigt.net>
In-Reply-To
<201007070152.17802.johan@herland.net>
Hi,
On Wed, Jul 07, 2010 at 01:52:16AM +0200, Johan Herland wrote:
Show 9 quoted lines
> On Tuesday 06 July 2010, Heiko Voigt wrote:
> [...]
> 
> > +	/* get all revisions that merge commit a */
> > +	snprintf(merged_revision, sizeof(merged_revision), "^%s",
> > +			find_unique_abbrev(a->object.sha1, 40));
> 
> Why do you call find_unique_abbrev(..., 40) here?
> Isn't sha1_to_hex(a->object.sha1) a better solution?

Because I did not know it better at the time I wrote this :) Will be corrected.

Show 12 quoted lines
> > +	init_revisions(&revs, NULL);
> > +	rev_opts.submodule = path;
> > +	setup_revisions(sizeof(rev_args)/sizeof(char *)-1, rev_args, &revs, &rev_opts);
> > +
> > +	/* save all revisions from the above list that contain b */
> > +	if (prepare_revision_walk(&revs))
> > +		die("revision walk setup failed");
> > +	while ((commit = get_revision(&revs)) != NULL) {
> > +		struct object *o = &(commit->object);
> > +		if (in_merge_bases(b, (struct commit **) &o, 1)) {
> 
> Why not s/(struct commit **) &o/&commit/ ?
Similar, because I needed objects for the array. Will be corrected.
Show 15 quoted lines
> > +	 (cd sub &&
> > +	  git rev-parse sub-d > ../expect) &&
> > +	 test_cmp actual expect)
> > +'
> > +
> > +test_expect_success 'merging should conflict for non fast-forward' '
> > +	(cd merge-search &&
> > +	 git checkout -b test-nonforward b &&
> > +	 (cd sub &&
> > +	  git rev-parse sub-d > ../expect) &&
> > +	 test_must_fail 	git merge c 2> actual  &&
> > +	 grep $(<expect) actual > /dev/null &&
> 
> I cannot find the "$(<expect)" construct anywhere else in out test scripts.
> Is it portable? Should we maybe use "$(cat expect)" instead?
I do not know. Just to be sure I will change it to cat.
> Otherwise, it looks good to me. Thanks for the effort!
Thank you as well. The rest of the comments are already incorporated.
cheers Heiko
Previous: Johan HerlandNext: Junio C Hamano
Message 9 of 11 in “implement automatic submodule merge strategy when possible”
  1. 0/4 implement automatic submodule merge strategy when possibleHeiko Voigt, Jul 6, 2010
  2. 1/4 add missing && to submodule-merge testcaseHeiko Voigt, Jul 6, 2010
  3. 2/4 teach ref iteration module about submodulesHeiko Voigt, Jul 6, 2010
  4. 3/4 extent setup_revisions() so it works with submodulesHeiko Voigt, Jul 6, 2010
  5. Junio C HamanoJul 7, 2010
  6. Heiko VoigtJul 7, 2010
  7. 4/4 implement automatic fast forward merge for submodulesHeiko Voigt, Jul 6, 2010
  8. Johan HerlandJul 6, 2010
  9. Heiko VoigtJul 7, 2010
  10. Junio C HamanoJul 8, 2010
  11. Johan HerlandJul 6, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.