1. 03 Oct, 2008 1 commit
  2. 26 Jul, 2008 1 commit
    • Jeff King's avatar
      run-command: add pre-exec callback · ccf08bc3
      Jeff King authored
      This is a function provided by the caller which is called
      _after_ the process is forked, but before the spawned
      program is executed. On platforms (like mingw) where
      subprocesses are forked and executed in a single call, the
      preexec callback is simply ignored.
      
      This will be used in the following patch to do some setup
      for 'less' that must happen in the forked child.
      Signed-off-by: default avatarJeff King <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      ccf08bc3
  3. 26 Jun, 2008 1 commit
  4. 23 Feb, 2008 2 commits
    • Johannes Sixt's avatar
      start_command(), if .in/.out > 0, closes file descriptors, not the callers · c20181e3
      Johannes Sixt authored
      Callers of start_command() can set the members .in and .out of struct
      child_process to a value > 0 to specify that this descriptor is used as
      the stdin or stdout of the child process.
      
      Previously, if start_command() was successful, this descriptor was closed
      upon return. Here we now make sure that the descriptor is also closed in
      case of failures. All callers are updated not to close the file descriptor
      themselves after start_command() was called.
      
      Note that earlier run_gpg_verify() of git-verify-tag set .out = 1, which
      worked because start_command() treated this as a special case, but now
      this is incorrect because it closes the descriptor. The intent here is to
      inherit stdout to the child, which is achieved by .out = 0.
      Signed-off-by: default avatarJohannes Sixt <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      c20181e3
    • Johannes Sixt's avatar
      start_command(), .in/.out/.err = -1: Callers must close the file descriptor · e72ae288
      Johannes Sixt authored
      By setting .in, .out, or .err members of struct child_process to -1, the
      callers of start_command() can request that a pipe is allocated that talks
      to the child process and one end is returned by replacing -1 with the
      file descriptor.
      
      Previously, a flag was set (for .in and .out, but not .err) to signal
      finish_command() to close the pipe end that start_command() had handed out,
      so it was optional for callers to close the pipe, and many already do so.
      Now we make it mandatory to close the pipe.
      Signed-off-by: default avatarJohannes Sixt <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      e72ae288
  5. 12 Nov, 2007 1 commit
  6. 21 Oct, 2007 2 commits
  7. 24 May, 2007 3 commits
  8. 13 Mar, 2007 2 commits
  9. 12 Mar, 2007 4 commits
  10. 31 Dec, 2006 3 commits
    • Shawn O. Pearce's avatar
      Use /dev/null for update hook stdin. · 95d3c4f5
      Shawn O. Pearce authored
      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: default avatarShawn O. Pearce <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      95d3c4f5
    • Shawn O. Pearce's avatar
      Redirect update hook stdout to stderr. · cd83c74c
      Shawn O. Pearce authored
      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: default avatarShawn O. Pearce <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      cd83c74c
    • Shawn O. Pearce's avatar
      Remove unnecessary argc parameter from run_command_v. · 9b0b5093
      Shawn O. Pearce authored
      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: default avatarShawn O. Pearce <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      9b0b5093
  11. 05 Mar, 2006 1 commit
    • Junio C Hamano's avatar
      Const tightening. · 9201c707
      Junio C Hamano authored
      Mark Wooding noticed there was a type mismatch warning in git.c; this
      patch does things slightly differently (mostly tightening const) and
      was what I was holding onto, waiting for the setup-revisions change
      to be merged into the master branch.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      9201c707
  12. 14 Jan, 2006 1 commit
    • Michal Ostrowski's avatar
      Exec git programs without using PATH. · 77cb17e9
      Michal Ostrowski authored
      The git suite may not be in PATH (and thus programs such as
      git-send-pack could not exec git-rev-list).  Thus there is a need for
      logic that will locate these programs.  Modifying PATH is not
      desirable as it result in behavior differing from the user's
      intentions, as we may end up prepending "/usr/bin" to PATH.
      
      - git C programs will use exec*_git_cmd() APIs to exec sub-commands.
      - exec*_git_cmd() will execute a git program by searching for it in
        the following directories:
      	1. --exec-path (as used by "git")
      	2. The GIT_EXEC_PATH environment variable.
      	3. $(gitexecdir) as set in Makefile (default value $(bindir)).
      - git wrapper will modify PATH as before to enable shell scripts to
        invoke "git-foo" commands.
      
      Ideally, shell scripts should use the git wrapper to become independent
      of PATH, and then modifying PATH will not be necessary.
      
      [jc: with minor updates after a brief review.]
      Signed-off-by: default avatarMichal Ostrowski <[email protected]>
      Signed-off-by: default avatarJunio C Hamano <[email protected]et>
      77cb17e9
  13. 08 Dec, 2005 1 commit
  14. 03 Aug, 2005 1 commit
  15. 01 Aug, 2005 1 commit
    • Josef Weidendorfer's avatar
      [PATCH] Added hook in git-receive-pack · b1bf95bb
      Josef Weidendorfer authored
      Just before updating a ref,
      
          $GIT_DIR/hooks/update refname old-sha1 new-sha1
      
      is called if executable.  The hook can decline the ref to be
      updated by exiting with a non-zero status, or allow it to be
      updated by exiting with a zero status.  The mechanism also
      allows e.g sending of a mail with pushed commits on the remote
      repository.
      
      Documentation update with an example hook is included.
      
      jc: The credits of the basic idea and initial implementation go
      to Josef, but I ended up rewriting major parts of his patch, so
      bugs are all mine.  Also I changed the semantics for the hook
      from his original version (which were post-update hook) so that
      the hook can optionally decline to update the ref, and also can
      be used to implement the overall cleanups.  The latter was
      primarily to implement a suggestion from Linus that calling
      update-server-info should be made optional.
      Signed-off-by: default avatarJunio C Hamano <[email protected]>
      b1bf95bb