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

Re: git default behavior seems odd from a Unix command line point of view

From
Daniel Barkalow <barkalow@iabervon.org>
Date
May 12, 2009, 18:26 UTC
Message-ID
<alpine.LNX.2.00.0905121415000.2147@iabervon.org>
In-Reply-To
<4e963a650905120924j52d38c0dg577d93e913013e38@mail.gmail.com>
On Tue, 12 May 2009, Andrew Schein wrote:
Show 9 quoted lines
> Hi Junio -
> 
> Thanks for your reply giving historical context.  The command line
> examples I gave were intended to give examples of the output rather
> than my own usage pattern.
> 
> Here is my actual usage pattern... from a file called "sync.sh"
> (would love feedback on whether this is the gitly? way to solve my use
> case):

What *is* your use case? What you're doing seems nuts to me (like, you're going to send out files with this script that someone is in the middle of editting), but I don't know what you're trying to do.

Show 19 quoted lines
> # environment set up occurs before loop, I pull before "pushing" in an
> attempt to prevent
> # conflicts from being left on the shared repository.
> for dir in ./* ; do
>     if [ ! -d $dir ]      ; then continue ; fi #not a directory
>     if [ ! -e $dir/.git ] ; then continue ; fi #not a git repo
>     dir=`basename $dir`
>     echo "syncing: $dir"
>     set +e # commit returns an error if there is nothing to commit.
>     (cd ./$dir ; git commit -a)
>     set -e
>     (cd ./$dir ; git pull $UP "$REPO/$dir" master)        #pull
>     ssh $HOST "mkdir -p $DEST_CACHE/$LOC/$dir"  # these three lines
> handle "push"
>     rsync -rl --delete ./$dir/.git -e ssh "$DEST:$DEST_CACHE/$LOC/$dir/.git"
>     ssh $DEST "(cd $LOC/$dir ; /tools/bin/git pull
> $DEST_CACHE/$LOC/$dir/.git master)"
> 
> done

What are you trying to avoid by not using "git push"? Why are you committing whatever changes happen to be in working directories? Are you intending to be able to handle non-trivial merges?

	-Daniel
*This .sig left intentionally blank*
Previous: Jeff KingNext: Andrew Schein
Message 5 of 8 in “git default behavior seems odd from a Unix command line point of view”
  1. Andrew ScheinMay 12, 2009
  2. Junio C HamanoMay 12, 2009
  3. Andrew ScheinMay 12, 2009
  4. Jeff KingMay 12, 2009
  5. Daniel BarkalowMay 12, 2009
  6. Andrew ScheinMay 12, 2009
  7. Daniel BarkalowMay 12, 2009
  8. Jeff KingMay 12, 2009

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.