1. 31 12月, 2006 17 次提交
    • J
      Update documentation for update hook. · 87a3d29f
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      87a3d29f
    • J
      Merge branch 'jc/send-pack-pipeline' · cc06c870
      Junio C Hamano 提交于
      * jc/send-pack-pipeline:
        Documentation: illustrate send-pack pipeline.
        send-pack: fix pipeline.
      cc06c870
    • S
      Add test case for update hooks in receive-pack. · 27086d0f
      Shawn O. Pearce 提交于
      Verify that the update hooks work as documented/advertised.  This is
      a simple set of tests to check that the update hooks run with the
      parameters expected, have their STDOUT and STDERR redirected to
      the client side of the connection, and that their STDIN does not
      contain any data (as its actually /dev/null).
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      27086d0f
    • J
      a862f97e
    • S
      Teach Git how to parse standard power of 2 suffixes. · d77a64d3
      Shawn O. Pearce 提交于
      Sometimes its necessary to supply a value as a power of two in a
      configuration parameter.  In this case the user may want to use the
      standard suffixes such as K, M, or G to indicate that the numerical
      value should be multiplied by a constant base before being used.
      
      Shell scripts/etc. can also benefit from this automatic option
      parsing with `git repo-config --int`.
      
      [jc: with a couple of test and a slight input tightening]
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      d77a64d3
    • S
      Use /dev/null for update hook stdin. · 95d3c4f5
      Shawn O. Pearce 提交于
      Currently the update hook invoked by receive-pack has its stdin
      connected to the pushing client.  The hook shouldn't attempt to
      read from this stream, and doing so may consume data that was
      meant for receive-pack.  Instead we should give the update hook
      /dev/null as its stdin, ensuring that it always receives EOF and
      doesn't disrupt the protocol if it attempts to read any data.
      
      The post-update hook is similar, as it gets invoked with /dev/null
      on stdin to prevent the hook from reading data from the client.
      Previously we had invoked it with stdout also connected to /dev/null,
      throwing away anything on stdout, to prevent client protocol errors.
      Instead we should redirect stdout to stderr, like we do with the
      update hook.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      95d3c4f5
    • S
      Redirect update hook stdout to stderr. · cd83c74c
      Shawn O. Pearce 提交于
      If an update hook outputs to stdout then that output will be sent
      back over the wire to the push client as though it were part of
      the git protocol.  This tends to cause protocol errors on the
      client end of the connection, as the hook output is not expected
      in that context.  Most hook developers work around this by making
      sure their hook outputs everything to stderr.
      
      But hooks shouldn't need to perform such special behavior.  Instead
      we can just dup stderr to stdout prior to invoking the update hook.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      cd83c74c
    • S
      Remove unnecessary argc parameter from run_command_v. · 9b0b5093
      Shawn O. Pearce 提交于
      The argc parameter is never used by the run_command_v family of
      functions.  Instead they require that the passed argv[] be NULL
      terminated so they can rely on the operating system's execvp
      function to correctly pass the arguments to the new process.
      
      Making the caller pass the argc is just confusing, as the caller
      could be mislead into believing that the argc might take precendece
      over the argv, or that the argv does not need to be NULL terminated.
      So goodbye argc.  Don't come back.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      9b0b5093
    • S
      Automatically detect a bare git repository. · ad1a382f
      Shawn O. Pearce 提交于
      Many users find it unfriendly that they can create a bare git
      repository easily with `git clone --bare` but are then unable to
      run simple commands like `git log` once they cd into that newly
      created bare repository.  This occurs because we do not check to
      see if the current working directory is a git repository.
      
      Instead of failing out with "fatal: Not a git repository" we should
      try to automatically detect if the current working directory is
      a bare repository and use that for GIT_DIR, and fail out only if
      that doesn't appear to be true.
      
      We test the current working directory only after we have tried
      searching up the directory tree.  This is to retain backwards
      compatibility with our previous behavior on the off chance that
      a user has a 'refs' and 'objects' subdirectories and a 'HEAD'
      file that looks like a symref, all stored within a repository's
      associated working directory.
      
      This change also consolidates the validation logic between the case
      of GIT_DIR being supplied and GIT_DIR not being supplied, cleaning
      up the code.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ad1a382f
    • S
      Replace "GIT_DIR" with GIT_DIR_ENVIRONMENT. · 45b09794
      Shawn O. Pearce 提交于
      We tend to use the nice constant GIT_DIR_ENVIRONMENT when we
      are referring to the "GIT_DIR" constant, but git.c didn't do
      so.  Now it does.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      45b09794
    • S
      Use PATH_MAX constant for --bare. · ef5ddb2f
      Shawn O. Pearce 提交于
      For easier portability we prefer PATH_MAX over seemingly random
      constants like 1024.  Make it so.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      ef5ddb2f
    • S
      Force core.filemode to false on Cygwin. · c869753e
      Shawn O. Pearce 提交于
      Many users have noticed that core.filemode doesn't appear to be
      automatically set right on Cygwin when using a repository stored
      on NTFS.  The issue is that Cygwin and NTFS correctly supports
      the executable mode bit, and Git properly detected that, but most
      native Windows applications tend to create files such that Cygwin
      sees the executable bit set when it probably shouldn't be.
      
      This is especially bad if the user's favorite editor deletes the
      file then recreates it whenever they save (vs. just overwriting)
      as now a file that was created with mode 0644 by checkout-index
      appears to have mode 0755.
      
      So we introduce NO_TRUSTABLE_FILEMODE, settable at compile time.
      Setting this option forces core.filemode to false, even if the
      detection code would have returned true.  This option should be
      enabled by default on Cygwin.
      Signed-off-by: NShawn O. Pearce <spearce@spearce.org>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      c869753e
    • T
      Fix formatting for urls section of fetch, pull, and push manpages · 400e74df
      Theodore Ts'o 提交于
      The line:
      
      [remote "<remote>"]
      
      was getting swallowed up by asciidoc, causing a critical line in the
      explanation for how to store the .git/remotes information in .git/config
      to go missing from the git-fetch, git-pull, and git-push manpages.
      
      Put all of the examples into delimited blocks to fix this problem and to
      make them look nicer.
      Signed-off-by: N"Theodore Ts'o" <tytso@mit.edu>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      400e74df
    • J
      Fix yet another subtle xdl_merge() bug · 22b6abcd
      Johannes Schindelin 提交于
      In very obscure cases, a merge can hit an unexpected code path (where the
      original code went as far as saying that this was a bug). This failing
      merge was noticed by Alexandre Juillard.
      
      The problem is that the original file contains something like this:
      
      -- snip --
      two non-empty lines
      before two empty lines
      
      after two empty lines
      -- snap --
      
      and this snippet is reduced to _one_ empty line in _both_ new files.
      However, it is ambiguous as to which hunk takes the empty line: the first
      or the second one?
      
      Indeed in Alexandre's example files, the xdiff algorithm attributes the
      empty line to the first hunk in one case, and to the second hunk in the
      other case.
      
      (Trimming down the example files _changes_ that behaviour!)
      
      Thus, the call to xdl_merge_cmp_lines() has no chance to realize that the
      change is actually identical in both new files. Therefore,
      xdl_refine_conflicts() finds an empty diff script, which was not expected
      there, because (the original author of xdl_merge() thought)
      xdl_merge_cmp_lines() would catch that case earlier.
      Signed-off-by: NJohannes Schindelin <johannes.schindelin@gmx.de>
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      22b6abcd
    • J
      i18n: drop "encoding" header in the output after re-coding. · 53af9816
      Junio C Hamano 提交于
      After re-coding the commit message into the encoding the user
      specified (either with core.logoutputencidng or --encoding
      option), this drops the "encoding" header altogether.  The
      output is after re-coding as the user asked (either with the
      config or --encoding=<encoding> option), and the extra header
      becomes redundant information.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      53af9816
    • J
      commit-tree: cope with different ways "utf-8" can be spelled. · 677cfed5
      Junio C Hamano 提交于
      People can spell config.commitencoding differently from what we
      internally have ("utf-8") to mean UTF-8.  Try to accept them and
      treat them equally.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      677cfed5
    • J
      Move commit reencoding parameter parsing to revision.c · 7cbcf4d5
      Junio C Hamano 提交于
      This way, git-rev-list and git-diff-tree with --pretty can use
      it.
      Signed-off-by: NJunio C Hamano <junkio@cox.net>
      7cbcf4d5
  2. 30 12月, 2006 10 次提交
  3. 29 12月, 2006 9 次提交
  4. 28 12月, 2006 4 次提交