Linus Torvalds,Bjorn Stroustrup和Brendan Gregg将为我的业余爱好项目做出贡献。做什么的?

自己看看:这是项目,这是提交历史





来自存储库主页的贡献者列表:





化身上的链接指向真实人物的个人资料页面。



一切就绪。除了此处的“已验证”标牌之外:








Git GPG, : . , , "-" GitHub GitLab .






, //, , :



  1. ;
  2. Ctrl+Enter;


.





, Ctrl+Enter Cmd+Enter. . «», .



. , 220 . — 500 .

()

, — , ( ).



, — , .






UPD: , :



, .



, , .

© https://habr.com/ru/post/515550/#comment_21990276

GitHub, GitLab, GitHub. (, , ).



?



SVN Git, ( ) : " , GitHub ?"



: GitHub , , , .



. , GitHub , .



, ( ) GitHub.





, Git-, :



$ git commit

*** Please tell me who you are.

Run

  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'user@pc.(none)')


, , , .






Git : . , , : Git , .



$ git log --oneline
61c133f |     # <--     
d825484 | ,      .
1d87db4 | ,    
e5e09ae |    !
dfa34b5 |
db4191f |       —
2d3468f | ,  ,    .
5990103 |      ,
43cc6a9 |     !

$ git cat-file -p 61c133f
tree 93edb4a15b5b20f6d35fee611b70d07d581fc8f4
parent d825484462dbe091daa6108538807e37ff49a4b2
author Bjarne Stroustrup <bjarne@stroustrup.com> 1597692753 +0300
committer Bjarne Stroustrup <bjarne@stroustrup.com> 1597692753 +0300

|     —


GitHub, , , . : GitHub , .



. , GitHub email , . , , , . .



GitHub email ,


...



… !" — .



, .



. : Spoofing Git Commits. ( , ) , — . .



GitHub ?





, :



  • GitHub email = lala@mail.com, GPG;
  • lala@mail.com;
  • ;

    • -> "Verified";
    • -> " Verified";
    • -> ;
    • -> ;
    • -> , , — .


"Unverified", .



, ? .



, -



, ( ) / , .



.



— :







, , , git commit — , .



, .



, , . , - , .



, GitHub. , — .



, , : GitHub, .





, - GitHub , GitHub .

- GitHub : Keep my email address private. .



:





, :



  • ;
  • .


? boomburum. GitHub, . .







GitLab, , , ?



, , , .



<> — , .</> , GitLab .








, .



, GitHub: .



  1. ./poem.txt;


  2. #!/bin/bash
    
    #  ,    
    #  - /   ,   
    set -eu
    
    ##########   ############################################
    
    FILE="${1:-./poem.txt}"
    OUT_DIR="${2:-./poetry}"
    OUT_FILE_NAME="README.md"
    OUT_FILE="${OUT_DIR}/${OUT_FILE_NAME}"
    
    export GIT_DIR="${OUT_DIR}/.git"
    export GIT_WORK_TREE="$OUT_DIR"
    
    if [[ -d "$OUT_DIR" ]]; then
      echo "Directory ${OUT_DIR} exists already" >&2
      exit 1
    fi
    
    if [[ ! -s "$FILE" ]]; then
      echo "File ${FILE} doesn't exist or empty" >&2
      exit 2
    fi
    
    mkdir -p "$OUT_DIR"
    touch "$OUT_FILE"
    
    git init 
    
    # ,      
    git config --local commit.gpgsign no
    
    ##########    #######################################
    
    declare -A AUTHORS=( )
    AUTHORS["Linus Torvalds"]=torvalds@linux-foundation.org
    AUTHORS["Vitalik Buterin"]=v@buterin.com
    AUTHORS["Bjarne Stroustrup"]=bjarne@stroustrup.com
    AUTHORS["Brendan Gregg"]=brendan.d.gregg@gmail.com
    AUTHORS["Guido van Rossum"]=guido@python.org
    AUTHORS["Aleksey Boomburum"]=boomburum@gmail.com
    AUTHORS["Ivan Vasilev"]=slavniyteo@gmail.com
    
    #   ,      
    #   get-next-author-name
    declare -a AUTHOR_NAMES=( "${!AUTHORS[@]}" )
    
    ##########  #############################################################
    
    get-next-author-name() {
      local GLOBAL_AUTHOR_INDEX="$1"
      local AUTHOR_INDEX="$(($GLOBAL_AUTHOR_INDEX % "${#AUTHOR_NAMES[@]}"))"
    
      echo "${AUTHOR_NAMES["$AUTHOR_INDEX"]}"
    }
    
    commit-one-line() {
      local AUTHOR="$1"
      local LINE="$2"
      local AUTHOR_EMAIL="${AUTHORS["$AUTHOR"]}"
    
      #     
      echo "$LINE" | cat - "$OUT_FILE" > temp
      mv temp "$OUT_FILE"
    
      git add "$OUT_FILE_NAME"
    
      #  '| '  , 
      #       
      git -c user.name="$AUTHOR" \
          -c user.email="$AUTHOR_EMAIL" \
          commit -m "| $LINE"
    }
    
    ##########   #######################################################
    
    LINE_IDX=0
    while IFS= read -r LINE; do
      LINE_IDX="$((LINE_IDX + 1))"
      AUTHOR="$(get-next-author-name "$LINE_IDX")"
    
      commit-one-line "$AUTHOR" "$LINE"
    done <<<"$(tac "$FILE")" #       
    
    ################################################################################


    UPD:注释后更新了脚本 衣冠不整(我使用git -c user.name=$name而不是git config ...;

    UPD: Fixed read LINE当我遇到反斜杠时,它有点破了。



  3. 我们运行脚本,并对GitHub上的存储库日志不太适合阅读诗歌感到遗憾。
  4. 在欢乐如何炫酷的外观在TIG





All Articles