1. 14 9月, 2009 1 次提交
  2. 12 9月, 2009 1 次提交
    • J
      push: make non-fast-forward help message configurable · 75194438
      Jeff King 提交于
      This message is designed to help new users understand what
      has happened when refs fail to push. However, it does not
      help experienced users at all, and significantly clutters
      the output, frequently dwarfing the regular status table and
      making it harder to see.
      
      This patch introduces a general configuration mechanism for
      optional messages, with this push message as the first
      example.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      75194438
  3. 06 9月, 2009 2 次提交
  4. 13 8月, 2009 1 次提交
  5. 06 8月, 2009 1 次提交
  6. 19 7月, 2009 1 次提交
  7. 28 6月, 2009 1 次提交
    • L
      add --porcelain option to git-push · 1965ff74
      Larry D'Anna 提交于
      If --porcelain is used git-push will produce machine-readable output.  The
      output status line for each ref will be tab-separated and sent to stdout instead
      of stderr.  The full symbolic names of the refs will be given.  For example
      
      $ git push --dry-run --porcelain master :foobar 2>/dev/null \
        | perl -pe 's/\t/ TAB /g'
      
      = TAB refs/heads/master:refs/heads/master TAB [up to date]
      - TAB :refs/heads/foobar TAB [deleted]
      Signed-off-by: NLarry D'Anna <larry@elder-gods.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1965ff74
  8. 10 6月, 2009 1 次提交
  9. 25 5月, 2009 1 次提交
  10. 26 3月, 2009 1 次提交
  11. 18 3月, 2009 2 次提交
    • F
      Display warning for default git push with no push.default config · 665d3e8f
      Finn Arne Gangstad 提交于
      If a git push without any refspecs is attempted, display a warning.
      The current default behavior is to push all matching refspecs, which
      may come as a surprise to new users, so the warning shows how
      push.default can be configured and what the possible values are.
      
      Traditionalists who wish to keep the current behaviour are also told
      how to configure this once and never see the warning again.
      Signed-off-by: NFinn Arne Gangstad <finnag@pvv.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      665d3e8f
    • F
      New config push.default to decide default behavior for push · 52153747
      Finn Arne Gangstad 提交于
      When "git push" is not told what refspecs to push, it pushes all matching
      branches to the current remote.  For some workflows this default is not
      useful, and surprises new users.  Some have even found that this default
      behaviour is too easy to trigger by accident with unwanted consequences.
      
      Introduce a new configuration variable "push.default" that decides what
      action git push should take if no refspecs are given or implied by the
      command line arguments or the current remote configuration.
      
      Possible values are:
      
        'nothing'  : Push nothing;
        'matching' : Current default behaviour, push all branches that already
                     exist in the current remote;
        'tracking' : Push the current branch to whatever it is tracking;
        'current'  : Push the current branch to a branch of the same name,
                     i.e. HEAD.
      Signed-off-by: NFinn Arne Gangstad <finnag@pvv.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      52153747
  12. 11 3月, 2009 1 次提交
    • D
      Give error when no remote is configured · fa685bdf
      Daniel Barkalow 提交于
      When there's no explicitly-named remote, we use the remote specified
      for the current branch, which in turn defaults to "origin". But it
      this case should require the remote to actually be configured, and not
      fall back to the path "origin".
      
      Possibly, the config file's "remote = something" should require the
      something to be a configured remote instead of a bare repository URL,
      but we actually test with a bare repository URL.
      
      In fetch, we were giving the sensible error message when coming up
      with a URL failed, but this wasn't actually reachable, so move that
      error up and use it when appropriate.
      
      In push, we need a new error message, because the old one (formerly
      unreachable without a lot of help) used the repo name, which was NULL.
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      fa685bdf
  13. 08 10月, 2008 1 次提交
  14. 17 8月, 2008 1 次提交
  15. 21 7月, 2008 1 次提交
  16. 14 7月, 2008 1 次提交
    • S
      Make usage strings dash-less · 1b1dd23f
      Stephan Beyer 提交于
      When you misuse a git command, you are shown the usage string.
      But this is currently shown in the dashed form.  So if you just
      copy what you see, it will not work, when the dashed form
      is no longer supported.
      
      This patch makes git commands show the dash-less version.
      
      For shell scripts that do not specify OPTIONS_SPEC, git-sh-setup.sh
      generates a dash-less usage string now.
      Signed-off-by: NStephan Beyer <s-beyer@gmx.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      1b1dd23f
  17. 21 4月, 2008 1 次提交
    • P
      Add a remote.*.mirror configuration option · 84bb2dfd
      Paolo Bonzini 提交于
      This patch adds a remote.*.mirror configuration option that,
      when set, automatically puts git-push in --mirror mode for that
      remote.
      
      Furthermore, the option is set automatically by `git remote
      add --mirror'.
      
      The code in remote.c to parse remote.*.skipdefaultupdate
      had a subtle problem: a comment in the code indicated that
      special care was needed for boolean options, but this care was
      not used in parsing the option.  Since I was touching related
      code, I did this fix too.
      
      [jc: and I further fixed up the "ignore boolean" code.]
      Signed-off-by: NPaolo Bonzini <bonzini@gnu.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      84bb2dfd
  18. 21 2月, 2008 1 次提交
    • D
      Resolve value supplied for no-colon push refspecs · 9f0ea7e8
      Daniel Barkalow 提交于
      When pushing a refspec like "HEAD", we used to treat it as
      "HEAD:HEAD", which didn't work without rewriting. Instead, we should
      resolve the ref. If it's a symref, further require it to point to a
      branch, to avoid doing anything especially unexpected. Also remove the
      rewriting previously added in builtin-push.
      
      Since the code for "HEAD" uses the regular refspec parsing, it
      automatically handles "+HEAD" without anything special.
      
      [jc: added a further test to make sure that "remote.*.push = HEAD" works]
      Signed-off-by: NDaniel Barkalow <barkalow@iabervon.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      9f0ea7e8
  19. 20 2月, 2008 1 次提交
    • J
      push: indicate partialness of error message · 2b8130c3
      Jeff King 提交于
      The existing message indicates that an error occured during
      push, but it is unclear whether _any_ refs were actually
      pushed (even though the status table above shows which were
      pushed successfully and which were not, the message "failed
      to push" implies a total failure). By indicating that "some
      refs" failed, we hopefully indicate to the user that the
      table above contains the details.
      
      We could also put in an explicit "see above for details"
      message, but it seemed to clutter the output quite a bit
      (both on a line of its own, or at the end of the error line,
      which inevitably wraps).
      
      This could also be made more fancy if the transport
      mechanism passed back more details on how many refs
      succeeded and failed:
      
        error: failed to push %d out of %d refs to '%s'
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      2b8130c3
  20. 19 11月, 2007 1 次提交
  21. 12 11月, 2007 1 次提交
  22. 10 11月, 2007 1 次提交
  23. 06 11月, 2007 1 次提交
  24. 16 10月, 2007 2 次提交
    • S
      Fix 'push --all branch...' error handling · 18184f79
      Shawn O. Pearce 提交于
      The builtin-fetch topic changed push's handling of --all to setting
      the new TRANSPORT_PUSH_ALL flag before starting the push subroutine
      for the given transport.  Unfortunately not all references within
      builtin-push were changed to test this flag therefore allowing push
      to incorrectly accept refspecs and --all.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      18184f79
    • B
      Add a --dry-run option to git-push. · 11f2441f
      Brian Ewins 提交于
      The default behaviour of git-push is potentially confusing
      for new users, since it will push changes that are not on
      the current branch. Publishing patches that were still
      cooking on a development branch is hard to undo.
      
      It would also be nice to be able to verify the expansion
      of refspecs if you've edited them, so that you know
      what branches matched on the server.
      
      Adding a --dry-run flag allows the user to experiment
      safely and learn how to use git-push properly. Originally
      suggested by Steffen Prohaska.
      Signed-off-by: NBrian Ewins <brian.ewins@gmail.com>
      Signed-off-by: NLars Hjemli <hjemli@gmail.com>
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      11f2441f
  25. 19 9月, 2007 3 次提交
  26. 10 9月, 2007 1 次提交
    • S
      Make --no-thin the default in git-push to save server resources · a4503a15
      Shawn O. Pearce 提交于
      1) pushes happen less often than fetches, so the bandwidth saving is
         much less visible in that case overall.
      
      2) thin packs have to be complemented with missing delta bases to be
         valid, so many received thin packs will take more disk space.
      
      3) the bother of repacking should be distributed amongst "clients"
         i.e. fetchers and pushers as much as possible, and not the server
         being fetched or pushed, to keep disk and CPU usage low on the
         server.
      
      This is why a fetch should get thin packs but a push should not.
      
      Both Nico and I have been assuming that --no-thin was the default
      behavior of git-push ever since Nico introduced --fix-thin into the
      index-pack process, which allowed fetch and receive-pack to avoid
      exploding packfiles received during transfer.  This patch finally
      makes it so.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      a4503a15
  27. 26 5月, 2007 1 次提交
  28. 21 5月, 2007 2 次提交
  29. 07 4月, 2007 2 次提交
    • J
      git-push to multiple locations does not stop at the first failure · fd1d1b05
      Junio C Hamano 提交于
      When pushing into multiple repositories with git push, via
      multiple URL in .git/remotes/$shorthand or multiple url
      variables in [remote "$shorthand"] section, we used to stop upon
      the first failure.  Continue the operation and report the
      failure at the end.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      fd1d1b05
    • J
      git-push reports the URL after failing. · 39878b0c
      Junio C Hamano 提交于
      This came up on #git when somebody was getting 'unable to create
      ./objects/tmp_oXXXX' but sweared he had write permission to that
      directory.  It turned out that the repository URL was changed
      and he was accessing a repository he does not have a write
      permission anymore.
      
      I am not sure how much this would have helped somebody who
      believed he was accessing location when the permission of that
      location was changed while he was looking the other way, though.
      But giving more information on the error path would be better,
      and the next change would be helped with this as well.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      39878b0c
  30. 13 3月, 2007 1 次提交
  31. 12 3月, 2007 1 次提交
  32. 21 2月, 2007 2 次提交
    • J
      prefixcmp(): fix-up mechanical conversion. · 599065a3
      Junio C Hamano 提交于
      Previous step converted use of strncmp() with literal string
      mechanically even when the result is only used as a boolean:
      
          if (!strncmp("foo", arg, 3)) ==> if (!(-prefixcmp(arg, "foo")))
      
      This step manually cleans them up to read:
      
          if (!prefixcmp(arg, "foo"))
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      599065a3
    • J
      Mechanical conversion to use prefixcmp() · cc44c765
      Junio C Hamano 提交于
      This mechanically converts strncmp() to use prefixcmp(), but only when
      the parameters match specific patterns, so that they can be verified
      easily.  Leftover from this will be fixed in a separate step, including
      idiotic conversions like
      
          if (!strncmp("foo", arg, 3))
      
        =>
      
          if (!(-prefixcmp(arg, "foo")))
      
      This was done by using this script in px.perl
      
         #!/usr/bin/perl -i.bak -p
         if (/strncmp\(([^,]+), "([^\\"]*)", (\d+)\)/ && (length($2) == $3)) {
                 s|strncmp\(([^,]+), "([^\\"]*)", (\d+)\)|prefixcmp($1, "$2")|;
         }
         if (/strncmp\("([^\\"]*)", ([^,]+), (\d+)\)/ && (length($1) == $3)) {
                 s|strncmp\("([^\\"]*)", ([^,]+), (\d+)\)|(-prefixcmp($2, "$1"))|;
         }
      
      and running:
      
         $ git grep -l strncmp -- '*.c' | xargs perl px.perl
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cc44c765