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

Re: [PATCH 8/8] remote-hg: trivial cleanups

From
Philip Oakley <philipoakley@iee.org>
Date
Apr 29, 2014, 22:06 UTC
Message-ID
<9374D3886766421BAA17E07C62F256DB@PhilipOakley>
In-Reply-To
<1398762275-346-9-git-send-email-felipe.contreras@gmail.com>
From: "Felipe Contreras" <felipe.contreras@gmail.com>
Subject: [PATCH 8/8] remote-hg: trivial cleanups

It's useful, as a reader of the shortlog and email message subject lines, to know what sort of triviality is being tidied. Usually they are 'spelling' or 'variable naming' or some such that can easily be squeezed on the end without breaking the ~50 char guide. In this case there were two types, so I ended up with this suggestion for the message heading

    remote-hg: cleanup 40*{0} string, and de-dup tests

which adds just enough (for me) to get a feel for the style of what's inside

regards
Philip
Show 122 quoted lines
> Cleanup 51be46e (remote-hg: do not fail on invalid bookmarks).
>
> Having a 40-characters string is not ideal, and having three tests for
> basically the same relatively rare situation is overkill.
>
> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
> ---
> git-remote-hg.py     |  2 +-
> t/t5810-remote-hg.sh | 56 
> ++++------------------------------------------------
> 2 files changed, 5 insertions(+), 53 deletions(-)
>
> diff --git a/git-remote-hg.py b/git-remote-hg.py
> index 402b92f..74f2a2e 100755
> --- a/git-remote-hg.py
> +++ b/git-remote-hg.py
> @@ -677,7 +677,7 @@ def do_list(parser):
>             print "? refs/heads/branches/%s" % gitref(branch)
>
>     for bmark in bmarks:
> -        if  bmarks[bmark].hex() == 
> '0000000000000000000000000000000000000000':
> +        if  bmarks[bmark].hex() == '0' * 40:
>             warn("Ignoring invalid bookmark '%s'", bmark)
>         else:
>             print "? refs/heads/%s" % gitref(bmark)
> diff --git a/t/t5810-remote-hg.sh b/t/t5810-remote-hg.sh
> index ba8b2d8..9946f57 100755
> --- a/t/t5810-remote-hg.sh
> +++ b/t/t5810-remote-hg.sh
> @@ -772,7 +772,7 @@ test_expect_success 'remote double failed push' '
>  )
> '
>
> -test_expect_success 'clone remote with master null bookmark, then 
> push to the bookmark' '
> +test_expect_success 'clone remote with null bookmark, then push' '
>  test_when_finished "rm -rf gitrepo* hgrepo*" &&
>
>  hg init hgrepo &&
> @@ -781,67 +781,19 @@ test_expect_success 'clone remote with master 
> null bookmark, then push to the bo
>  echo a >a &&
>  hg add a &&
>  hg commit -m a &&
> - hg bookmark -r null master
> + hg bookmark -r null bookmark
>  ) &&
>
>  git clone "hg::hgrepo" gitrepo &&
>  check gitrepo HEAD a &&
>  (
>  cd gitrepo &&
> - git checkout --quiet -b master &&
> - echo b >b &&
> - git add b &&
> - git commit -m b &&
> - git push origin master
> - )
> -'
> -
> -test_expect_success 'clone remote with default null bookmark, then 
> push to the bookmark' '
> - test_when_finished "rm -rf gitrepo* hgrepo*" &&
> -
> - hg init hgrepo &&
> - (
> - cd hgrepo &&
> - echo a >a &&
> - hg add a &&
> - hg commit -m a &&
> - hg bookmark -r null -f default
> - ) &&
> -
> - git clone "hg::hgrepo" gitrepo &&
> - check gitrepo HEAD a &&
> - (
> - cd gitrepo &&
> - git checkout --quiet -b default &&
> - echo b >b &&
> - git add b &&
> - git commit -m b &&
> - git push origin default
> - )
> -'
> -
> -test_expect_success 'clone remote with generic null bookmark, then 
> push to the bookmark' '
> - test_when_finished "rm -rf gitrepo* hgrepo*" &&
> -
> - hg init hgrepo &&
> - (
> - cd hgrepo &&
> - echo a >a &&
> - hg add a &&
> - hg commit -m a &&
> - hg bookmark -r null bmark
> - ) &&
> -
> - git clone "hg::hgrepo" gitrepo &&
> - check gitrepo HEAD a &&
> - (
> - cd gitrepo &&
> - git checkout --quiet -b bmark &&
> + git checkout --quiet -b bookmark &&
>  git remote -v &&
>  echo b >b &&
>  git add b &&
>  git commit -m b &&
> - git push origin bmark
> + git push origin bookmark
>  )
> '
>
> -- 
> 1.9.2+fc1.3.gade8541
>
> --
> To unsubscribe from this list: send the line "unsubscribe git" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
Previous: Felipe Contreras
Message 10 of 10 in “remote-helper: fixes”
  1. 0/8 remote-helper: fixesFelipe Contreras, Apr 29, 2014
  2. 1/8 remote-hg: fix parsing of custom committerFelipe Contreras, Apr 29, 2014
  3. 2/8 remote-hg: update to 'public' phase when pushingFelipe Contreras, Apr 29, 2014
  4. 3/8 remote-{hg,bzr}: store marks only on successFelipe Contreras, Apr 29, 2014
  5. 4/8 remote-hg: properly detect missing contextsFelipe Contreras, Apr 29, 2014
  6. 5/8 t: remote-hg: split into setup testFelipe Contreras, Apr 29, 2014
  7. 6/8 git-remote-hg: use internal clone's hgrcFelipe Contreras, Apr 29, 2014
  8. 7/8 remote-hg: make sure we omit multiple headsFelipe Contreras, Apr 29, 2014
  9. 8/8 remote-hg: trivial cleanupsFelipe Contreras, Apr 29, 2014
  10. Philip OakleyApr 29, 2014

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.