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

Re: [PATCH v4 09/14] remote-testgit: report success after an import

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 2, 2012, 15:46 UTC
Message-ID
<CAMP44s2ZPbda7yJ9UtOhWMqaKp4TaAgoyeUWUSrt0vco7RK+Tw@mail.gmail.com>
In-Reply-To
<5093D193.3030108@gmail.com>

On Fri, Nov 2, 2012 at 2:58 PM, Stefano Lattarini <stefano.lattarini@gmail.com> wrote:

Show 22 quoted lines
> On 11/02/2012 03:02 AM, Felipe Contreras wrote:
>> Doesn't make a difference for the tests, but it does for the ones
>> seeking reference.
>>
>> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
>> ---
>>  git-remote-testgit | 11 +++++++++++
>>  1 file changed, 11 insertions(+)
>>
>> diff --git a/git-remote-testgit b/git-remote-testgit
>> index 6c348b0..4e8b356 100755
>> --- a/git-remote-testgit
>> +++ b/git-remote-testgit
>> @@ -59,7 +59,18 @@ while read line; do
>>              sed -e "s#refs/heads/#${prefix}/heads/#g"
>>          ;;
>>      export)
>> +        declare -A before after
>> +
> If you convert this script to be a valid POSIX shell script (as I've
> suggested in my reply to [PATCH v4 04/14]), you'll need to get rid of
> this bashism (and those below) as well.

Yeah, but I don't want to. I originally used transitory files, and used esoteric options of diff to do the same (which were probably not portable).

In the end I liked this approach much better.

If you have a solution for this that works in POSIX shell, I'll be glad to consider it, but for the moment, I think a simple, easy to understand and maintain code is more important, and if it needs bash, so be it.

Show 13 quoted lines
>> +        eval $(git for-each-ref --format='before[%(refname)]=%(objectname)')
>> +
>>          git fast-import --{import,export}-marks="$testgitmarks" --quiet
>> +
>> +        eval $(git for-each-ref --format='after[%(refname)]=%(objectname)')
>> +
>> +        for ref in "${!after[@]}"; do
>> +            test "${before[$ref]}" ==  "${after[$ref]}" && continue
>> +            echo "ok $ref"
>> +        done
>>          echo
>>          ;;
>>      '')
Cheers.
-- 
Felipe Contreras
Previous: Stefano LattariniNext: Stefano Lattarini
Message 17 of 26 in “fast-export and remote-testgit improvements”
  1. 00/14 fast-export and remote-testgit improvementsFelipe Contreras, Nov 2, 2012
  2. 01/14 fast-export: avoid importing blob marksFelipe Contreras, Nov 2, 2012
  3. 02/14 remote-testgit: fix direction of marksFelipe Contreras, Nov 2, 2012
  4. 03/14 Rename git-remote-testgit to git-remote-testpyFelipe Contreras, Nov 2, 2012
  5. 04/14 Add new simplified git-remote-testgitFelipe Contreras, Nov 2, 2012
  6. Stefano LattariniNov 2, 2012
  7. Jeff KingNov 2, 2012
  8. Felipe ContrerasNov 2, 2012
  9. Stefano LattariniNov 2, 2012
  10. Felipe ContrerasNov 2, 2012
  11. 05/14 remote-testgit: get rid of non-local functionalityFelipe Contreras, Nov 2, 2012
  12. 06/14 remote-testgit: remove irrelevant testFelipe Contreras, Nov 2, 2012
  13. 07/14 remote-testgit: cleanup testsFelipe Contreras, Nov 2, 2012
  14. 08/14 remote-testgit: exercise more featuresFelipe Contreras, Nov 2, 2012
  15. 09/14 remote-testgit: report success after an importFelipe Contreras, Nov 2, 2012
  16. Stefano LattariniNov 2, 2012
  17. Felipe ContrerasNov 2, 2012
  18. Stefano LattariniNov 2, 2012
  19. Felipe ContrerasNov 2, 2012
  20. Stefano LattariniNov 2, 2012
  21. Jeff KingNov 2, 2012
  22. 10/14 remote-testgit: make clear the 'done' featureFelipe Contreras, Nov 2, 2012
  23. 11/14 fast-export: trivial cleanupFelipe Contreras, Nov 2, 2012
  24. 12/14 fast-export: fix comparison in testsFelipe Contreras, Nov 2, 2012
  25. 13/14 fast-export: make sure updated refs get updatedFelipe Contreras, Nov 2, 2012
  26. 14/14 fast-export: don't handle uninteresting refsFelipe Contreras, Nov 2, 2012

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.